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.
Obnoxio The Clown — — source: Informix-list mailing list archive (1991-1998)
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
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.