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!

Passing variable to create table command

KersApr 8 2004 — edited Apr 8 2004
Is it possible to pass a varaiable to the create table command.

At each yearend we have to manually create copy tables of the years data these are held as table_name_2002 etc. The original table only holds the current years data. We would like to create a script to create all these, along the lines of

CREATE TABLE table_name_||'&year'
AS
SELECT * FROM table_name;

As his is run every year we would like to be able to run the same script, and just pass in the year each time.
however i cannot get this to work, is there another way round this?

Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 6 2004
Added on Apr 8 2004
7 comments
596 views