Using a variable in the select clause of a CURSOR

mmbc <[email protected]>
Newsgroups gmane.comp.java.hsqldb.user
Message-ID <[email protected]>
*Is using a variable in the select clause of a CURSOR currently supported?*It
seems according to this link that it is:
http://hsqldb.10974.n7.nabble.com/DECLARE-result-CURSOR-WITH-RETURN-throws-error-when-accessing-parameter-td1766.html
<http://hsqldb.10974.n7.nabble.com/DECLARE-result-CURSOR-WITH-RETURN-throws-error-when-accessing-parameter-td1766.html> 
but according to this link it is not? :
http://hsqldb.10974.n7.nabble.com/user-lacks-privilege-or-object-not-found-td3565.html
<http://hsqldb.10974.n7.nabble.com/user-lacks-privilege-or-object-not-found-td3565.html> 
currently I am attempting to create junit tests using hsqldb
in-memory.CREATE PROCEDURE MyProcedure (    IN guid LONGVARCHAR, IN type
INTEGER, OUT result_code LONGVARCHAR)     READS SQL DATA DYNAMIC RESULT SETS
1BEGIN ATOMIC        DECLARE product_id LONGVARCHAR;        DECLARE
client_products CURSOR WITH RETURN FOR SELECT * FROM MY_TABLE            
WHERE product = product_id FOR READ ONLY;                SELECT accessLevel,
product INTO result_code, product_id FROM LOOKUP_TABLE                WHERE
ID = guid;        OPEN client_products;END;When I run my program I get
java.sql.SQLSyntaxErrorException: user lacks privilege or object not found:
PRODUCT_IDbut if I replace product_id in the procedure with a valid value in
the table say 123456 it runs fine.Is using a variable in the where clause of
a cursor supported?Am I doing this correctly?Is there another way to create
and run a cursor?If it cannot be done this way would using a table return
type from the procedure do the trick/be seen as a ResultSet?I need a work
around to continue my planned path of using hsqldb.I believe I am using
2.3.1my ivy.xml is as follows:        master">                    ThanksMary



--
View this message in context: http://hsqldb.10974.n7.nabble.com/Using-a-variable-in-the-select-clause-of-a-CURSOR-tp3997.html
Sent from the HSQLDB - User mailing list archive at Nabble.com.

------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk

_______________________________________________
Hsqldb-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/hsqldb-user
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.