Re: String parm in Stored Proc. & using it with IN clause?
Posted in 2000
From: "Art S. Kagel & Family" <kagel@erols.com> > >Manas wrote: > > > > Here is the situation I am trying to resolve: > > > > I have an Integer type column say prod_no and I am > > passing a string with values say "2344, 5678, 98" through the > > <as_prod_nos> parameter. > > > > I have a Select statement inside the Stored Proc. > > that says > > > > <FOREACH SELECT prod_name into s_prod_name FROM > > Products WHERE prod_no IN (as_prod_nos) > > .. > > > > END FOREACH;> > > > > On excuting I get a data type conversion error (-1213). > > > > How can I avoid this? > >Stop trying to sneak dynamic SQL into stored procedures. SPL does NOT >support dynamic SQL in any form! Package that SQL into a library >function in C and call it from there. It will be much faster anyway. > > > I will appreciate any help. If you know if I can use PREPARE and then > > execute in a stored procedure then please let me know that too. > >No you cannot. <Gulp> Er, Art, you missed Paul Brown's post? There is now a datablade for 9.x that allows dynamic SQL in SPL. I've built it and installed it. Now I just have to work out how to use it. 8^} ______________________________________________________ Get Your Private, Free Email at http://www.hotmail.com