Pro*COBOL and VARRAY ?

From: Claude Kaber <ckaber_at_pt.lu>
Date: Wed, 30 Jan 2002 21:15:22 +0100
Message-ID: <3c585370$1_1_at_news.vo.lu>


Hello,
I'm an ORACLE newbie.

Is it possible to fill a VARRAY in an ORACLE table, using a COBOL program with embedded SQL orr embedded PL/SQL ?

Assume a table defined in SQL like:

CREATE OR REPLACE TYPE MyArrayType IS VARRAY(60) OF VARCHAR2(100); /
CREATE OR REPLACE TABLE MyTableWithArray (

 Name     VARCHAR2(20),
 Date       VARCHAR2(8),
 MyTestArrayField       MyArrayType,

...
...

)
...

/

Does Pro*Cobol supportVARRAYS in any way ?

Say i've the following Host-Table defined in the DECLARE SECTION of my COBOL program:



EXEC SQL BEGIN DECLARE SECTION END-EXEC. 01 LineOfText OCCURS 60 TIMES PIC X(100).
....

EXEC SQL END DECLARE SECTION END-EXEC.

Is there a way of filling a 'MyTestArrayField' with the contents of 'LineOfText' ?

Is there a way making Pro*Cobol recognize the 'MyArrayType' - Type ?

Eg: i could define a similar type using PL/SQL:




EXEC SQL EXECUTE.
DECLARE
   TYPE MyPlSqlArrayType IS VARRAY(60) OF VARCHAR2(100);    MyArrayInstance MyPlSqlArrayType;
BEGIN  < some intelligent code moving 'LineOfText' to the VARRAY'S of the 'MyTableWithArrays'-Table >
...

END;
END-EXEC.
----------------------------------------------------------------------------
--------------------------

Maybe there's a Workaround using a stored procedure ?

ORACLE-VERSION is 8.0.4,
PRECOMILER VERSION is Pro*Cobol 1.8.26 (= without LOB support)

Any help is much appreciated !
greetings,
Claude Received on Wed Jan 30 2002 - 21:15:22 CET

Original text of this message