Results 1 to 3 of 3
  1. #1
    Join Date
    May 2003
    Posts
    6

    Unanswered: Create table from select

    Hello all,

    I have to create a table that is an exact copy of another table in my database. I can not use a temporary table. They told me it would not be possible but I would like to have a second opinion.

    Is there anyone who knows how to do this task (if possible)?

    Thanks a lot!

  2. #2
    Join Date
    Aug 2003
    Location
    India
    Posts
    262

    Re: Create table from select

    Originally posted by mmtw816
    Hello all,

    I have to create a table that is an exact copy of another table in my database. I can not use a temporary table. They told me it would not be possible but I would like to have a second opinion.

    Is there anyone who knows how to do this task (if possible)?

    Thanks a lot!
    Hi there,

    I am not too sure whether you can create it for permanent tables. There is one more workaround. Generate a schema for the table and modify the script and create a new table.
    Eg :

    dbschema -d stores -t customer >cust

    Will generate a file cust with the structure of table customer.
    You can modify that file to change the tablename and run the file.

    Regards,

    lloyd

  3. #3
    Join Date
    May 2003
    Posts
    6

    Re: Create table from select

    Thanks for your answer lloyd.

    Unfortunately I have to use it in a stored procedure, so I guess it's not possible after all unless there's another work-around?

    mmtw816.

    Originally posted by lloydnwo
    Hi there,

    I am not too sure whether you can create it for permanent tables. There is one more workaround. Generate a schema for the table and modify the script and create a new table.
    Eg :

    dbschema -d stores -t customer >cust

    Will generate a file cust with the structure of table customer.
    You can modify that file to change the tablename and run the file.

    Regards,

    lloyd

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •