ALLOCATE
The ALLOCATE statement allows you to define and allocate host variables.
General Format
EXEC SQL [ AT Database ] ALLOCATE Host-Variable [ Variable-Type ] END-EXEC |
Syntax Rules
1. Host-Variable must be defined as USAGE HANDLE in DATA DIVISION.
General Rules
1. Database identifies the active connection that will execute the query and must be previously defined using a Format 4
DECLARE statement.
Examples
Allocate is an Oracle specific SQL stmt. This sample allocates a cursor handle, uses it and releases it at the end.
exec sql allocate :cur-hndl end-exec. exec sql execute begin open :cur-hndl for select * from emp; end; end-exec. exec sql fetch :cur-hndl into :empno,:ename end-exec. exec sql free :cur-hndl end-exec. |