View previous topic :: View next topic
|
Author |
Message |
Bhagyalakshmi C
New User
Joined: 24 Jul 2007 Posts: 38 Location: Bangalore
|
|
|
|
Hi,
I want to create a duplicated table.
I am having a table "TABLE1" and i need to create another table "TABLE2" with all the records in the "TABLE1".
I think this can be done using Load and unload utilities.
Please let me know if there is any other method.
Thanks all!!! |
|
Back to top |
|
|
Prajesh_v_p
Active User
Joined: 24 May 2006 Posts: 133 Location: India
|
|
|
|
If you have QMF and then the number of records are only a few..
you could use select * from TABLE1 in qmf panel and you can issue the command 'save data as TABLE2' (Note that table2 will be created under your id only).
Thanks,
Prajesh |
|
Back to top |
|
|
Bhagyalakshmi C
New User
Joined: 24 Jul 2007 Posts: 38 Location: Bangalore
|
|
|
|
you can issue the command 'save data as TABLE2'
Where i have give this??
Thanks!!!! |
|
Back to top |
|
|
Prajesh_v_p
Active User
Joined: 24 May 2006 Posts: 133 Location: India
|
|
|
|
Give it in QMF command line... |
|
Back to top |
|
|
Bhagyalakshmi C
New User
Joined: 24 Jul 2007 Posts: 38 Location: Bangalore
|
|
|
|
should it be like this
Code: |
select * from table1 save data as table2
|
this is not working getting error!!! |
|
Back to top |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
As an answer to interview question-
Code: |
1. CREATE TABLE2 LIKE TABLE1
2. INSERT INTO TABLE2 (SELECT * FROM TABLE1) |
|
|
Back to top |
|
|
Prajesh_v_p
Active User
Joined: 24 May 2006 Posts: 133 Location: India
|
|
|
|
select * from table1
in the query panel..then execute the query...after that issue command "save data as table2" in QMF command line..
Thanks,
Prajesh |
|
Back to top |
|
|
Bhagyalakshmi C
New User
Joined: 24 Jul 2007 Posts: 38 Location: Bangalore
|
|
|
|
Thanks Prajesh..
I got it!!
Thank you!! |
|
Back to top |
|
|
Bhagyalakshmi C
New User
Joined: 24 Jul 2007 Posts: 38 Location: Bangalore
|
|
|
|
Thanks Abhijit!!!!
Quote: |
As an answer to interview question-
Code:
1. CREATE TABLE2 LIKE TABLE1
2. INSERT INTO TABLE2 (SELECT * FROM TABLE1)
|
This is not working!!
can you please explain me!!!
Thank you!!! |
|
Back to top |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
!!!
Explain you what?
Only 'This is not working!! ' does not tell me anything about problem you got in your query. Please explain your problem.. |
|
Back to top |
|
|
karnataka
New User
Joined: 15 Sep 2006 Posts: 20 Location: bangalore
|
|
|
|
Hi,
r u trying to execute both queries at a time in QMF? |
|
Back to top |
|
|
karnataka
New User
Joined: 15 Sep 2006 Posts: 20 Location: bangalore
|
|
|
|
Hi,
r u trying to execute both queries at a time in QMF? |
|
Back to top |
|
|
Bhagyalakshmi C
New User
Joined: 24 Jul 2007 Posts: 38 Location: Bangalore
|
|
|
|
Hi,
No.. not at the same time..one after the other only..
It should be..
CREATE TABLE TABLE2 LIKE TABLE1
the "TABLE" key word is missing.. so did not get..
any way the second query i am not getting..
Thank you!!! |
|
Back to top |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
Quote: |
any way the second query i am not getting |
You haven't understood or
dies it mean you are not getting any error? |
|
Back to top |
|
|
|