Hi there,
I'm trying to script the execution of (generated) prepared queries.
It does not look possible, because the identifier to use for the EXEC statement is returned dynamically by the PREPARE statement:
sql>prepare select 1;
execute prepared statement using: EXEC 73(...)
This can obviously not be scripted. If I tried to parse the output of the prepare statement to retrieve the identifier, this would split PREPARE and EXEC in two different mclient sessions, losing the prepared statement.
As far as I know, there is at the moment no syntax available for providing the identifier, something like:
sql>prepare myid as select 1;
(that wouldn't be a bad idea, would it?)
Besides syntax extensions, I was wondering if there is any trick I could use at runtime with the current syntax to retrieve that identifier.
Like, is it stored in some system table? Is it available as any undocumented variable? I could not find anything like that, but I might have missed it.
Cheers,
Roberto