Oracle11g: java.lang.IllegalArgumentException: No SQL selected for execution
A Java SQL client for any JDBC compliant database
Brought to you by:
colbell,
gerdwagner
Below code uses Oracle 11g Express demo database. The procedure was compiled in SQL Developer.
CREATE OR REPLACE procedure sp_ListOrders(orderCursor OUT SYS_REFCURSOR)
IS
BEGIN
open orderCursor FOR
SELECT * FROM ALEX.demo_orders;
END;
When this code runs in SQL Developer, it completes successfully.
DECLARE
crsOrder SYS_REFCURSOR;
tblOrder ALEX.demo_orders%rowtype;
BEGIN
alex.sp_listorders(crsOrder);
loop
FETCH crsOrder into tblOrder;
exit when crsORder%notfound;
end loop;
close crsOrder;
dbms_output.put_line(tblOrder.order_id);
END;
It throws the following error in Squirrel 3.5.0 using ojdbc7.jar:
java.lang.IllegalArgumentException: No SQL selected for execution.
Position: 0
The solution could be to place a slash (/) on the line following "END;" because this is the default statement separator for functions, triggers and procedures that lets SQuirreL know that the statement is complete.