Execute an Oracle procedure with Acu4GL

0 Likes

Problem:

From Oracle's SQL*Plus prompt the following is entered to run a procedure:

SQL> EXECUTE MYPROCEDURE('my data');

PL/SQL procedure successfully completed.

The procedure simply updates a table with the new data, and it runs without error.

When the COBOL program passes the same statement to the SQL.ACU program an error occurs about being invalid. This is the relevant portion of the runtime trace file:

 Try loading 'SQL.ACU'...

SQL.ACU loaded

ora_execute:

ORACLE EXECUTE :

execute MYPROCEDURE('my data');

ERROR CODE = [900]

ORA-00900: invalid SQL statement

 

Resolution:

To execute an Oracle Procedure, the SQL command passed to SQL.ACU must use the BEGIN… END; syntax rather than EXECUTE:

BEGIN MYPROCEDURE('my data'); END;

Note that only procedures that do not return any data may be executed by calling SQL.ACU.

Comment List
Related
Recommended