MY Sql Query Error - Not able to Understand the issue

Ads
 

MY Sql Query Error - Not able to Understand the issue

I am new at MYSQL,I wrote simple query as follow:

CREATE Table tblFeedBack ( FeedBackID INT AUTOIncremeNT, UserID INT, InsertedTS TIMESTAMP , FeedBackValue VARCHAR(100), PRIMARY KEY (FeedBackID) );

CREATE PROCEDURE tblFeedBackInsertUpdate ( IN UID INT, IN FB_Value VARCHAR(50) ) BEGIN

IF ((Select COUNT(*) From 'tblFeedback') < 3) BEGIN INSERT INTO 'tblFeedBack' (UserID,FeedBackValue) VALUES (UID,FBValue); END ELSE BEGIN DECLARE @MostRecentFID INT;

Select TOP 1 FeedBackID FROM tblFeedback WHERE UID = UID ORDER BY InsertedTS DESC INTO @MostRecentFID;

UPDATE tblfeedback SET FeedBackValue = @FeedBackValue Where FeedBackID = @MostRecentFID END END

I am getting an error as follow:

Schema Creation Failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''tblFeedBack' (UserID,FeedBackValue) VALUES (1,'12')' at line 9:

Can anyone please help me to solve this one ? Thanks in advance.

View Answers

Ads









Related Tutorials/Questions & Answers:
MY Sql Query Error - Not able to Understand the issue
MY Sql Query Error - Not able to Understand the issue  I am new at MYSQL,I wrote simple query as follow: CREATE Table tblFeedBack ( FeedBackID INT... END I am getting an error as follow: Schema Creation Failed: You have an error
My SQL upgrade to version 5.5 issue
My SQL upgrade to version 5.5 issue  My SQL upgrade to version 5.5 issue
Advertisements
SQL QUERY ERROR
SQL QUERY ERROR  Im writing a query which shows error of INVALID CHARACTER The Query is Insert into PMST_EMP_MST(PMSNUM_EMP_ID,PMSSTR_EMP... THE FORM IS THROWING THE ERROR OF INVALID CHARACTER BUT THE SAME QUERY IS RUNNING
My Sql Error - Development process
My Sql Error  Hello Sir ,I have Created Table with following Query...,Its Very Very Urgent. Thank u very Much for urs Great Support in My project. Query CREATE TABLE `timetable` ( `busno` int(255) default NULL, `source
how to call list objects as string into my sql query?
how to call list objects as string into my sql query?  how to call list data as string into my sql query so that i can retrieve all values from database? List has data retrieved from xml(using xmlSAXparser
how do i use sql like query in my jsp page
how do i use sql like query in my jsp page  how do i use sql like query in my jsp page   Hi Friend, Try the following code: <%@ page import="java.sql.*"%> <% Class.forName("sun.jdbc.odbc.JdbcOdbcDriver
Resultset Issue in SQL
Resultset Issue in SQL  when i call rs.next() in my code it is returning false, though im having valid query to execute and fetch a row from database.how can i resolve this issue. My code is: SELECT JOBDESCRIPTION,CATEGORY
Please help me understand this query
Please help me understand this query  Hi, Could someone please help me understand the following query. Im finding difficulty relating it :-( Pls Help! select * from cbpartner where CBPartner.IsSummary='N' and salesrep_id
Sql Query
Sql Query  Is this query work in Db2 or not ? Select * from FORUM LIMIT 2
Sql Query
Sql Query  Is this query work in Db2 or not ? Select * from FORUM LIMIT 2
My SQL
My SQL  Connection class for MySQL in java
sql query
sql query  two tables are emp,loc write a query to display all the emp information whose locname not equal to bangalore
sql query
sql query  hi friend, Im doing a project,in that a main id... numbers of sids.i want to delete the sid based on the mid.for that i need sql query plz help to me
sql query
sql query  hi friend, Im doing a project,in that a main id... numbers of sids.i want to delete the sid based on the mid.for that i need sql query plz help to me
sql query
sql query  hi friend, Im doing a project,in that a main id... numbers of sids.i want to delete the sid based on the mid.for that i need sql query plz help to me
Sql Query
Sql Query  Hi M Navjeet Ghai I want to know How to Show A name(Like Navjeet Ghai And Manpreet Singh Sodhi) of employees from a employee table as N.Ghai & M.S.Sodhi by using sql query
SQL Query
SQL Query  Selecting the third highest salary of Employee without using any subquery?   Here is a query: SELECT salary FROM employee ORDER BY salary DESC LIMIT 2,1
SQL QUERY
SQL QUERY  am a having a table 'PROGRAMMER' with columns... C pascal Bhanu Sql... Pascal Sql Mahesh DBASE Cobol
sql query
sql query  SQL QUERY BROWSER declare @cout00 int declare @cout01 int...); this is the query i have written for the table "dpscomp" - station date month... but i m not able to execute it as i want to count according to the conditions
query - SQL
and the other is employee in my database. in user_details i have given a userid varchar... of my proj.And in employee table also i have to give userid,username... tell me how to write the query in database but not jsp code. thank u
SQL Query - SQL
SQL Query  Hi I would like to know how to create a SQL query which would copy values from a field which contains multiple values to an existing... | +-----+-----------+-------------+ Query: INSERT INTO table2 (fruit1, fruit2, fruit3
upgrading sql query join
upgrading sql query join  upgrading sql query join
SQL query
SQL query  I need to combine two tables in order to get the values. As an example we have three tables having namely usertable,job table and jobaccess table. In usertable (Userid,Empid,name,Role) details have been stored
error : not an sql expression statement
error : not an sql expression statement  hii I am gettin followin error in connecting to database SQLserver 2005 in Jdeveloper,i m usin struts and jsp my pogram: import java.sql.*; public class TaskBO { public TaskBO
plz solve my query?
plz solve my query?  how to remove all the options from select control in html using java script?   JavaScript remove all items <html> <script language="javascript" > function removeAllItems(selectbox
optimize sql query
optimize sql query  How to optimize sql query in mysql? Thanks
sql query - JDBC
sql query  I need a SQL query to add data into database
sql query - SQL
sql query  hi sir,i have a month and year numbers,when i am enter a month and year in sql query then i want results for 1st day of month to last day of month in that year for that month plz provide a solution
SQL Error - SQL
SQL Error  Invalid character value for cast specification on column number 5 (Designation) Whats this error about this if the field i specified in programming error. ie DB fields in above question
UNICODE or SQL statement issue - JDBC
nothing ...... I had also change my backhand to SQL SERVER but retrieves same...UNICODE or SQL statement issue  Hi again............ I have got something new that........... i was using MS Access as the database with my
SQL query - SQL
SQL query  hi sir/Madam i am using MS Access where i have table like Fees_Struc: Amount (INT) Due_Date (Date) Fees_Pay: Paid(INT) Student_Bal: Panalty(INT) my problem is when the Due_date is equal

Ads