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: Embedded SQL vs Stored Procedures

Re: Embedded SQL vs Stored Procedures

From: Tibor Jager <tibor_at_despammed.com>
Date: 8 Sep 2004 06:43:37 GMT
Message-ID: <2q7o0pFs7ucuU1@uni-berlin.de>


Gama Franco wrote:
> I'm using OCCI to develop a new aplication, but I have one doubt about
> the most efficient way to make an operation.
> The operation makes inserts some rows in different tables, and also
> creates some new tables. I would like to know if it is faster to compute
> this kind of operations if they are hard codded in OCCI, or using a
> stored procedure that recieves all the parameters needed and takes care
> of the insertions and creations.

I'd prefer stored procs for two reasons:

1.) I like to keep database logic inside the database, application logic inside the application. Depending on your design, you might also be more flexible regarding the DBMS used.

2.) Stored procedures are often the more efficient way, because a SQL-string passed by an application needs to be compiled new every time, while a stored procedure is compiled only once. At least concerning PL/SQL procedures. I've never used CREATE TABLEs in a stored procedure...

Best Regards

Tibor Received on Wed Sep 08 2004 - 01:43:37 CDT

Original text of this message

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