Re: Using VARCHAR2 with Pro*COBOL

From: Michael Ho <infoage_at_hk.super.net>
Date: 1996/10/25
Message-ID: <327150C2.1C51_at_hk.super.net>#1/1


Brian M. Biggs wrote:

> What is the best (or at least better) approach for using VARCHAR2
> columns in Pro*COBOL programs? We currently have a database with many
> tables in CHAR format. In doing some preliminary testing with
> converting those tables to VARCHAR2, we have found that there is about a
> 25% performance hit with using VARCHAR2 columns. This hit was seen in a
> read-only program.

Not very difficult using Pro*COBOL :

01 ABC.
   05 ABC-LEN S9(4) COMP
   05 ABC-TEXT X(40) EXEC SQL
  SELECT <varchar2> into :ABC....
...
...

Simple isn't it.

However, the bad new is for NULL
If the value is nullable (every column), to check null you need :

01 ABC-IND S9(4) COMP.
01 ABC.
   05 ABC-LEN S9(4) COMP
   05 ABC-TEXT X(40) EXEC SQL
  SELECT <varchar2> into :ABC:ABC-IND .... ...
...

IF ABC-IND = -1 THEN.....
...
...

And also, many bugs involved in this part.

Personally, I think Pro*COBOL is not a good product. But, it still have its use.

Enjoy,
Michael Received on Fri Oct 25 1996 - 00:00:00 CEST

Original text of this message