Record transfer from Oracle array to Cobol occurs

How to transfer record from oracle to Cobol array? When I move one field, everything works as expected. When I try to move a record to Oracle VARRAY, I cannot get it to work. The PRO * COBOL precompiler contains the following error message:

Error at line 137, column 12 in file ESF3.ordbso07.PCO EXEC SQL EXECUTE ...........1 PCB-S-00576, PLS-382: expression is of wrong type Error at line 137, column 12 in file ESF3.ordbso07.PCO EXEC SQL EXECUTE ...........1 PCB-S-00576, PLS-0: Statement ignored 

Oracle Types:

 TYPE QDELSSRD_arr IS VARRAY(30) OF QDELSSRD_typ; TYPE SODLSSRD_typ IS RECORD ( -- DBSO07 SOK QDELSSRD QDELSSRD_arr -- 30 x QDELSSRD_typ OC is SODLSSRD_typ; TYPE QDELSSRD_typ IS RECORD ( ENAMN arbetssokande.efternamn%type, -- VARCHAR2(30 CHAR) FNAMN arbetssokande.fornamn%type, -- VARCHAR2(20 CHAR) ); 

A fragment of an anonymous PL / SQL block COBOL ESQL:

 FOR LV IN 1..:RC-ZHITS LOOP :QDELSSRD(LV) := OC.QDELSSRD(LV); END LOOP; 

Variable declaration COBOL:

  15 QSODLSSRD. 18 QDELSSRD OCCURS 30. 21 ENAMN PIC X(030). 21 FNAMN PIC X(020). 
+6
source share
1 answer

I think you need to use VARYING ... For example:

 18 QDELSSRD VARYING OCCURS 20 TIMES. 21 ENAMN PIC X(030). 21 FNAMN PIC X(020). 

http://www.pitt.edu/~hoffman/oradoc/server.804/a58232/ch04.htm

0
source

Source: https://habr.com/ru/post/901982/


All Articles