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: Efficiency question with PL/SQL code.

Re: Efficiency question with PL/SQL code.

From: Keith Jamieson <jamiesonk_at_phoenix.ie>
Date: Fri, 31 Mar 2000 09:19:27 +0100
Message-ID: <8c1n6o$vgv$1@kermit.esat.net>


You can not do this with a stand alone procedure, it must be part of a package.

You need to create a package with overloaded procedures/Functions, ie The same procedure name declared with the different parameters that you specify. The code in each of the procedures will be slightly different, to return your desired results. Also, I believe you will find it easier if you use named parameters.

If you wnat to return a value using a procedure you must use an out parameter. Procedures do not return values when a return is issued.

If your procedure wants to modify database code is probably easier to use a procedure, otherwise if you only want to retrieve and manipulate information use a function.

>Here is the scenario I can not figure out which is best. I want to
>create a PL/SQL stored procedure/pkg for performance gains. I have a
>table named foobar with columns A B C and D (for lack of a better
>example):
>
>foobar
>------------
>A
>B
>C
>D
>
>I want to be able to execute the procedure passing in parameters
>telling the procedure WHICH columns to return like if I wanted just two
>columns (say A and C) vs three columns (A C and D).
>
>I could create a SQL statement and use the Dynamic SQL package, but is
>there a better way to do this. In C++, you can pass parameters in
>(like &H000 & H0001) and find out what the user was specifying.
>
>Is there a slick way to do this?
>Thanks for you help,
>Sean
>
>
>Sent via Deja.com http://www.deja.com/
>Before you buy.
Received on Fri Mar 31 2000 - 02:19:27 CST

Original text of this message

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