We're running Informix 5.03UC1 on a couple of different hardware
platforms. The question has come up about execute a dynamically
specified stored procedure in ESQL/C.
sprintf(string, "execute procedure %s(%d, %d, %d) into ?"
$prepare sp_id from $string;
returns an SQLCODE of -201 (a generic syntax error). Without the "into
?", it prepares okay, but later, on the execute statement, if we $execute
sp_id using an sqlda structure, it gives us error -254, which is that too
many or too few host variables are used. If we prepare it without the
"into ?" and we also do not use an sqlda structure, we get an error -684,
which is, logically enough, that the number of returned values is more
than the number of values expected.
The problem we're trying to solve is that of allowing someone to tell an
application what stored procedure needs to be executed without us
pre-defining the allowed stored procedures. Any suggestions on syntax or
alternatives?
--
William Harris (Standard disclaimers)
CARS Information Systems http://www.carsinfo.com/~william/
4000 Executive Park Drive
Cincinnati, OH (USA) 45241