View previous topic :: View next topic
|
Author |
Message |
theone1987
New User
Joined: 14 Sep 2009 Posts: 60 Location: Milan
|
|
|
|
maybe I'm about to say something stupid ... but ...
is a way to physically move the rows from one table to another? (the tables have the same fields, declared the same way, are practically identical)
thanks ... |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
Back to top |
|
|
sushanth bobby
Senior Member
Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
theone,
there are lot of ways(your imagination limits it).
1.
Code: |
insert into table2
select * from table1;
delete from table1; |
2.
UNLOAD from table1
LOAD table2 (REPLACE or RESUME) based on your need
dummy load on table1
3. My favourite, not tested yet.
Code: |
RENAME TABLE table1 to table10
RENAME TABLE table2 to table1
RENAME TABLE table10 to table2 |
there are no stupid questions,
Sushanth |
|
Back to top |
|
|
theone1987
New User
Joined: 14 Sep 2009 Posts: 60 Location: Milan
|
|
|
|
But i dont want to delete all table 1...
for example
table 1
a
b
c
table 2
empty
after the command the situation will be:
table 1
a
table 2
b
c
(is a way to not do the delete in table 1? because it contains a lot of rows ...) |
|
Back to top |
|
|
sushanth bobby
Senior Member
Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
theone,
Use
Code: |
insert into table2
select * from table1 where YOURCONDITIONS;
delete from table1 where YOURCONDITIONS; |
Sushanth |
|
Back to top |
|
|
theone1987
New User
Joined: 14 Sep 2009 Posts: 60 Location: Milan
|
|
|
|
do you know anything about EXCHANGE DATA? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
Back to top |
|
|
manikawnth
New User
Joined: 07 Feb 2007 Posts: 61 Location: Mumbai
|
|
|
|
If you want to physically move the data,
Take each row from the source table.
Carefully pack it and courier it to the target table.
If possible call/ping it once to make sure that the parcel is received.
Just kidding,
May be you are not asking what you are expecting.
Kindly post your requirement/problem instead of asking the possibility of a function in it.
If the question is much clear
the answer will be much near. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
Kindly post your requirement/problem instead of asking the possibility of a function in it. |
Please read the entire topic. . .
The requirement seems to be quite clear. . .
And the way to accomplish it is clear also. . . Just not work-free enough? |
|
Back to top |
|
|
manikawnth
New User
Joined: 07 Feb 2007 Posts: 61 Location: Mumbai
|
|
|
|
Hi Dick,
My idea is that,
Physically move something implies to database organization, where the two databases have the identical stogroup.
I quoted the statement in that sense. |
|
Back to top |
|
|
|