Re: Pro*C Help Wanted!

From: Tim Smith <tssmith_at_netcom.com>
Date: Fri, 18 Jun 1993 12:25:17 GMT
Message-ID: <tssmithC8tH66.K5t_at_netcom.com>


In article <740385705snz_at_hoxton.demon.co.uk> paul_at_hoxton.demo.co.uk writes:
>In article <bui.739637271_at_honte> bui_at_panda.uleth.ca writes:
>
>>
>>Hi everyone:
>>
>>After precompiling a Pro*C program (PROG.PC), a C program (PROG.C) is created.
>>In this C program, I see several symbols (subroutines) SQLAD2,SQLBS2,SQLCOM,
>>SQLEXE,SQLFCH,SQLLO2,SQLOPN,SQLOSQ,SQLSCA,SQLSCC,SQLTLF which I do not their
>>exact meanings and functions.
>>
>>Could anyone tell me where I can find the information on these symbols. May
>>I call these subroutines directly in my C program? If yes, to which library
>>should I "link", without "lnproc"?
>>
>>Thank you very much.
 

>Oracle do not provide information on these routines, as far as I know. Of
>course you could call them directly. But you might find it easier to use
>OCI (the Oracle Call Interface). Documented by Oracle complete with
>examples. But you have to worry about memory alocation etc.

Oracle does not provide information on these routines because they are non-externalized SQLLIB routines. There's no advantage to using them directly; one of the reasons for a precompiler is to do the dirty work for you. There would be no performance advantage if you tried to use these routines yourself; in fact, you'd just make things more difficult for yourself.

Oracle support won't help you, either. Don't feel bad about this. To repeat; there's no particular reason to be using these calls. For example, most of the calls you cite seem to be V1.3 SQLLIB calls. With V1.4 and later, the code generated by the precompilers changed (it's more efficient)), so if you did try to use these calls directly your program would not be portable, whereas a straight precompiler program will port easily from 1.3 to 1.4 or later.

There are a few SQLLIB calls that we externalize, such as SQLALD, SQLGLM, and so on, and these are always documented in the appropriate precompiler supplement (Pro*C, Pro*COBOL, etc.).

As the poster from the UK said, you could use the OCIs. This API is well-documented (I think--or else it's my fault), and is guaranteed to stay compatible from release to release. Some Oracle tools are written using what we call the UPI, which is slightly more efficient than the OCI (you save one level of function calls), but is definitely *not* guaranteed to be portable, and is not externally documented.

My advice would be to stick with the precompiler for most tasks, and to use the OCIs where you need to do very complicated things (such as "dynamic" SQL queries, or building tools).

Hope this helps.

--Tim (tssmith_at_oracle.com) or (tssmith_at_netcom.com) Received on Fri Jun 18 1993 - 14:25:17 CEST

Original text of this message