Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Can i use Select * from variable_name;

Re: Can i use Select * from variable_name;

From: sybrandb <sybrandb_at_gmail.com>
Date: Mon, 20 Aug 2007 01:34:01 -0700
Message-ID: <1187598841.678806.132900@g4g2000hsf.googlegroups.com>


On Aug 20, 4:41 am, cheema <mache..._at_cse.unsw.edu.au> wrote:
> Hi,
>
> I wonder can I select from some table such that table name is stored
> in a variable.i.e;
>
> DECLARE
> tablename varchar(5);
> BEGIN
> tablename:='table';
> select * from tablename;
> END;
> /
>
> Thanks,
> Cheema

Look up execute immediate. Please not your attempt to turn Oracle into sqlserver will make your application unscalable.

--
Sybrand Bakker
Senior Oracle DBA
Received on Mon Aug 20 2007 - 03:34:01 CDT

Original text of this message

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