Posted: Mon Nov 22, 2010 1:11 pm Post subject: Insert rows into table from exported file
In QMF, I extracted data from table X and save the data to X1.DATA via the "EXPORT DATA TO X1" command. To insert the rows from X1.DATA into Table Y, I issue these commands in QMF:
Code:
IMPORT DATA FROM X1
SAVE DATA AS TEMP
INSERT INTO TABLEY
SELECT * FROM TEMP;
Can I insert data from X1.DATA directly into TABLE Y without save it into the TEMP table first?
Joined: 26 Nov 2002 Posts: 12380 Topics: 75 Location: San Jose
Posted: Mon Nov 22, 2010 7:08 pm Post subject:
danm,
If the data you are trying to load is an output from EXPORT command then you can do it directly. Make sure that it follows the naming convention
Userid.slq.tlq.table
1. Type the following at QMF command prompt and press enter
Code:
IMPORT ?
2. Next screen
Code:
IMPORT Command Prompt
1 to 20 of 20
Type ( TABLE )
Name ( YOUR_TABLE_NAME ) +
.... ( ) +
.... ( ) +
.... ( ) +
.... ( ) +
.... ( ) +
To import an object from a TSO data set into temporary
storage, enter its type: DATA, QUERY, FORM, or PROC.
To import an object from a TSO data set into the database,
enter its type and the name it is to have in the database.
Type, in this case, can be TABLE (for table or view),
QUERY, FORM, or PROC.
FROM
Data set name ( slq.tlq )
Enter the name of the TSO data set being copied.
Member ( )
If the TSO data set is partitioned, enter the
member name.
3. Next screen
Code:
IMPORT Command Prompt
1 to 9 of 9
Confirm ( YES ) Display the confirmation panel before replacing
an object in the database? YES or NO.
Comment ( I am loading data into table from dataset )
You can enter a comment to be saved with the object.
Action ( REPLACE ) REPLACE to replace table, APPEND to append imported
rows to an existing table.
Next step
Code:
+----------------------------------------------+
| IMPORT Confirmation |
| |
| WARNING: |
| |
| Your IMPORT command will replace the |
| database TABLE object named |
| DB.TABLE |
| |
| Do you want to replace this database object? |
| 1 1. YES - Replace the object. |
| 2. NO - Do not replace the object; do not |
| execute the command. |
+----------------------------------------------+
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum