Cast in teradata userdefined function

General
Enthusiast

Cast in teradata userdefined function

How to do casting in Userdefined function?

Tags (1)
3 REPLIES
Senior Supporter

Re: Cast in teradata userdefined function

Too unspecific question.

SQL UDF?

Java or C?

What should the fucntion do and why do you want to cast?

Enthusiast

Re: Cast in teradata userdefined function

Hi,

Teradata version:12

UDF using C

     For EG, the senario is like for 3 values(a,b,c) will be peforming some calculation and the end output d (will be a decimal one) i need to have that in the format of decimal(20,15) (it can be done in the sql part after getting the output from the function) , but is there any posibilty of performing in c program itself??

Senior Supporter

Re: Cast in teradata userdefined function

Still not too clear.

I guess you need to spend some time on the UDF manualls.

and maybe

http://developer.teradata.com/extensibility/articles/developing-database-extensions-udfs-etc

could also be a starting point

In generall you define the input and output data types in the create function statement

but you would need to take care in C that your value d is a decimal(20,15) value.