All Forums Database
pushkar 2 posts Joined 05/11
20 Jun 2011
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.

Jimm 298 posts Joined 09/07
20 Jun 2011

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

mnylin 118 posts Joined 12/09
21 Jun 2011

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.

You must sign in to leave a comment.