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: table name

Re: table name

From: Mark C. Stock <mcstockX_at_Xenquery>
Date: Wed, 2 Aug 2006 15:03:59 -0400
Message-ID: <j8udnUNZIc2_ak3ZnZ2dnUVZ_vGdnZ2d@comcast.com>

<mike7411_at_gmail.com> wrote in message
news:1154544909.979272.310900_at_b28g2000cwb.googlegroups.com...
: Well, if you run this
:
: create or replace procedure seltest (tablename in varchar2)
: as
: begin
: select * from tablename;
: commit;
: end;
:
: you will see that it does not use the parameter. Any ideas?
:

you have a scoping issue

a pl/sql variable can be used as a 'bind variable' in an imbedded sql statement

bind variables, however, cannot occur in the from clause -- to the tablename in your code is not interpretted as the parameter 'tablename' but is an actual table named 'tablename'

you will need to user dynamic sql to specify the tablename dynamically

++ mcs Received on Wed Aug 02 2006 - 14:03:59 CDT

Original text of this message

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