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.
Roland Mueller — — source: Informix-list mailing list archive (1991-1998)
The SPL doesn't support dynamic SQL (at least in V6).
What you would have to do (if SPL supported dynamic SQL) to get it
working, would be to assign your statement to a string, prepare and
execute it, fetch the result into a variable.
No help, sorry.
Roland
Torsten Wassum wrote:
>
> How can I pass a table name to a stored procedure and
> use it in a select command?
>
> Here is what I am trying to do:
>
> 1. Call the stored procedure and pass a tablename:
>
> EXECUTE PROCEDURE test ("table1")>
> 2. This would be the stored procedure:
>
> CREATE PROCEDURE test (tablename (CHAR(10))
> ...
> SELECT MAX (value)
> FROM tablename
> INTO max_value;> ...
> END PROCEDURE;
>
> It is not working the way it is listed here!
> Does anybody know how to do that?
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.