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
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
Advertisements
My SQL upgrade to version 5.5 issue
My SQL upgrade to version 5.5 issue  My SQL upgrade to version 5.5 issue
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
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
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
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
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  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
upgrading sql query join
upgrading sql query join  upgrading sql query join
ModuleNotFoundError: No module named 'sql-query'
ModuleNotFoundError: No module named 'sql-query'  Hi, My Python... python library, ModuleNotFoundError: No module named 'sql-query' error... 'sql-query' How to remove the ModuleNotFoundError: No module named 'sql
optimize sql query
optimize sql query  How to optimize sql query in mysql? Thanks
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
My SQL
My SQL  Connection class for MySQL in java
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
display sql query in hibernate
display sql query in hibernate  If you want to see the Hibernate generated SQL statements on console, what should we do
Hibernate SQL Query/Native Query
This tutorial describes Hibernate SQL Query, which is also known as Native Query
ModuleNotFoundError: No module named 'sql_query_dict'
ModuleNotFoundError: No module named 'sql_query_dict'  Hi, My... 'sql_query_dict' error? Thanks   Hi, In your python... 'sql_query_dict' error will be solved. Thanks
SQL Error Version 5.5.15
SQL Error Version 5.5.15  SQL Error Version 5.5.15
Update SQL Query Example
Update SQL Query Example  Hi, I am beginner in SQL (MySQL) and trying to learn Update SQL Query with Example code. Can anyone explain me the SQL Update query with an example code? Thanks   Hi, A simple example
sql syntax error help
sql syntax error help  this query show syntax error .. i am unable to figure it out insert into order (orderdate, dpname, paymethod, tamount...') where is the error ?   Please send the error details and the datatype
sql query search function
sql query search function  i have a textbox on a form , i like a search a data in the form, when i give whatever name and id or etc..its will search and show the same form , so help me using jsp
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
SQL connection error in android
SQL connection error in android  hi, i am android developer . recently i made one application connect with sql server 2005 using jtds...:sql:Exception : BUFFERDIR connection property invalid. if you have any answer

Ads