01 WS-FIELDB-IND pic s9(4) comp-5.

FETCH CURSORA
INTO :WS-FIELDA
:WS-FIELDB :WS-FIELDB-IND

if WS-FIELDB-IND less than 0 ...

PM

"E. Scott" <scott.raysunlife.com> a écrit dans le message de news:
[email]48618db6.0308010656.75f4cc62posting.google.com[/email]...
> I am writing a COBOL program with a DB2 query against various tables
> doing a left join much like the simplified following example.
>
> EXEC-SQL.
> DECLARE CURSORA CURSOR FOR
> SELECT A.FIELDA,
> B.FIELDB
> FROM TABLEA A LEFT JOIN TABLEB B
> ON FIELDA
> END-EXEC.
>
> EXEC SQL.
> FETCH CURSORA
> INTO :WS-FIELDA
> :WS-FIELDB
> END-EXEC.
>
> Given that FIELD B could be NULL because of the left join how should
> the NULLINDS be declared? I am getting -305 here and not sure how to
> eliminate.
>
> Thanks for any insight.
>
> SR