MySQL Forums
Forum List  »  Stored Procedures

Re: Sending string as param to sproc
Posted by: Peter Brawley
Date: November 26, 2015 12:23PM

See the manual page for PREPARE. The sproc needs to say something like ...

set @sql = concat( "select * from factory where productid in(", productidlist, ") order by productid, comment" );
prepare stmt from @sql;
execute stmt;
drop prepare stmt;

If productID isn't a numeric, the list items will need to be single-quoted.

Options: ReplyQuote

Written By
November 26, 2015 06:00AM
Re: Sending string as param to sproc
November 26, 2015 12:23PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.