0 - 5 of 5 tags for sql udf

Hi,

Hi,

         Am having a oracle sql with oracle UDF function in it.. the udl function is getting input value and performing some manipulation based on the input value in a table data and returing the output. I want to convert it into teradata.

 

For EG:

I put together a simple sql udf to replace characters in a string. Its limited to a 55 character source string but works well.

select replace_chars( '1%223456#664', '%16#','2')

Result:

222234522224

Hi,

I am facing a weird error when calling a SQL UDF. The weird stuff is that I do not get any error when calling the return expression directly: below my simple code

REPLACE FUNCTION "demo"."FIRST_DAY_IN_PERIOD" (
"given_period" VARCHAR(8) CHARACTER SET LATIN)
RETURNS DATE
SPECIFIC "FIRST_DAY_IN_PERIOD"
LANGUAGE SQL
CONTAINS SQL
DETERMINISTIC
CALLED ON NULL INPUT
SQL SECURITY DEFINER
COLLATION INVOKER INLINE TYPE 1
RETURN cast('01-'||given_period as DATE format 'DD-MMM-YYYY');