Pro*FORTRAN

From: Marvin A. Watkins <r22950_at_email.sps.mot.com>
Date: 1997/10/06
Message-ID: <343963F2.74A6_at_email.sps.mot.com>#1/1


Hello Everyone,

I work in a rather diverse environment as far as platforms, languages, etc goes. I am the Oracle DBA and an Application Developer. Normally I work in Dev/2K or C/Pro*C.

I am currently working with a co-worker who develops in FORTRAN. Because of the system we need to extract data from, we have decided to use the Pro*FORTRAN pre-compiler to get at he data. I'm not very versed in FORTRAN and he's not very versed in Embedded SQL. I cannot find a lot in the manuals regarding Pro*FORTRAN (or we don't have the right manual) so I'm looking for some help.

We are simply attempting to INSERT a new record into a table. The record has 46 fields. Some of these fields will need to go through some lexical functions like LTRIM, RTRIM, TO_DATE, TO_NUMBER, etc...

As you can guess, this makes for a very long SQL statement. I would have not problem doing this in Pro*C, but don't have the background in FORTRAN. I was trying to use the standard approach of defining bind variable, assigning the values and issuing an

 EXEC SQL BEGIN DECLARE SECTION
   CHARACTER*20 var1
   CHARACTER*20 var2
   ...
 EXEC SQL END DECLARE SECTCION  EXEC SQL INCLUDE SQLCA
 EXEC WHENEVER SQLERROR GOTO 10000   var1 = input_rec.varA
  ...

 EXEC SQL INSERT INTO tablename

          VALUES ( :var1, :var2,
                   TO_DATE(:var3, 'DD-MON-YYYY'),
                   ... )

 EXEC COMMIT I got a lot of errors that I think were related to the INSERT command length.

Would someone let me know the best way to deal with large Embedded SQL commands within Pro*Fortran.

( BTW, this is running on Oracle 7.1.5, Pro*FORTRAN 1.1.6? and OpenVMS 6.x)

Thanks for any help!!!

Marvin... Received on Mon Oct 06 1997 - 00:00:00 CEST

Original text of this message