on 11-26-2014 3:12 PM
Hello Guys,
I want to load from CSV file to IQ16 table , but this table has primary key and CSV has existing primary key data.
I want to take this existing data as update , new data as insert in IQ Load command. But It seems to me, IQ Loader doesn't have this feature .
I am thinking another method ... ie) Load to another table and use insert-select command and update command .
However , I think some guys has same trouble in IQ. How to solve this case ? Does anyone know good method ?
And I googled about this, "Sybase ETL" has this feature for IQ. But this products is obsoleted? Data Services has same feature ?
Rgs,
Jim
Sorry, the options mentioned above are to record the duplicates. They don't allow "REPLACE".
To my knowledge this feature "Replace the duplicate with the new one" is not part of load options yet.
The methof below could help to workaround :
1-Export data of the existing table to old_data.csv file
2-truncate the table
3-load table from the new csv file
4-load table from the old_data.csv with options IGNORE CONSTRAINT UNIQUE , MESSAGE LOG ROW LOG.
Boh new data and old non-duplicated will be then inserted, and old duplicates will be rejected.
Hope this helps.
Regards,
Tayeb.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
A lot of times we see this process followed to do 'in place' updates. In fact, this is what we tend to follow in the Replication Server RTL world when moving updates into IQ:
You could also also slightly change the process and only load the primary key into the temp table:
Mark
Hi Jim,
To load only the new rows and reject the duplicates, try load options
IGNORE CONSTRAINT UNIQUE , MESSAGE LOG ROW LOG.
Eg.
Load table (....
)
....
IGNORE CONSTRAINT UNIQUE 0
MESSAGE LOG 'c:\\client-data\\load.trace'
ROW LOG 'c:\\client-data\\load_rows.trace' ONLY LOG UNIQUE
see details regarding "MESSAGE LOG ROW log" Load options in Load table statement
Regards,
Tayeb.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.