Sign in with
Sign up | Sign in
Your question

Help with mysql query..

Last response: in Applications
Share
May 11, 2012 11:00:07 AM

hey guys, was hoping u could help me out...

ok i do know some sql, but im new to mysql... and theres this simple query that i just cant figure out whats wrong with it...

Quote:


CREATE PROCEDURE inserttoscrapbookSD
(owner1 VARCHAR(50),
poster1 VARCHAR(50),
Scrap1 VARCHAR(50),
Date_time1 DECIMAL,
InsertedOrNot DECIMAL
)
BEGIN

INSERT INTO scrapbook (Owner)

VALUES(owner1)

END



i know there are a lot of variables being passed, but just using one variable atm because if it works for one, itll work for all.. i tried with and without a semicolon (;) at the end of "END" but no luck.. it says

#1064 - 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 'END' at line 14

thanks in advance

More about : mysql query

May 11, 2012 1:48:54 PM

hmm, i'm not that much into mysql, but i'd go with a missing semicolon at the end of the insert statement " ... VALUES(owner1) ;" and after the procedure definition "... END ;"
m
0
l
May 11, 2012 3:17:58 PM

mgwildi said:
hmm, i'm not that much into mysql, but i'd go with a missing semicolon at the end of the insert statement " ... VALUES(owner1) ;" and after the procedure definition "... END ;"



no luck, this is what i tried:

Quote:


CREATE PROCEDURE inserttoscrapbookSD
(owner1 VARCHAR(50),
poster1 VARCHAR(50),
Scrap1 VARCHAR(50),
Date_time1 DECIMAL,
InsertedOrNot DECIMAL
)
BEGIN

INSERT INTO scrapbook (Owner)

VALUES(owner1);

END ;

m
0
l
May 11, 2012 4:44:45 PM

hmmm okay...! could it be about the parameters directions?

I just rapidly checked for mysql procedure syntax, I think you have to specify it for PROCEDURE (which doesn't seem to be the case when creating a FUNCTION)
m
0
l
!