Solved

Pro*C/C++ and PL/SQL

Posted on 2001-07-16
5
1,530 Views
Last Modified: 2007-12-19
After going through oracle documentation, I'm a bit confused.
What is the difference between OCI and SQLLIB. Does SQLLIB uses OCI internally? What are the advatages of Pro*C/C++ over PL/SQL? What exactly is UPI
0
Comment
Question by:prashant_n_mhatre
5 Comments
 
LVL 35

Expert Comment

by:Mark Geerlings
ID: 6287623
My understanding is that the main benefits of OCI and Pro*C are for programmers who are already familiar with C or C++, have a C or C++ compiler and want to take advantage of procedures already written in one of those languages.  There may also be some performance advantages to procedures written in C or C++, compared to the same functionality written in a PL\SQL procedure.  C and C++ also have the ability to do some operating system tasks that are difficult or impossible to do directly in PL\SQL.

PL\SQL has the advantage of being relatively easy to use for someone who knows SQL, but doesn't know C or C++ and/or doesn't have a C compiler.
0
 
LVL 5

Expert Comment

by:ser6398
ID: 6287653
What follows are my own personal opinions:

Anytime you want to do serious mathematical computations, pointer operations, massive file operations, specific operating system functionality, or complex datatype manipulation then C++ (or Java) will normally be a better choice than PL/SQL.  This is because C++ and Java have much more power and functionality in these areas than PL/SQL.

If you want to do massive database interaction with little computations or file operations, then PL/SQL will normally be a better choice than C++ or Java, because PL/SQL is built for databases and works very well with databases.
0
 
LVL 4

Author Comment

by:prashant_n_mhatre
ID: 6287738
What about

What is the difference between OCI and SQLLIB. Does SQLLIB uses OCI internally?

0
 
LVL 6

Accepted Solution

by:
jpk041897 earned 70 total points
ID: 6288053
OCI uses embeded SQL code in your C/C++ code via the use of a precompiler that translates SQL*C to Oracle API calls.

SQLLIB is a library, with a class header option for C++ that makes calling Oracle easier.

Both libraries make the same API calls. The only real diffrence is that OCI is better suited for static SQL calls while SQLLIB is better suited for dynamic calls.

I.E.: if your SQL statements will always be exactly the same, then its esier to code with OCI, if you are going to build the SQL calls dynamicaly (via user input for instance), then its easier to code via SQLLIB.

Aa far as performance goes, OCI is slightly faster since the SQL code is pre compiled by the preprocesor whenever possible, whil SQLLIB must rely on prepared statements to obtain the same performance.
0
 
LVL 4

Author Comment

by:prashant_n_mhatre
ID: 6289786
thanks all...
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

948 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now