When I migrate a Oracle Function to HSQLDB I need translate the "Select into" for HSQLDB. The Oracle script may look like:
CREATE FUNCTION getId()
RETURN NUMBER IS
temp_id NUMBER;
...
BEGIN
....
SELECT id id INTO temp_id from ( select id form ..... );
In HSQLDB 2.0.0, I can do the following:
CREATE FUNCTION getId()
RETURNS BIGINT
BEGIN ATOMIC
DECLARE temp_id BIGINT;
....
SET temp_id = SELECT id id FROM ....
However, it doesn't work in HSQLDB 2.2.9 anymore. The error message is:
[CREATE - 0 row(s), 0.000 secs] [Error Code: -5608, SQL State: 42608] wrong or missing data impact clause in declaration: READS SQL in statement
From the release note of HSQLDB 2.2, it says they already support "select into", but I didn't find the way.
Anyone know how to do it in HSQLDB 2.2.9?