Solved

Pro*C/C++ and PL/SQL

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

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.

Question has a verified solution.

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

Suggested Solutions

Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
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.  â€¦
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

809 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