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

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

Re: Pro*C vs. OCI vs. PL/SQL

From: Marc Fleischeuers <Marc.Fleischeuers_at_kub.spam-me-not.nl>
Date: 31 Mar 1999 09:32:54 +0200
Message-ID: <uzp4uyuzd.fsf@kub.nl>


Olaf Waitkus <owaitkus_at_bo-ag.net> writes:

> Hi.
> as a complete novice in Oracle i have the job to write
> a) several trigger-functions
> b) a sort of a daemon-process to insert rows into the database whenever
> a certain hardware-incident occurs.
> I read somewhere in the Oracle documentation that OCI is the approach
> with higher performance, where PL/SQL is useful for writing
> small-code-functions, as it is useful in the trigger-case.
> so, what approach is the best?

You'd need to do the triggers in pl/sql, unless you use Oracle8i in which case you could use Java to do the triggers.

As for the choice between Pro*C and OCI for the daemon-process, I do not think there will be much difference in performance. Base your choice between them on theier level of abstraction: OCI is quite low-level and you'll probably end up writing (or copying from the examples) some convenience libraries. Pro*C is a bit more involved, in that you need to run the C code (it is C that the daemon is written in?) through a preprocessor.

There is an alternative approach: you could write a pl/sql program that runs on the database and listens to a port. Your daemon process could connect to this port and insert the event text, the database program inserts whatever it receives from the port. This way you could do without the Pro*C or OCI code in your daemon (who knows, maybe next year this same daemon needs to connect to a remote ejb server?)

Marc Received on Wed Mar 31 1999 - 01:32:54 CST

Original text of this message

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