IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to select few records from table save and reload


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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: 1436
Location: Bangalore,India

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

Anandhi,

Why dont you go thru the following link -

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
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Load new table with Old unload - DB2 DB2 6
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Check data with Exception Table DB2 0
Search our Forums:

Back to Top