All Forums Connectivity
sony 7 posts Joined 08/07
02 Oct 2007
UDF creation using ODBC - V2R6

How to CREATE a UDF in Teradata (V2R6) for the following function in oracleFUNCTION GET_FAA(P_E_SEQ_ID C.SEQ_ID%TYPE)RETURN VARCHAR2ASV_S VARCHAR2(2000);CURSOR GET_S ISSELECT S_CATEGORY||'-'||S_NAME||'-'||S_MOD AS SYFROM SIDE_EFFS AWHERE A.SEQ_ID = P_E_SEQ_ID;BEGINFOR LIST IN GET_S LOOPV_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

Fred 1096 posts Joined 08/04
02 Oct 2007

In V2R6, Teradata does not support SQL UDFs. They must be written in C/C++ and may not contain embedded SQL statements.

FAQ-4151 7 posts Joined 04/07
03 Oct 2007

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.

sony 7 posts Joined 08/07
04 Oct 2007

Thankyou very much for all your inputs. Is there any work around with SQL to acomplish this. Many Thanks,Sony

FAQ-4151 7 posts Joined 04/07
04 Oct 2007

You can create a stored procedure to do this in PL/SQL

You must sign in to leave a comment.