I am new in learning stored procedure.Now I am trying to make a procedure which will generate a random number and store it in a variable and then insert the value in another table.
create procedure getRand()
begin
delcare rc varchar(255);
SELECT CHAR(ROUND(65 + FLOOR( RAND() * 57 ))) into rc;
insert into Rand_loader (snum,rnum) values (rc,rc);
end//
But when I tried to run this on mysql then it gives this 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 'rc varchar(255);
SELECT CHAR(ROUND(65 + FLOOR( RAND() * 57 ))) into rc;
insert' at line 3
I am unable to understand this error.Ill appreciate your help
Please help me to solve this