k2v-academy / K2View-Academy

Other
0 stars 0 forks source link

Broadway- update null on population fields #1049

Closed oGogp2SnAhcX8fABSwQBzbjZe1wt8TouGQVrnkV closed 4 months ago

oGogp2SnAhcX8fABSwQBzbjZe1wt8TouGQVrnkV commented 4 months ago

I have a requirement to set null value in a field population in case value does not exist in a lookup table:

However, when the lookup returns NULL, the orig value (from SourceDBActor) is being passed from the params instead of the NULL which I Need to set. IgnoreNulls does not seem to affect in a Insert population.

Can I force NULL into the table without removing the params link? Note: removing the params link and connect each field individually works, but can be tedious WA in a very large tables.

Below throws: org.postgresql.util.PSQLException Cause: The column index is out of range: 1, number of columns: 0

image
tZajFGR0CidT8AVERBHw8puD36HY6oWViykmIIb commented 4 months ago

You need to check the DbFetch output. If it's null, pass an empty string. Otherwise - pass the fetched value. image

oGogp2SnAhcX8fABSwQBzbjZe1wt8TouGQVrnkV commented 4 months ago

Empty string is not equivalent to null in some DBs and applications. There are cases where null is required. Is the only way to achieve that is with removing params link and connecting each field individually?

tZajFGR0CidT8AVERBHw8puD36HY6oWViykmIIb commented 4 months ago

Data object in Broadway does not distinguish between null and no value. So you should either draw individual links, Or, make an update statement after insert.