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 -> Re: Embedded SQL or OCI?

Re: Embedded SQL or OCI?

From: Jeffery Cann <jcann_at_fairway.com>
Date: Wed, 17 Jun 1998 15:00:13 -0600
Message-ID: <35882E5D.3570B630@fairway.com>


Christian Pomar wrote:
>
> Hello,
>
> I have been working for some time with Pro*C. It works fine, but now I am
> wondering if OCI could be a better solution to access the Oracle database.
> My question is: can somebody give a good reason for using one or the other?
> or there is no real good difference?

I also have a pro*c application. OCI provides some finer-grained control than Pro*C. For example, you have to explictly bind your variables for the SQLCA in OCI, whereas Pro*C precompiler generates this code for you.

The most annoying thing about Pro*C is the VARCHAR structure. It has the following C form:

typedef struct {

	unsigned short len; 
	unsigned char arr[1]; 

} VARCHAR; Notice that the 'arr' member is an UNSIGNED char. There is no good reason for this, especially because all the Standard C library string functions in 'string.h' take char as the datatype, not unsigned char. So, if you attempt to use compiler tools to enforce type constraints, you must cast every 'arr' member to type char. A major annoyance for me.

In addition, I have had major problems attempting to use run-time memory programs which are compiled into my source code that contains pro*c. I don't know if this is because I am on SCO Unix (which is not supported by Purify) or if it is a produce of Pro*C. But, be aware that Pro*C *may* limit your use of run-time error tools like Quantify or Purify.

Overall, I am satisfied with Pro*C. I would like the precompiler to generate C code that conforms more closely to the Standard C library.

good luck
Jeff
--
Jeffery Cann
Fairway Systems, Inc.
Senior Software Engineer Received on Wed Jun 17 1998 - 16:00:13 CDT

Original text of this message

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