Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Can i use Select * from variable_name;
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 DBAReceived on Mon Aug 20 2007 - 03:34:01 CDT
![]() |
![]() |