Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: COBOL flat file to Oracle

Re: COBOL flat file to Oracle

From: Allgas Energy Ltd <trskinner_at_allgas.com.au>
Date: Thu, 16 Apr 1998 04:47:27 GMT
Message-ID: <35358c79.23562479@news.powerup.com.au>


On Wed, 15 Apr 1998 13:42:57 -0600, Abeeda_Mohammed_at_xn.xerox.com wrote:

>Hello,
>
>I have a COBOL layout in which each field is defined as an array which occurs
>84 times.i.e Gross_qty occurs 84 times, net_qty occurs 84 times etc; I have
>to load this into an Oracle table. Is there a way to define arrays in Oracle
>tables ?

Define as oracle variables

       01 ROWS-LOADED       PIC S9(4) COMP.
       01 GROSS-QTY             PIC S9(8) COMP-3 OCCURS 84.

Execute procedure
           MOVE WS-COUNTER TO ROWS-LOADED.

           EXEC SQL WHENEVER SQLERROR GOTO XXX99-ERROR END-EXEC.
           EXEC SQL FOR :ROWS-LOADED
                INSERT INTO X_TABLE (QTY_COLUMN),
                       VALUES (:GROSS-QTY)
           END-EXEC.

This works.

Tom Skinner Received on Wed Apr 15 1998 - 23:47:27 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US