Re: Oracle6->Oracle7 Conversion

From: Ellen Boughter <boughter_at_redbud.asc.slb.com>
Date: 22 Mar 1993 16:54:09 GMT
Message-ID: <1okqvhINN7ub_at_leo.asc.slb.com>


I recently upgraded from Oracle V6 to Oracle V7, and it was relatively painless. I used both the VAX/VMS and Sun/Unix versions.(Sun is not yet commercial.) I was pleasantly surprised that V6 applications (PRO*C) would work with no changes under V7. In fact, one can use the V6 preprocessors and then run against the V7 engine. Nice work, Oracle folks! Some of the documentation is confusing when describing V7 changes--and there are a number of errors. One error is in the use of VARCHAR2 (pretty strange name, guys) and the old VARCHAR. Turns out that you really *must* use VARCHAR2 in V7 applications--VARCHAR just doesn't work any more. There are also some misleading statements regarding datatypes in the PRO*C and precompiler manuals. The whole concept of "external" vs. "internal" is bizarre. One (at least, *I*)would assume that an "external" datatype, such as VARCHAR2, could be used in a Cprogram. Not so. Just a warning--try to deduce what is meant before coding!

We did find a couple of bugs early on, but they were fixed in later releases. One problem that still exists is that ORACLE sometimes adds precision to floats. This only happened on Sun--not on VAX/VMS. We believe that this is due to Oracle's storing of all floats as doubles, internally. We had to use sprintf to convert our doubles to character prior to storing in the database to eliminate the random extra bits that were added. So beware--this can be a hard one to spot.

Not all of the Oracle functions are declared as prototypes in their header so you will get some compiler warnings. I assume that this has been/will be in the commercial versions. Another problem that may still exist involves the use of the ANSI flag paired with SQLCHECK=FULL on the preprocessor command line. With the ANSI flag set (which you need if you want null-terminated strings), SQLCHECK=FULL had no effect. We started running the V6 preprocessor in order to find SQL errors, then using the V7 preprocessor to compile and link. This one bit a lot of folks here--it's not fun to think that one's program is clean, then discover tons of invalid column names, mistyped table names, etc., at run-time!

Ellen Boughter
boughter_at_asc.slb.com Received on Mon Mar 22 1993 - 17:54:09 CET

Original text of this message