using UDF with TPT

Database
Teradata Employee

using UDF with TPT

Hello,

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.

Thanks.
Tags (3)
2 REPLIES
N/A

Re: using UDF with TPT

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

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.