Creating New User Defined Functions
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.


Creating New User Defined Functions Expand / Collapse
Author
Message
Posted 8/19/2006 7:02:35 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 7/2/2008 7:11:53 AM
Posts: 2, Visits: 5
How to create our own user defined functions please let me know its very important
Post #4940
Posted 8/22/2006 4:49:13 AM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 10/11/2006 6:05:00 AM
Posts: 23, Visits: 1
If, instead of clicking on 'Discussion forums', you move down a bit and right a bit on the Teradata.Com page, you'll see a link to 'Drivers and UDFs'.

You can pinch a pre-written UDF from there and tailor it to your own needs The one you want to write is probably already there.
Post #4956
Posted 9/22/2006 1:17:02 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 4/28/2007 11:12:00 AM
Posts: 5, Visits: 1
1:create a file name it 'helloworld.c',locate it in c:\temp
2:open file helloworld.c ,and copy the follow words:

#define SQL_TEXT Latin_Text
#include "sqltypes_td.h"
void Sayhello(VARCHAR_LATIN *result){
strcpy((char*)result,(const char*)"Hello World!");
return;
}

3:save and close file helloworld.c
4:create a file name it 'helloworld.bteq',locate it in c:\temp
5:open file helloword.bteq ,and copy the follow words:

.logon yourdbc/dbc,dbc;
database yourDB;
replace function Sayhello()
RETURNS VARCHAR(13)
LANGUAGE C
NO SQL
EXTERNAL NAME
'CS!helloworld!c:\temp\helloworld.c!F!Sayhello'
PARAMETER STYLE TD_GENERAL;
.logoff

6:save and close file helloworld.bteq
7:start a command window,cd c:\temp path,and run : bteq \< helloworld.bteq
8:open Teradata SQL Assistant ,and type
SELECT yourDB.Sayhello();
run it!

That's all,if you want to konw more information ,please open PDF help document and read it.
Post #5254
« Prev Topic | Next Topic »


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


All times are GMT -5:00, Time now is 3:04am

Powered By InstantForum.NET v4.1.4 © 2008
Execution: 0.047. 7 queries. Compression Disabled.