Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I am using the following script to do the incremental loading.
QV_Table:
SQL SELECT PrimaryKey, X, getdate() as InsertDate FROM DB_TABLE
WHERE ModificationTime >= #$(LastExecTime)#;
Concatenate LOAD PrimaryKey, X, InsertDate FROM File.QVD
WHERE NOT Exists(PrimaryKey);
STORE QV_Table INTO File.QVD;
You can see that, The InsertDate will be always changing when the row is updated.
What I want is keep the InsertDate static even though other columns are updated, that mean the InsertDate is the initial insert date.
How to finish it?
Hi Izq_isaac,
As far as I understand your script, it already works per your requirement.
- in QV)_table you're only loading the new records, where currentDate (getdate()) is the value for insertDate
- in your concattenate-Load statement, you're loading the previous loaded records (with the insertDate they got at the moment they were loaded), and only the concttenated records will have the insertDate of getDate()/currentDatetime
Perhaps I'm missing something?
You also write about "insertDate will be changing when the row is updated": in this script there is no factility for "record-updates": it just inserts new ones (and checks on the primary key). Is this the thing you need to change?