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

Home -> Community -> Usenet -> c.d.o.misc -> Data type Oracle and Cobol

Data type Oracle and Cobol

From: Johan den Boer <jj.den.boer_at_hccnet.nl>
Date: Wed, 19 May 1999 19:02:24 +0200
Message-ID: <3742EEA0.C85C0E89@hccnet.nl>


Hi There,

I am a newbie to oracle. I am writing a cobol application using a oracle database
with embedded sql ( procob ). My problem is how do you declare your cobol
variables to receive data from a database table i.e.

Suppose you have this table

table employee


employeenr	number(2)
name		varchar(40)
salary		number(7,2)

How do you declare cobol variables to use these columns. I did it with

01 ws-oracle-fields

   03 ws-employeenr	pic s9(02) comp.
   03 ws-name		pic x(40).
   03 ws-salary		pic s9(07)v99 comp-3.

This gives the wrong answers from the table using these variables especially
with employneenr. Changing the type to

03 ws-employeenr pic s9(03) comp

gives the good results when reading values from the table with a cursor.

Is this a bug or feature ?
Is there a rule of thumb which you can use how to declare cobol variables
from column names ?

Thanks

jj.den.boer_at_hccnet.nl Received on Wed May 19 1999 - 12:02:24 CDT

Original text of this message

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