[Migrated content. Thread originally posted on 06 June 2008]
:confused:There has a problem when I tested ACUCOBOL-GT ACUSQL DB2:I declared a "S9(6)V9(2) USAGE IN COMP-3" type host variable, it was corresponding to the database field of "decimal (8,2)" type,
If the variable accept data from the database field, "Memory access violation" error occurred when I executed runcbl to run this program;
If the variable assignment data to the database field ,there had no error when I executed runcbl to run this program;
When I change database from DB2 to mysql, this problem still exist.
My company have bought ACUCOBOL-GT V7.2.1 ACUSQL V7.2.1,
DB2 version express 9.5. OS version REDHAT AS4
How to solve this "Memory access violation" problem ? thank you a lot!
Sorry for my poor english.
Best Regards!
My program section:
EXEC SQL BEGIN DECLARE SECTION END-EXEC.
01 C-RECORD.
05 C-MYVAR PIC S9(12)V9(02) COMP-3.
01 I-DATA.
05 I-MYVAR PIC S9(12)V9(02) COMP-3.
EXEC SQL END DECLARE SECTION END-EXEC.
EXEC SQL
DECLARE COBCUR1 CURSOR FOR
SELECT AMT_SALE FROM SALE1
END-EXEC.
EXEC SQL
OPEN COBCUR1
END-EXEC.
**** error occur when program executed this section
PERFORM UNTIL SQLCODE NOT EQUAL 0
EXEC SQL
FETCH COBCUR1 INTO :C-RECORD
END-EXEC
END-PERFORM.
****no error when program executed this section
EXEC SQL
INSERT INTO SALE1 (AMT_SALE) VALUES (
:I-MYVAR
)
END-EXEC.



