View previous topic :: View next topic
|
Author |
Message |
komal
New User
Joined: 09 May 2005 Posts: 17
|
|
|
|
Hello
I need one immediate help from any of u guys.
I'm using db2 on mainframe.
I need to copy some records between 2 tables among which 1st table having 20 fields and the second having 25.
and in both tables name and some other fields are common. Name field which was declared as character(70) in the first table having data like a, b, c,..abc1,abc2,abc3..abc15,x,y,z.
I want to copy records from 1st table to 2nd table with the condition that only records having name between abc1 to abc15 has to be copied.
can i use file-aid or file-aid for db2 tools or is it possible thru some sql query? if its possible thru sql query, plz send me the query. plz help me asap.
Kiran |
|
Back to top |
|
|
DavidatK
Active Member
Joined: 22 Nov 2005 Posts: 700 Location: Troy, Michigan USA
|
|
|
|
Code: |
INSERT
INTO DB2.TABLE2
(COL1,
COL2,
COL3,
:
COL20,
COL21,
:
COL25
)
SELECT
(COL1,
COL2,
COL3,
:
COL20,
value21,
:
value23
)
FROM DB2.TABLE1
WHERE NAME BETWEEN ?abc1? and ?abc15?
;
|
Dave |
|
Back to top |
|
|
komal
New User
Joined: 09 May 2005 Posts: 17
|
|
|
|
hi david thanks for ur reply.
Is there any possiblity to do the same from fileaid for db2? |
|
Back to top |
|
|
Knowledge Hunter
New User
Joined: 17 Aug 2006 Posts: 22 Location: India
|
|
|
|
hi komal,
I guess you can achieve this using fileaid for db2 also. Try using
3 - utilities ; 3 - copy
and give column matching as 'No'
Thanks & Regards,
Knowledge Hunter |
|
Back to top |
|
|
komal
New User
Joined: 09 May 2005 Posts: 17
|
|
|
|
Thanq for ur reply i'll check it out |
|
Back to top |
|
|
|