All Forums Database
andydoorey 35 posts Joined 05/09
29 Mar 2016
UDF Default Database

Is there a database where we can create user defined functions so that it is not necessary to qualify them with the databasename when we use them.  The UDFs that have been created by the Teradata installation are all in the TD_SYSFNLIB database, and don't need to be prefixed with the databasename.  What I'm after is a place to put our own functions so we can use them in a similar way.  I don't think it is recommended to create new fiunctions in the TD_SYSFNLIB database.  
Is there a dbscontrol parameter that can be set to say to look for them in a default database?

Tags:
Fred 1096 posts Joined 08/04
29 Mar 2016

Like TD_SYSFNLIB, SYSLIB gets searched by default and contains some system-supplied functions. Unlike TD_SYSFNLIB, you can potentially add your own functions to SYSLIB.  
 
But be aware that all functions in a database (inclulding SYSLIB) get re-linked into a single library whenever you add, recompile, or delete one of them. So you should develop and test in some other database.

andydoorey 35 posts Joined 05/09
30 Mar 2016

Is it recommended to use this database?  Ideally I'd be able to create a new database, USER_SYSFNLIB, and get Teradata to search that database for functions as well as the system databases.

ZackHowe 15 posts Joined 07/06
25 Jul 2016

I am looking for the exact same thing.  We have a library of functions that we want to be able to use without having to qualify them.  I was hoping there was a way to add my own database to the "function" path.  The other option is put them in your user default database, but that isn't a great answer either...
 

You must sign in to leave a comment.