Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: How to pass a handle obtained from an OCI program to a Pro*C program ?

Re: How to pass a handle obtained from an OCI program to a Pro*C program ?

From: Kenneth C Stahl <BlueSax_at_Unforgettable.com>
Date: Tue, 12 Oct 1999 07:56:21 -0400
Message-ID: <380321E5.D3BF52A@Unforgettable.com>


Ivan Krivobarski wrote:
>
> Hi there,
> Can anybody help me - How can I pass a handle obtained from an OCI program
> to Pro*C program ?
> In other words - how to get the Pro*C context for the session from an OCI
> connection handle.

I think it would be better if you were to think of it the other way around - using OCI calls in a Pro-C program.

Here are the steps:

To embed OCI calls in your Pro*C/C++ program, take the following steps:

  1. Declare an OCI Logon Data Area (LDA) in your Pro*C/C++ program (outside the Declare Section if you precompile with MODE=ANSI). The LDA is a structure defined in the OCI header file ocidfn.h. For details, see the Programmer's Guide to the Oracle Call Interface.
  2. Connect to Oracle using the embedded SQL statement CONNECT, not the OCI orlon() or onblon() calls.
  3. Call the Oracle runtime library function sqllda() to set up the LDA. That way, the Pro*C Precompiler and the OCI "know" that they are working together. However, there is no sharing of Oracle cursors.
Received on Tue Oct 12 1999 - 06:56:21 CDT

Original text of this message

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