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: Passing tablename as parameter

Re: Passing tablename as parameter

From: Connor McDonald <connor_mcdonald_at_yahoo.com>
Date: Thu, 21 Oct 1999 19:22:55 +0800
Message-ID: <380EF78F.59E3@yahoo.com>


Chris Jordan wrote:
>
> Hi,
>
> In my when-new-block trigger, I pass to a procedure the name of my table as
> a varchar2. In the procedure
> , I want the procedure to use the string as the table name, but it is not
> letting me do that saying that my
> passed string is not a tablename (it isn't, its the variable that CONTAINS
> the tablename). Here's what I am doing
> In the triger:
> DECLARE
> strvendor varchar2;
> begin
> FindVendorName(strvendor);
> END;
>
> In the procedure FindVendorName (strvendor varchar2) return varchar2 IS
> begin
> select vendorname into :current.company from strvendor; --it is saying
> strvendor is not tablename
> return :current.company;
> end;
>
> How can I pass the name of a table, column etc. as parameters that in the
> called procedure are evaluated
> first for their value and then processed in the SQL statement?
>
> Thanks.

Check the oracle application developers guide on the section on using DBMS_SQL or "dynamic" sql.

HTH
--



Connor McDonald
"These views mine, no-one elses etc etc" connor_mcdonald_at_yahoo.com

"Some days you're the pigeon, and some days you're the statue." Received on Thu Oct 21 1999 - 06:22:55 CDT

Original text of this message

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