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: PL\SQL Question.

Re: PL\SQL Question.

From: <ineyman_at_perceptron.com>
Date: Wed, 20 Jan 1999 14:49:57 GMT
Message-ID: <784qeg$9f6$1@nnrp1.dejanews.com>


In article <784ca3$tsq$1_at_nnrp1.dejanews.com>,   tim.mcconechy_at_runtime.dk wrote:
> This hould be easy. i just don't know how to do it.
> In a stored procedure I want to use the table as a parameter.
> How do I do it?
>
> Example.
> CREATE OR REPLACE PROCEDURE GETNEXTRECNO
>
> (
> field IN varchar2,
> table_name IN varchar2,
> nextrecno OUT integer
> )
>
> AS
> BEGIN
> /*gets next recno on a table*/
> select max(field) into nextrecno from table_name ;
>
> END;
>
> Above errors out on tablename and says. I need to select a table to which the
> user has access when I compile.
>
> How can I use table as a paraeter like this.
>
> Thanks
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
>

Use dynamic SQL (supported by Oracle's standard package DBMS_SQL).

Igor

-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Wed Jan 20 1999 - 08:49:57 CST

Original text of this message

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