Using Functions in Teradata

Tools
Enthusiast

Using Functions in Teradata

Hi,

We have a following query in Oracle pl/sql which uses the following function "func" which accepts parameters and returns a value.

<<<<<<<<<
select func (param_1,param_2,param_3)
from
select
(
column_1 param_1,
column_2 param_2
from
tbl 1
)
>>>>>>>>

As seen above the values sent as param_1 , param_2 are taken from the column_1 and column_2 of table tbl 1.

Can anyone help me out on converting this to Teradata equivalent "function".
2 REPLIES
Enthusiast

Re: Using Functions in Teradata

Try out putting the same SQL in a macro.
Enthusiast

Re: Using Functions in Teradata

You can use the same syntax in Teradata. Are you having problems?

To simplify it, you can change it to:

<<<<<<<<<
select
func(column_1, column_2, param_3)
from
tbl 1

>>>>>>>>

You didn't say what param_3 is. If that needs to be a variable that doesn't come from the table, then you will need to execute the statement with a "USING" clause.