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

chenwenhui <[email protected]> Wed, 5 Nov 2014 16:01:24 +0800 (CST)
Newsgroups gmane.comp.java.hsqldb.user
Message-ID <[email protected]>
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/hsqldb-user