Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Pro*C/C++ and PL/SQL

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
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.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

856 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