Created 08-28-2024 04:56 PM
Hello, I want to copy record from one table to another table that has the same structure in Oracle 12c+.
One not-null column in source has white space. When trying to insert record to the target table, I got error "cannot insert NULL", so I added UpdateRecord processor to replace Null with white space, but still have the same error.
It works if I replace Null with any other character like "_". Is there any way to keep white space when inserting to the target table?
Below is my Flowfile and the UpdateRecord properties. Thank you
Created on 08-30-2024 06:23 AM - edited 08-30-2024 06:24 AM
Hi @xtd ,
I did not try this but I think what is happening is that when you call the PutDatabaseRecord using CSVReader it doesnt differentiate null and empty string value and it will assume the later is also null and that is why you get the error. Have you tried converting csv into json and then do update record to see if that makes any difference? Another option is to use PutSql so that you can write your own sql but this would be cumbersome in case you have many fields.
Created on 08-30-2024 06:23 AM - edited 08-30-2024 06:24 AM
Hi @xtd ,
I did not try this but I think what is happening is that when you call the PutDatabaseRecord using CSVReader it doesnt differentiate null and empty string value and it will assume the later is also null and that is why you get the error. Have you tried converting csv into json and then do update record to see if that makes any difference? Another option is to use PutSql so that you can write your own sql but this would be cumbersome in case you have many fields.
Created 08-30-2024 07:54 AM
Thank you so much, it works perfectly