Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: SELECT-statement
"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
![]() |
![]() |