Question

I have 2 tables: TABLE_1 and TABLE_2, all have same field: ID (primary key) and NAME. I want to import the data from TABLE_1 to TABLE_2 and I assume TABLE_1 has all the latest data. So I need to insert or update the records in TABLE_2 by primary key, delete is not needed. And I need to use .ixf to complete this task. As right now, I am just manually export the .ixf file from TABLE_1 as C:\table_1 and using IMPORT FROM "C:\table_1" OF IXF MODIFIED BY INDEXSCHEMA=DB2ADMIN METHOD P (1, 2) MESSAGES "C:\dblog.txt" INSERT INTO DB2ADMIN.TEST_2 (ID, NAME); Anything I can add into this sql statement to do inserts and updates on primary key?

Thanks,

Was it helpful?

Solution

IMPORT is not an SQL statement, it's a DB2 Command.

Have you tried reading the manual for the IMPORT command to look at what options you have when performing an import? Perhaps searching for INSERT_UPDATE?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top