Re: Pro*C 1.5 -> 2.0

From: Bernard Drolet <Bernard.Drolet_at_dmr.ca>
Date: 1995/08/12
Message-ID: <40h806$3gq_at_guillotine.mtl.dmr.ca>#1/1


I worked on migrating couple of modules from Oracle 1.6 (not 1.5) to 2.0.

The biggest difference was that often programmers used a query just to check if data exists for a specific condition

ex:

    SELECT 1 FROM TABLE WHERE CONDITION;     if ( sqlca.sqlcode = SQL_NO_DATA_FOUND ) then...

ok, maybe it's not the correct syntax, but it's about midnight, Friday evening, I forgot my code at work...

2.0 doesn't seem to accept a query where it haves no variable host as destination.

We solve it by declaring dummy host variables and adding it to the query

    SELECT 1 INTO dummy FROM...

That variable was not use anywhere else.

An other big difference is the way Pro*C handles strings. With the older version, if you have a column of, for exemple, 10 characters, you can define an char array to receive it of 10 char long, the problem is that you just have no null char ('\0') at the end. With the new version, Oracle saves just 9 char and put a null char after it. Maybe it is a bit better C code, but all the old modules we have were constructed with the other way: 10 char column in a 10 char array with no null.

To avoid problem, we had to add the following parameter in the make file: DBMS=V6_CHAR. It forces the precompiler to work as before with the strings.

We also add a problem with the precompiler 2.0 that crashed without any reason on some modules, we contact Oracle hot line about it, they told us that they do not know why and transmit it to people at the engineering dept. 2 Weeks later they told us that it is now corrected in version 2.0. something...

All that to say that 2.0 is not yet bullet proof...

Bernard Drolet (Bernard.Drolet_at_dmr.ca)

Consultant
Group DMR,
Montreal Canada

Presently working at Teleglobe Canada Received on Sat Aug 12 1995 - 00:00:00 CEST

Original text of this message