 |
OCI Not Pro*C.
I like this little tip, I think it's what they call an 'undocumented feature'. At least
I've never seen it documented anywhere, if anyone knows different, please let me know
and I'll stop trying to be such a smart arse.
Anyway. The tip. If you don't like Pro*C (yuk) and consequently are having problems writing
user-exits for Forms 4.5 then don't fear, here's an alternative. Write a Windows DLL in C
and then create a wrapper to call it using the Ora_Ffi package provided with forms. Then,
and this is the cunning bit, in your C code you can use the 'sqllda' function (look it up)
to obtain the connection information as you would if you were mixing Pro*C and OCI code in
the same source. Your OCI DLL is then connected to the database exactly as your form was
and exactly as it would have been if you'd issued a 'orlon' call, except it's not created
a new session. Bravo.
Have a look at the code for the context-sensitive bubble-help for HR (when I upload it), it contains examples of
this in action. So to speak.
Unfortunately you can't access Forms information (i.e. the contents of fields) like you can
with Pro*C. I'm working on that one. But your wrapper could either send over the information
you need when it calls the DLL, or it could write it to a database table, or to a server-side
package global, the DLL will connect using the same session so it'll be able to see the
uncommitted information OK.
|
  |