Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Using variable as schema / table names?

816741Nov 19 2010 — edited Nov 22 2010
Hello all -

First time poster :)

I would like to use PL SQL to do something like so

--***************RUN MAIN******************
DEFINE SCHEMA_NAME = 'SCHEMA_NAME' CHAR;
DEFINE FINAL_TABLE = 'FINAL_TABLE ' CHAR;
BEGIN
SELECT DISTINCT COLUMN FROM SCHEMA_NAME.FINAL_TABLE
END

However this doesn't work. I've googled and found other ways like producing a prompt but those are always in the string to search for and not the name of the schema or table to run the SQL on. I am not sure if this is even possible. Any help would be appreciated.

Thanks!

Edited by: 813738 on Nov 19, 2010 11:02 AM
This post has been answered by Solomon Yakobson on Nov 19 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 20 2010
Added on Nov 19 2010
24 comments
20,369 views