Solved

Pro*C/C++ and PL/SQL

Posted on 2001-07-16
5
1,518 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 34

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.
This video shows how to recover a database from a user managed backup

762 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

22 Experts available now in Live!

Get 1:1 Help Now