using UDF with TPT

Teradata Employee

using UDF with TPT


I am trying to use the Oracle UDFs provided by teradata in my TPT script. The problem I am facing is with the use of single quotes " ' " inside my insert part of my apply.

since the INSERT statement within the APPLY has to be contained within " ' "(single quotes) I cannot use the "nvl" udf that requires the replacement string to be in " ' ".

Example: 'Insert into table1 values ( nvl(:column, 'replacement string'));'

If anyone knows the escape character that may be used to escape the " ' " enclosing the "replacement string" then please help me.

NOTE: I know you might think that I could achieve the same result by doing so many different ways, however, I am bound to use this method.

Tags (3)

Re: using UDF with TPT

If you want one single quote within a string, just use two.
'Insert into table1 values ( nvl(:column, ''replacement string''));'

Re: using UDF with TPT

Jimm answered your question, but I'm curious why you have to use the Oracle UDFs? I've seen other people post similar restrictions on this forum and I'm genuinely curious as to why people have these kinds of restrictions in place.