From: Tjelvar E. <tje...@ho...> - 2001-07-19 22:41:49
|
hi everyone, Is anyone working on a better udf-lib than the standard one's? Handling bigger strings, unicode and so on, would be great. /t eriksson |
From: Paul B. <pa...@wa...> - 2001-07-20 07:43:40
|
Yes. Work has started on this. A better more functional UDF library is being worked on by Claudio Valderama. Sponsored by one of IBPhoenix's customers. We hope that the majority of this work will be complete soon and checked back in onto Sourceforge. The following represent the new UDF's currently being implemented. --This file defines the new udfs for firebird. --set sql dialect 3; declare external function invl int, int returns int entry_point 'iNvl' module_name 'fbudf'; --FBUDF_API int* iNvl(int*, int*); declare external function snvl varchar(100), varchar(100), varchar(100) returns parameter 3 entry_point 'sNvl' module_name 'fbudf'; --FBUDF_API char* sNvl(char*, char*, char*); declare external function inullif int, int returns int entry_point '' module_name 'fbudf'; --FBUDF_API int* iNullIf(int*, int*); declare external function snullif varchar(100), varchar(100), varchar(100) returns parameter 3 entry_point 'sNullIf' module_name 'fbudf'; --FBUDF_API char* sNullIf(char*, char*, char*); declare external function dow timestamp, varchar(10) returns parameter 2 entry_point 'DOW' module_name 'fbudf'; --FBUDF_API char* DOW(ISC_DATE*, char*); declare external function sdow timestamp, varchar(5) returns parameter 2 entry_point 'SDOW' module_name 'fbudf'; --FBUDF_API char* SDOW(ISC_DATE*, char*); declare external function sright varchar(100), int, varchar(100) returns parameter 3 entry_point 'right' module_name 'fbudf'; --FBUDF_API char* right(char*, int*, char*); declare external function addDay timestamp, int returns timestamp entry_point 'addDay' module_name 'fbudf'; --FBUDF_API ISC_TIMESTAMP* addDay(ISC_TIMESTAMP* v, int ndays); declare external function addWeek timestamp, int returns timestamp entry_point 'addWeek' module_name 'fbudf'; --FBUDF_API ISC_TIMESTAMP* addWeek(ISC_TIMESTAMP* v, int nweeks); declare external function addMonth timestamp, int returns timestamp entry_point 'addMonth' module_name 'fbudf'; --FBUDF_API ISC_TIMESTAMP* addMonth(ISC_TIMESTAMP* v, int nmonths); declare external function addYear timestamp, int returns timestamp entry_point 'addYear' module_name 'fbudf'; --FBUDF_API ISC_TIMESTAMP* addYear(ISC_TIMESTAMP* v, int nyears); declare external function addSecond timestamp, int returns timestamp entry_point 'addSecond' module_name 'fbudf'; --FBUDF_API ISC_TIMESTAMP* addSecond(ISC_TIMESTAMP* v, int nseconds); declare external function addMinute timestamp, int returns timestamp entry_point 'addMinute' module_name 'fbudf'; --FBUDF_API ISC_TIMESTAMP* addMinute(ISC_TIMESTAMP* v, int nminutes); declare external function addHour timestamp, int returns timestamp entry_point 'addHour' module_name 'fbudf'; --FBUDF_API ISC_TIMESTAMP* addHour(ISC_TIMESTAMP* v, int nhours); Regards Paul Beach Main Tel (UK):+44 (0) 1844 354465 Mobile: (UK): +44 (0) 7764 188603 http://www.ibphoenix.com ----- Original Message ----- From: Tjelvar Eriksson <tje...@ho...> Newsgroups: sourceforge.firebird-devel To: <fir...@li...> Sent: Thursday, July 19, 2001 11:36 PM Subject: [Firebird-devel] udf-lib for firebird > hi everyone, > Is anyone working on a better udf-lib than > the standard one's? Handling bigger strings, > unicode and so on, would be great. > > /t eriksson > > > > _______________________________________________ > Firebird-devel mailing list > Fir...@li... > http://lists.sourceforge.net/lists/listinfo/firebird-devel > |
From: Tjelvar E. <tje...@ho...> - 2001-07-20 21:24:22
|
In the ib_udf.sql the substr is commented to handle strings of 32768 chars, but in the definition of the function five rows later down, the funcion is declared with the usual 80 chars. Is the ib_udf ok and can I only fix the declaration? thanks, t e |
From: Claudio V. C. <cv...@us...> - 2001-07-21 08:04:05
|
> -----Original Message----- > From: fir...@li... > [mailto:fir...@li...]On Behalf Of Tjelvar > Eriksson > Sent: Viernes 20 de Julio de 2001 17:19 > > In the ib_udf.sql the substr is commented to handle > strings of 32768 chars, but in the definition of the > function five rows later down, the funcion is declared > with the usual 80 chars. Is the ib_udf ok and can I > only fix the declaration? This function is so ill-behaved that I added substrlen that works with more rationale. You can create a declaration with higher limit and it should work. However, there's no reason to continue using such udf call. Firebird has implemented substring, built-in, ANSI SQL native, able to work with any charset and even able to take blobs of type binary or containing single-byte character sets. C. |