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: pass connection to external procedure

Re: pass connection to external procedure

From: Joel R. Kallman <jkallman_at_us.oracle.com>
Date: Thu, 24 Sep 1998 00:48:03 GMT
Message-ID: <3609958e.2874984@newshost.us.oracle.com>


On Thu, 24 Sep 1998 00:21:04 GMT, JohnRonan_at_worldnet.att.net wrote:

>I am writing a stored proc that calls out to an external procedure (Windows NT
>DLL). That DLL needs to do some database stuff, too, via ODBC (in C++).
>However, I do not want to establish another connection for each call into the
>DLL.
>
>Is there a way to communicate (pass) the database connection down to the DLL,
>so it can use it via ODBC? It seems to me that I must re-initialize the ODBC
>connection each time.
>

Check in the PL/SQL User's Guide and Reference, especially in Chapter 10 where external procedures are discussed. From the book:

"An external procedure executing on the Oracle server can call a service routine to obtain OCI environment and service handles. With the OCI, you can use callbacks to execute SQL statements and PL/SQL subprograms, fetch data, and manipulate LOBs. Moreover, callbacks and external procedures operate in the same user session and transaction context. So, they have the same user privileges."

So....this does and doesn't solve your problem. I doubt you get anything back that you can *directly* use in ODBC (as ODBC connection handles are a different beast than OCI connection handles). But you could make the call to OCIExtProcGetEnv to get a number of the handles necessary to perform callback operations to the database....which, of course, you would have to do using OCI and not ODBC.

Hope this helps.

>Am I missing something obvious?
>thanks.
>
>-----== Posted via Deja News, The Leader in Internet Discussion ==-----
>http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum

Thanks!

Joel

Joel R. Kallman Oracle Government, Education, & Health

Columbus, OH                             http://govt.us.oracle.com

jkallman@us.oracle.com                   http://www.oracle.com




The statements and opinions expressed here are my own and do not necessarily represent those of Oracle Corporation. Received on Wed Sep 23 1998 - 19:48:03 CDT

Original text of this message

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