TDP Automation - Loop/Email Activity

Hello.

I have a loop activity set to send emails. In the email body, I have the following variables:

#Loop_SQL.RES_1#
#Loop_SQL.RES_2#
#Loop_SQL.RES_3#
#Loop_SQL.RES_3#

If any one of those variables are NULL or have only a SPACE, the script errors out with the message: Email_1 - Unable to cast object of type ‘System.DBNull’ to type ‘System.String’.

The data is from Oracle.

Any thoughts?

Change your query to use NVL function or equivelent to get rid of nulls and give better default value.

I tried NVL and Case… same error. However, it worked with Decode with a ‘space’ to replace null value.

Thanks.

Odd, but your work around sounds good.