pkmurali Warnings : 1 Active User
Joined: 15 Dec 2005 Posts: 271
|
|
|
|
Need Clarification on 'IN'
Hi Dick Brenholtz,
I used host variable-array in the below SQL statements, but i got compilation error as 'UNUSABLE HOST VARIABLE'. <my DB2 version is 9.5>, Is host variable array is applicable only for multi-row fetch and insert then i tried for select,
EXEC SQL
DECLARE CSR1 CURSOR
SELECT C1 FROM TAB1
WHERE C2 IN(:WS-VAR-GRP)
END-EXEC
Declaration for WS-VAR-GRP
01 WS-VAR-GRP.
03 WS-VAR-ARR OCCURS 20 TIMES.
05 WS-VAR PIC S9(9) COMP.
in my previous posting i didn't get the compilation when i declared as,
Declaration for WS-VAR-GRP
01 WS-VAR-GRP.
05 WS-VAR1 PIC S9(9) COMP.
05 WS-VAR2 PIC S9(9) COMP.
.
.
.
05 WS-VAR20 PIC S9(9) COMP.
Is any slack variable(assumption) or any other stuff which prevents to operate on host variable array?
Please clarify. |
|