teradata function

Database

teradata function

hi,
i know how to create and use UDFs but is it possible to write a simple function in teradata which is SQL based? something similar to a stored procedure which can return a value..the function could encompass a business rule that might do some SQL computations on input provided and return a value..
i looked at documentation and realised that the create function clause is meant only for UDFs..
any help would be great..
Manish
3 REPLIES

Re: teradata function

Hi,

We can write some sql by Code as per our requirement by using SQL in-built function but it is not function. We are using this inline in the sql statement. If we cannot achieve our functionality by using sql in-built functions then we need to go for UDF.

I hope this makes sense.

Re: teradata function

well it does make sense..but i wud tell u the problem i got and how i want to tackle it..
lets say i want to write a function to convert no. from decimal to lets say base 50..i want to write a function that i can use in my SQL..now this can be done using UDFs and i can write it in C..but since i know this is also possible using the SQL procedural language in Teradata or any other RDBMS..so i want to write this as an all SQL function only..so my code remains integrated in database..and i dont have to go out and look in file system..ofcourse its not something i cant do but dont want to cuz i know it can be done in SQL..
if it was oracle, i wud have already done it..
am not able to find any material related to pure SQL functions in teradata..i guess they dont want me to write something which is possible using SQL only in C or C++..

Re: teradata function

well since there was no SQL way here, i made an UDF.