on 02-18-2011 7:07 PM
Dear experts,
I have a File to JDBC scenario. I am doing an UPDATE_INSERT statement on the DB. The target table has a 6 columns with three primary keys. Hence my target structure looks like this.
<STATEMENT_NAME>
<TABLE_NAME action="UPDATE_INSERT">
<table>TBL</table>
<access>
<col1></col1>
<col2></col2>
<col3></col3>
<col4></col4>
<col5></col5>
<col6></col6>
</access>
<key>
<col1></col1>
<col2></col2>
<col3></col3>
</key>
The scenario is working absolutely fine with regards to update and insert conditions depending on the primary keys.
The col6 needs to be a timestamp which I mapped to the currentDateTime so that it reflects when the record is updated or inserted into the DB. The issue is, when the first run is done, I get all the records as inserted in to the DB and the col6 reflects the timestamp. But when I change some records in the file (source) and run the scenario, I see that the value of col6 for all the records is updated instead of the changed records. I know that I need to do some changes in the mapping of col6 with regards to update or insert, just not sure how/what to do. Any help would be greatly appreciated.
Regards,
> But when I change some records in the file (source) and run the scenario, I see that the value of col6 for all the records is updated instead of the changed records.
Do you mean: you change some records, but the other records remain in the file unchanged?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes Kris..I am doing it with mapping..!!!
When I have the changed records only, then only those records are updated with the timestamp in the table.
But the thing is, the flat file comes from a different source which I have no control of and it might contain unchanged records too.
I am wondering how to do the mapping for this. Like, if there is a change in the record, do an update or insert else leave it as is.
Regards,
Are you passing all the records or just the records that needs to be changed during your second run? And I presume you are filling the col6 with mapped timestamp value (and not the DB determined value)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
>> just not sure how/what to do. Any help would be greatly appreciated.
Seems like this problem is at the database level. Timestamp updates when it gets updated every time. Talk to DBA and see how that column is created...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.