Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

this is Procedure:

delimiter $$

CREATE DEFINER=`root`@`localhost` PROCEDURE `SampleSP`(IN uname VARCHAR(50),OUT uid VARCHAR(50))
BEGIN

DECLARE sqlcmd VARCHAR(500);
set sqlcmd = 'SELECT userid into '''+uid+''' FROM usertable WHERE username = '''+uname+'''';

EXECUTE sqlcmd;

END$$

I am calling it as..

use `test`;

call SampleSP('Adam',@uid);

its giving error as..

Error Code 1292. Truncated Incorrect DOUBLE value: '''

Im not sure whether I am syntactically correct.

share|improve this question
Show definition of usertable. – Hamlet Hakobyan 19 mins ago

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.