Does HSQLDBD support to execute dynamic sql statement? such as the 'exec' or 'sp_executesql' statement for MSSQL.

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Does HSQLDBD support to execute dynamic sql statement? such as the 'exec' or 'sp_executesql' statement for MSSQL.

chenwenhui

I want to select a dynamic column from the table via a procedure.
Assuming the main logic is as follows:
Create table MyTable(
f1 varchar(100);
f2 varchar(100);
);
insert into MyTable(f1,f2) values('value1','value2');
......

Create procedure MyProc(IN col_name varchar(32))
MODIFIES SQL DATA DYNAMIC RESULT SETS 1 BEGIN ATOMIC
DECLARE result CURSOR FOR select col_name from MyTable;
open result; 
END

Call MyProc('f1');
I expect to get the field value named 'f1', it should be 'value1', but only get the constant 'f1' via the way above.
How to do? Any ideas can be appreciated!






------------------------------------------------------------------------------

_______________________________________________
Hsqldb-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/hsqldb-user
Loading...