I am building a CQ to inject NULL values for String data fields that have “Not available” in the source database.
CASE WHEN META(o,"TableName").toString()=="<schema-name>.<table-name>"
then
CASE WHEN TO_STRING(data(12]) ="Not Available" THEN putUserData(o, 'DENOMINATOR', "NULL")
WHEN TO_STRING(data(13]) = "Not Available" THEN putUserData(o, 'SCORE', NULL)
WHEN TO_STRING(data(14]) = "Not Available" THEN putUserData(o, 'LOWER_ESTIMATE', NULL)
WHEN TO_STRING(data(15]) = "Not Available" THEN putUserData(o, 'HIGHER_ESTIMATE', NULL)
ELSE O
I am receiving the following compile error :
Error Saving Component
Syntax error at: CASENULL)
Please fix the errors and click "Save" again.
I also tried the following syntax
CASE WHEN TO_STRING(dataI12]) ="Not Available" THEN NULL
WHEN TO_STRING(dataI13]) = "Not Available" THEN NULL
WHEN TO_STRING(dataI14]) = "Not Available" THEN NULL
WHEN TO_STRING(dataI15]) = "Not Available" THEN NULL
Reference docs : https://www.striim.com/docs/en/handling-nulls-with-cqs.html