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: SELECT-statement

Re: SELECT-statement

From: Roxl <Roxl_at_ozemail.com.au>
Date: Sat, 10 Mar 2001 13:51:12 -0800
Message-ID: <1Fgq6.609$zW2.28238@ozemail.com.au>

"André Klos" <andre.klos_at_pikon.com> wrote in message news:98b04l$dvh$1_at_piesbach.saarnet.de...
> Hi!
>
> How can I assign a table dynamically to a SELECT-statement? Is this
> possible?
>
> Thanks
>
> A.Klos
>
>
>

"André Klos" <andre.klos_at_pikon.com> wrote in message news:<98b04l$dvh$1_at_piesbach.saarnet.de>...

> Hi!
 

>
 

> How can I assign a table dynamically to a SELECT-statement? Is this
 

> possible?
 

>
 

> Thanks
 

>
 

> A.Klos
 

>
 

>
 

>

Assuming that your requirements are simple, you may be able to get by with just using a substitution variable (ie use &tablename_here) within SQL*Plus.

Another common trick is to use a SQL Plus to generate a SQL script (ie as a text string) which is spooled out then run. This is handy for slightly more complex cases eg analyze specific tables, or drop all tables in a schema.

Finally, you can can also use PL/SQL to generate dynamic SQL - as has already been suggested.

Cheers,

Richard Gowan Received on Sat Mar 10 2001 - 15:51:12 CST

Original text of this message

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