UDF creation using ODBC - V2R6
Teradata Teradata Discussion Forums Teradata.com Discussion Forum
Visit Teradata.com
Home       Guidelines    Member List
Welcome Guest ( Login | Register )
        


This online forum is for user-to-user discussions of Teradata products, and is not an official customer support channel for Teradata. If you require direct assistance, please contact Teradata support.


UDF creation using ODBC - V2R6 Expand / Collapse
Author
Message
Posted 10/2/2007 2:49:37 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 10/10/2007 1:54:00 AM
Posts: 7, Visits: 1
How to CREATE a UDF in Teradata (V2R6) for the following function in oracle


FUNCTION GET_FAA(P_E_SEQ_ID C.SEQ_ID%TYPE)
RETURN VARCHAR2
AS
V_S VARCHAR2(2000);

CURSOR GET_S IS
SELECT S_CATEGORY||'-'||S_NAME||'-'||S_MOD AS SY
FROM SIDE_EFFS A
WHERE A.SEQ_ID = P_E_SEQ_ID;


BEGIN

FOR LIST IN GET_S LOOP

V_S := V_S||'; '||LIST.SY;

END LOOP;

V_S := SUBSTR(V_S,3);

RETURN(V_S);

EXCEPTION
WHEN OTHERS THEN
V_S := NULL;

RETURN(V_S);

END ;

I would like to call this function within the sql statements of the Teradata SQL.

Any thoughts and ideas will of great help.

Regards,
S
Post #9071
Posted 10/2/2007 9:49:29 PM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: PAC and SFT Members
Last Login: Today @ 6:11:07 PM
Posts: 331, Visits: 533
In V2R6, Teradata does not support SQL UDFs. They must be written in C/C++ and may not contain embedded SQL statements.
Post #9075
Posted 10/3/2007 1:17:14 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 7/18/2008 2:51:53 AM
Posts: 7, Visits: 324
You have to write the code in C or Java so as to make this function available to SQL statements in Teradata and besides you cannot create UDF via ODBC you have to use bteq to submit a UDF creation request through CLI.



Regards,

Fawad Asrar Qureshi
Post #9080
Posted 10/4/2007 1:02:44 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 10/10/2007 1:54:00 AM
Posts: 7, Visits: 1
Thankyou very much for all your inputs. Is there any work around with SQL to acomplish this.

Many Thanks,
Sony
Post #9105
Posted 10/4/2007 1:15:52 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 7/18/2008 2:51:53 AM
Posts: 7, Visits: 324
You can create a stored procedure to do this in PL/SQL



Regards,

Fawad Asrar Qureshi
Post #9106
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 2 ( 2 guests, 0 members, 0 anonymous members )
No members currently viewing this topic.


All times are GMT -5:00, Time now is 9:08pm

Powered By InstantForum.NET v4.1.4 © 2008
Execution: 0.094. 9 queries. Compression Disabled.