> I am trying to execute a stored procedure using dynamic
> sql.
>
> I did the following:
>
> ------------------ x.ec
>
> $char spstr[1024];
>
> sprintf(spstr, "execute procedure sp(%s) into %s",
> "?,?", "?");
>
> $prepare sid from :spstr;
> $execute sid using :x, :y, :z;
>
> --------------------
>
> When I run my program, I get sqlerror #201 (syntax error)
> on prepare statement.
>
> If I don't use the "into" in the execute procedure,
> like this:
>
> sprintf(spstr, "execute procedure sp(%s)", "?,?");
>
> $prepare sid from :spstr;
> $execute sid using :x, :y;
>
> it works fine.
>
> Can somebody help me in finding why I get this error
> when I use "into".
That's right, you can't prepare an INTO, not in ESQL/C, not in 4GL, not
in nuthin'.
The justification is that PREPARE is done in the engine, which knows
nothing about any front-end environment of any kind.
akent@cix.compulink.co.uk (Andy Kent)
------------------------------------------------
Freelance Informix Database Specialist,
Redland, Bristol, England