You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to use the cursors with the null indicators I verified that in the presence of null values a zero value is always returned.
01 COM-NULL-IND PIC S9(4) COMP.
* Cursor declaration
EXEC SQL
DECLARE CUR_ST_EMPTBL CURSOR FOR
SELECT PAYRATE, COM
FROM EMPTABLE
WHERE LNAME = 'XYZ1' AND
FNAME = 'ABC1' AND
COM IS NULL
END-EXEC.
* open cursor
EXEC SQL
OPEN CUR_ST_EMPTBL
END-EXEC
MOVE SQLCODE TO DISP-CODE
DISPLAY 'open ' DISP-CODE.
DISPLAY 'open ' SQLERRM.
* fetch a data item
EXEC SQL
FETCH CUR_ST_EMPTBL
INTO :PAYRATE, :COM:COM-NULL-IND
END-EXEC.
* loop until no more data
PERFORM UNTIL SQLCODE < 0 OR SQLCODE = 100
* display the record
DISPLAY 'commission: [' COM ']'
DISPLAY 'COM-NULL-IND: [' COM-NULL-IND ']'
IF COM-NULL-IND < 0
DISPLAY LNAME ': commission is null'
ELSE
execution display fetch
commission: [000+]
COM-NULL-IND: [+00000]
In single-row SELECT it works correctly
EXEC SQL
SELECT PAYRATE, COM
INTO :PAYRATE, :COM:COM-NULL-IND
FROM EMPTABLE
WHERE LNAME = 'XYZ1' AND
FNAME = 'ABC1' AND
COM IS NULL
END-EXEC.
* display the record
DISPLAY 'commission: [' COM ']'
DISPLAY 'COM-NULL-IND: [' COM-NULL-IND ']'
IF COM-NULL-IND < 0
DISPLAY LNAME ': commission is null'
ELSE
execution display select
commission: [000+]
COM-NULL-IND: [-00001]
: commission is null
The gixpp version
gixpp -V
gixpp - the ESQL preprocessor for Gix-IDE/GixSQL
Version: 1.0.20b
libgixpp version: 1.0.20b
The cobc version
cobc -V
cobc (OpenCOBOL) 2.0.0
Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Keisuke Nishida
Copyright (C) 2006-2012 Roger While
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Built Nov 30 2023 11:35:35
Packaged Feb 11 2012 12:36:31 UTC
C version "8.3.0"
Trying to use the cursors with the null indicators I verified that in the presence of null values a zero value is always returned.
01 COM-NULL-IND PIC S9(4) COMP.
execution display fetch
In single-row SELECT it works correctly
execution display select
The gixpp version
The cobc version
Os Version
The text was updated successfully, but these errors were encountered: