0 - 20 of 20 tags for function

I have a database table which has four columns and two of the columns are INT. The two INT columns' rows are sometimes empty.
When I try to cast them as DECIMAL(18,3) and then use the Median function I am getting the Error: An unknown character string translation was requested.

I have a query using OREPLACE that runs in one environment, but fails in another with:

Executed as Single statement.  Failed [7509 : HY000] Result Exceeded maximum length for UDF/XSP/UDM pm_edw_etl_load.oreplace2. 
Elapsed time = 00:00:00.437 
STATEMENT 1: SEL  failed. 


If I type median in a Teradata query, the word becomes blue, but it does not become bold and blue.
So, I suspect what's going on is that median is not, in fact, a function in Teradata, but the word is reserved and cannot, for example, be assigned to a user written function. Is this correct?

The following SQL function works:
REPLACE FUNCTION dl_stg.mmtest ( a VARCHAR(1) , b INT , C INT )

I've created a Java Function and imported it in TeraData
But after few thousand executions, the function becomes too slow.
You can find below output from TOP command.
tdatuser  23   8  815m  33m 1976 S  200   1.4          1835:21  udfsectsk

I'm trying to do something like below, but its giving me syntax error,
can anyone please tell me what is the issue and how to fix this.
with cte0(ID,int_col1) as(
    select row_number() over (order by (select 1)) AS ID,int_col1 from shuffletest
update cte0 set int_col1=ID;

I want to write SQL UDF with Multiple Lines:
1. Declare variables.
2. Set those variables with select into statement.
3. some if conditions on Variables
4. return some value.
What is the syntax to write this.
I'm using teradata Version

Hi Guys,
I need to create a function that reads its result from a table, so I need to use a SELECT statement to read the output. Something like that:

I have the following data;
Account_id   Date           Flag_1
123             012006        ?
123             022006        1
234             012007        1
234             022007        1

User-Defined Functions

This feature was introduced in Teradata Database V2R5.1.

Hi All,
I have a 13 digit Bigint column value 1734567890123 being divided by 1000000000000 and I need the result to be displayed as 1. But i am getting 2 as a result in Td V14.0. I cannot make use of the FLOOR() function also which is returning the same result 2
SEL 1734567890123/1000000000000 as Result
Ans :

Hi. I am trying the built-in C functions for ARRAY handling in Teradata 14. Basically, I copied the code below from the FNC_GetArrayElementCount function in the manual TD 14 External Routine Programming: 

I am new to Teradata.
I want to make a procedure in Teradata wich will do the follwing job:
1.Read an integer from a table in Teradata.(SELECT)
2.Increment a constant value to it.
3.Append the value in the same Table.(INSERT)
4.Return that value.

Hi, I'm looking for an external UDF that will emulate the strtok function in C.  I'm aware that it is available as an internal function on TD14, but our client is running 13.10.  I am using it in a recursive query to denormalize a view, so i need a scalar UDF that will return a single value result.  Thanks!

Is there a Teradata way of doing the JARO_WINKLER_SIMILARITY Function that Oracle has?

The Teradata Named Pipe Access Module (NPAM) provides an inter-process communication link between a writer process (such as FastExport) and a reader process (such as FastLoad).  The NPAM can also be used by Teradata Parallel Transporter (TPT) for data transfer.

This article details the different modes in which Named pipes are opened and used by NPAM for data transfer activity.

What is the difference between FUNCTION and SPECIFIC FUNCTION?  When do I use SHOW FUNCTION versus SHOW SPECIFIC FUNCTION?  Or HELP FUNCTION versus HELP SPECIFIC FUNCTION?  Thanks,  Denmark

I want to remove leading and trailing tabs in a column... I tried trim function and its not working... is there any other means we can remove the leading or trailing tabs...

Hi I have a select satatement in stored procedure,

Inthe where condition, i have

b.dt2_month_end =( DATE :THIS_END_DATE - EXTRACT(DAY FROM :THIS_END_DATE))--------statement A
i'm getting some syntax error.(I declared :THIS_END_DATE parameter before begin, so i think no prob with parameter)

if i give hard coded values like

I need to rollup and report data by week, with the week being defined as Sun through Saturday and identified as the Saturday-date. Does Teradata SQL have any functions that could facilitate this?