Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
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.
--
Art S. Kagel & Family
kagel@erols.com
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.