Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to select few records from table save and reload

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
anandhi28

New User


Joined: 07 Mar 2005
Posts: 8
Location: Bangalore

PostPosted: Thu Nov 08, 2007 2:24 pm    Post subject: How to select few records from table save and reload
Reply with quote

In QMF in need to select a few records from the production environment based on a condition and insert the selected records into the test environment.

In QMF of the test environment i can select the records from the production table also.
But the resultant set is 500+ records . i need to use a query that will load these records into the test .
For example

SELECT *
FROM CORPD000.XPPERP0V
WHERE "EMP_SCL_SCUTY_NO" =+389722631
FOR FETCH ONLY WITH UR
I need to save the result of this query and add that resultant rows into the Test environment table

INSERT INTO DBJB.CORPQ003.XPPERP0V
VALUES (from the prev query ) .

Can you guys please suggest me
1) how to save the resultant of the first query into a temp table and load it into the test table.

2) i am looking for the specific SQL commands that i can use in the QMF.
Back to top
View user's profile Send private message

murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Thu Nov 08, 2007 2:29 pm    Post subject:
Reply with quote

Anandhi,

Why dont you go thru the following link -

http://ibmmainframes.com/viewtopic.php?t=24926&highlight=insert
Back to top
View user's profile Send private message
anandhi28

New User


Joined: 07 Mar 2005
Posts: 8
Location: Bangalore

PostPosted: Thu Nov 08, 2007 3:30 pm    Post subject:
Reply with quote

WHEN i try to run a nestes query like the below

INSERT INTO CORPQ003.XXPPERPT (
SELECT *
FROM DBJC.CORPD000.XPPERP0V
WHERE "EMP_SCL_SCUTY_NO" =+389722631 )


it results in an error
QUERY MESSAGES:
The query reference to a remote object is invalid.

but i can execute the
SELECT *
FROM DBJC.CORPD000.XPPERP0V
WHERE "EMP_SCL_SCUTY_NO" =+389722631

seperately in the same system.
So i need to save the resultant set into temp and use this temp table to load the test system table.
Back to top
View user's profile Send private message
rpuhlman

New User


Joined: 11 Jun 2007
Posts: 80
Location: Columbus, Ohio

PostPosted: Fri Nov 09, 2007 8:15 pm    Post subject:
Reply with quote

Anandhi ... do you have QMF for Windows?
Back to top
View user's profile Send private message
roopannamdhari
Warnings : 1

New User


Joined: 14 Sep 2006
Posts: 71
Location: Bangalore

PostPosted: Sat Nov 10, 2007 6:34 pm    Post subject: Reply to: How to select few records from table save and relo
Reply with quote

do you have access to both production table and test table @ a time? means is it possible to use both production and test table in a single query
Back to top
View user's profile Send private message
frudo

New User


Joined: 16 Aug 2005
Posts: 5

PostPosted: Sun Nov 11, 2007 10:58 am    Post subject: Reply to: How to select few records from table save and relo
Reply with quote

Hi,
you can download the result from a query into a datset using the following command

export data to "name of your dataset".

transfer the dataset from production to test. (Not sure what you use in your shop).

To insert the data do the foll in QMF,

type the command
Import data from "dataset name"
you will get a pop up panel, enter the name of the table, columns and other info.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Data replication from multiple Db2 ta... kishpra DB2 5 Mon Mar 27, 2017 9:58 pm
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am
No new posts how to send just 10 rows in a CICS sc... Megha Gupta CICS 5 Thu Feb 23, 2017 6:57 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us