UDF that accept string then process that string and return processed string

Database

UDF that accept string then process that string and return processed string

Hi

All,

 

I'm a beginner to write a UDF. I try to write a UDF which one work like concat() function of MySQL.

But I failed every time. I write a UDF which can add two integers but cant write UDF like concat function.

 

Please help me, please please please ......

 

please send a sample or full code of that kind of UDF or give me some link that gives me some idea, who to return a string and take parameters as a string and process that string..

 

please help me to solve this issue, this is verry urgent for me. So please help me..

2 REPLIES
Senior Apprentice

Re: UDF that accept string then process that string and return processed string

REPLACE FUNCTION concat(str1 VARCHAR(100), str2 VARCHAR(100))
RETURNS VARCHAR(200)
LANGUAGE SQL
CONTAINS SQL
DETERMINISTIC
RETURNS NULL ON NULL INPUT
SQL SECURITY DEFINER
COLLATION INVOKER
INLINE TYPE 1
RETURN str1 || str2;

Re: UDF that accept string then process that string and return processed string

I need the c code of a UDF where the C code have 3 function.. xxx_init(), xxx_deinit(); and xxx();..