Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: PL/SQL .vs. Pro*C

Re: PL/SQL .vs. Pro*C

From: PC Automation <dullery_at_us.oracle.com>
Date: 13 Apr 1998 21:26:44 GMT
Message-ID: <01bd6722$413da570$5ab41990@dullery-lap>


I have written a lot of programs in Pro*C and in PL/SQL. Pro*C is generally better to use if you are doing a lot of file I/O, because PL/SQL is not very good at reading and writing to files. The DBMS_OUTPUT package not very good and is not available in the earlier versions of PL/SQL. Some documentation suggests that DBMS_OUTPUT.put only be used for debugging purposes.

A lot of times, I have called existing PL/SQL stored procedures from Pro*C. The stored procedures are often shared by Pro*C, Forms, other PL/SQL programs. I used to write Pro*C user exits for Forms 3.0.

Pro*C is compiled and runs on the host machine. PL/SQL is "generated" and interpreted by the Oracle RDBMS. PL/SQL is slower than Java and Java is 5-15 times slower than C. C allows dynamic memory allocation. Pro*C is very good for writing dynamic SQL. PL/SQL has many more limitations than Pro*C.

Many programmers are not used to writing in PL/SQL and others do not want to write in a proprietary language. Pro*C follows ANSI standards. PL/SQL is used only by Oracle and will slowly be replaced with Java after 8.1 (but; like COBOL, it will never go away completely). Pro*C modules can be called directly from a shell script, PL/SQL has to be called from a SQL script, a Form or some other indirect means. It is easier to write error log files in C than in PL/SQL. C has easy access to system calls. There are many times more C (and ANSI SQL programmers) than PL/SQL programmers.

BUT: If you are familiar with PL/SQL, and a large part of the code is INSERT, UPDATE, DELETE, and/or SELECT (DML), then the best choice is PL/SQL. PL/SQL is becoming more and more sophisticated as each version is released and it is therefore less necessary to write programs in Pro*C.

Hope this helps,

David S. Ullery
Principal Consultant
Oracle Consulting Services
VMAIL: 800.862.4563, ext: 1514
EMAIL: dullery_at_us.oracle.com

MatthewLF_at_pobox.com wrote in article <6gtbh5$1jk$1_at_nnrp1.dejanews.com>...
> Am wondering if anyone out there has had experience using both PL/SQL and
> Pro*C. Specifically, I'd like someone to explain to me why I would use
Pro*C
> to do something which could be done in PL/SQL. I have just been on a
project
> which used Pro*C with embedded SQL to do all Oracle operations. I did
not
> write any of the code myself, but I have written scads of PL/SQL. I
found
> myself looking at pages of Pro*C and thinking to myself that I could do
it
> much easier in PL/SQL since it was 95% data manipulation. The only
argument I
> have heard so far is that Pro*C is faster than stored
procedures/packages. If
> this is the only argument I'd like some feedback on just how much faster
it is
> (all of our routines on this project are too small to do any benchmarking
> with). It seems to me that unless it is several times faster, the
benefit of
> execution time does not outway the nightmare of maintenance time.
>
> Thanks for any input.
>
> Matt.
> MatthewLF_at_pobox.com
>
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/ Now offering spam-free web-based newsreading
>
Received on Mon Apr 13 1998 - 16:26:44 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US