Database writer error

#1

I’m using the Database writer node to write to an Oracle database and I am getting a database error. I have a column that I have created where the value is actual a function call:

String guid = “LOWER(REGEXP_REPLACE(sys_guid(),’(…)(…)(…)(…)(…)’,’\1-\2-\3-\4-\5’))”;

I have this column designated as a string. The problem is the Database writer seems to be treating this column as an actual string and I think enclosing the value with single quotes. This is a primary key, I get an error when the second row gets inserted with a primary key violation. This is not what I want. I tried changing the type to numeric hoping the column value would be entered as is without quotes.
I have generated a sql insert with this value and the insert statement will work fine. Is there anyway to let the Writer know not to enclose the value with single quotes (if that is what is happening)?

0 Likes

#2

I think what I need to do is call the function (or any other function such as TO_DATE() etc) first to get the actual string return value and then use that value in the column to be used for the column value before the call to the Writer. Unless there is another way, I will proceed with this…

0 Likes