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: Oracle, PL/SQL to Visual C++ ?

Re: Oracle, PL/SQL to Visual C++ ?

From: Rick Brown <rick_at_onramp.net>
Date: 1997/05/30
Message-ID: <rick.68.00193F3F@onramp.net>#1/1

In article <0YN5yCAYqojzEwro_at_ahardy.demon.co.uk> Andy Hardy <aph_at_ahardy.demon.co.uk> writes:
>From: Andy Hardy <aph_at_ahardy.demon.co.uk>
>Subject: Oracle, PL/SQL to Visual C++ ?
>Date: Fri, 30 May 1997 09:06:48 +0100
 

>Hi,
 

>Is it possible to get Visual C++ to talk to Oracle PL/SQL procedures?
 

>I know that VC++ can use ODBC to access Oracle as a standard datasource
>(if I ever get ODBC to work on our NT systems...) but is there a way of
>accessing the stored procedures?
 

>Also, is there a tool out there which will allow VC++ to use SQL*NET
>connections? Some form of pro*C compiler for VC++, perhaps?
 

>In essence, I don't want to lose the power of the Oracle environment
>just because we want to use VC++ for some pretty front ends.
 

>Thoughts?

  1. You can use stored procedures with ODBC. Depending on the driver you use, this will range from easy to incredibly frustrating. Oracle's newest 32-bit driver has some bugs you may have to work around. Other drivers, like OpenLink's, work great but cost money. There is no standard syntax under ODBC for invoking stored procedures, so your application will end up being at least a tiny bit Oracle-specific.

For example, a SQL Server stored procedure can be executed with a command like:

SQLExecDirect (hStmt, "sp_some_procedure", ...);

while Oracle requires:

SQLExecDirect (hStmt, "{CALL sp_some_procedure }", ...);

2. You could use direct OCI (Oracle Call Interface) calls, or use one of the available wrappers for OCI. This is generally considered the highest-performance option, but the naked OCI API is dreadful to work with, even compared to bare-metal ODBC programming. Writing your own wrapper for it isn't too bad, however.

3. You could use the MFC version of Oracle Objects for OLE, which is one of the aforementioned OCI wrappers, and is available free from Oracle's web site.

4. I don't know why you _couldn't_ use a Win16/Win32 version of Pro*C, but I don't use Pro*C so I'll defer to others more knowledgeable on that.

Rick Brown
rick_at_onramp.net Received on Fri May 30 1997 - 00:00:00 CDT

Original text of this message

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