If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > Create table from select

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-15-04, 11:23
mmtw816 mmtw816 is offline
Registered User
 
Join Date: May 2003
Posts: 6
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!
Reply With Quote
  #2 (permalink)  
Old 01-15-04, 22:50
lloydnwo lloydnwo is offline
Registered User
 
Join Date: Aug 2003
Location: India
Posts: 262
Re: Create table from select

Quote:
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
Reply With Quote
  #3 (permalink)  
Old 01-16-04, 07:19
mmtw816 mmtw816 is offline
Registered User
 
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.

Quote:
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On