Updating records from DQC


(Praveen Sunny) #1

Hi,

I am trying to update a field in a table in the source DB from which I am reading the data. I see the Jdbc writer can INSERT records and not update the records I am trying to update. Is there something I am missing from the Jdbc writer that will allow me to update the existing records from a DQC plan.


(Ra Li) #2

Have you tried using “SQL Execute” step?


(Praveen Sunny) #3

Ok so that means the JDBC writer component can only insert records and not update records is that right?.


(Katrin Popova) #4

Hi,

I am not sure what you are trying to achieve, can you give me an example?
Both Jdbc Writer and Jdbc Reader have Advanced option where you can specify before/after SQL script: SQL instructions representing the script to be executed in the database after/before reading/writing is done.

Regards,
Katrin


(Praveen Sunny) #5

I have a plan which reads a table from the source and checks the validity of around four columns(null checks and lookup verification). Once done with the validity checks I want to update one of the source table’s validation field with the value VALID or INVALID according to the result of the checks.

I see that the SQL Execute will help me to update the table for each record being processed in the plan. This is enough for my scenario. Thanks for the help.

When i tried to do with the JDBC writer it tried to insert the record. I haven’t tried the advanced option i will try with that also and see.

But just to clarify the JDBC writer component is this how the component will work?

  1. Before script executes
  2. Record being processed by the plan will be inserted
  3. After script executes

If so in my scenario I don’t want the second step to happen. Is there a way to stop the JDBC writer from doing the second step.