I am trying to use an Oracle cursor in my PB code and it is returning an "Invalid SQL Statement" error after I run the OPEN cursor_name line of code.
I am creating the SQL statement as a string variable (strSQL). Then I have the following:
DECLARE prem_cursor CURSOR FOR strSQL;
OPEN prem_cursor;
When I look at the SQLDBCode after the declare it is zero. When I look at the SQLDBCode after the open it is ORA-0900 - "Invalid SQL Statement". I copied the value of the strSQL variable and ran it against the same database and it returned 19 rows.
Is there an issue with using a variable to create a cursor? I cannot see any other issues????
Thanks!
Stacy