f



stored procedures - syntax

Hi all,

             I am using mysql 5.0.54, i want to create procedure, i
tried an example in mysql link
"CREATE PROCEDURE sp1 (x VARCHAR(5))
  BEGIN
    DECLARE xname VARCHAR(5) DEFAULT 'bob';
    DECLARE newname VARCHAR(5);
    DECLARE xid INT;

    SELECT xname,id INTO newname,xid
      FROM table1 WHERE xname = xname;
    SELECT newname;
  END;"
but i see an error "ERROR 1064 (42000): 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 '' at line 3",
  In all links & documentation i find the same syntax for declare
statements, i have also created a table which the stored procedure
points to. There is no exact documentation or links for this in MySQL.
I wont get any replies for posts in mysql, so im posting here.. please
please guide me ASAP ... waiting for ur reply..

Thanks in Advance
0
agnesroz (9)
1/24/2008 10:37:07 AM
comp.databases.mysql 6944 articles. 1 followers. laredotornado (869) is leader. Post Follow

0 Replies
332 Views

Similar Articles

[PageSpeed] 5

Reply: