/*
 *   FreeAdhocUDF - copyright (c) 2004-2007 adhoc dataservice GmbH
 *   Christoph Theuring / Peter Mandrella / Georg Horn
 *   (bug-)reports only to udf@adhoc-data.de
 *      based on FreeUDFLibC - copyright (c) 1999 Gregory Deatz
 *   Declarations script for all FreeAdhocUDF UDFs
 *   Notice: to use with dialect 3 (timestamp-field is TIMESTAMP)
 *   length of some cstring = 8190 or 4095 
 *   because so you can use one this UDF 4 (8) times in a piped string
 *   4 x 8190 = 32760 < 32762 (15 bit - 6 byte internal use)
 *   Functions in alphabetical order
 *
 *   new functions at the end of the scipt
 */

SET SQL DIALECT 3;

/******************************************************************************/
/****                 User Defined Functions: Date and TIME                ****/
/****       to use ONLY with FireBird 2.x - possibility to return NULL     ****/ 
/******************************************************************************/

DECLARE EXTERNAL FUNCTION F_ADDDAY
    TIMESTAMP NULL,
    INTEGER NULL
    RETURNS TIMESTAMP FREE_IT
    ENTRY_POINT 'addday' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_ADDHOUR
    TIMESTAMP NULL,
    INTEGER NULL
    RETURNS TIMESTAMP FREE_IT
    ENTRY_POINT 'addhour' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_ADDMINUTE
    TIMESTAMP NULL,
    INTEGER NULL
    RETURNS TIMESTAMP FREE_IT
    ENTRY_POINT 'addminute' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_ADDMONTH
    TIMESTAMP NULL,
    INTEGER NULL
    RETURNS TIMESTAMP FREE_IT
    ENTRY_POINT 'addmonth' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_ADDSECOND
    TIMESTAMP NULL,
    INTEGER NULL
    RETURNS TIMESTAMP FREE_IT
    ENTRY_POINT 'addsecond' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_ADDWEEK
    TIMESTAMP NULL,
    INTEGER NULL
    RETURNS TIMESTAMP FREE_IT
    ENTRY_POINT 'addweek' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_ADDYEAR
    TIMESTAMP NULL,
    INTEGER NULL
    RETURNS TIMESTAMP FREE_IT
    ENTRY_POINT 'addyear' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_AGEINDAYS
    TIMESTAMP NULL,
    TIMESTAMP NULL
    RETURNS INTEGER FREE_IT
    ENTRY_POINT 'ageindaysnull' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_AGEINDAYSTHRESHOLD
    TIMESTAMP NULL,
    TIMESTAMP NULL,
    INTEGER NULL,
    INTEGER NULL,
    INTEGER NULL,
    INTEGER NULL
    RETURNS INTEGER FREE_IT
    ENTRY_POINT 'ageindaysthresholdnull' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_AGEINHOURS
    TIMESTAMP NULL,
    TIMESTAMP NULL
    RETURNS INTEGER FREE_IT
    ENTRY_POINT 'ageinhoursnull' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_AGEINHOURSTHRESHOLD
    TIMESTAMP NULL,
    TIMESTAMP NULL,
    INTEGER NULL,
    INTEGER NULL,
    INTEGER NULL,
    INTEGER NULL
    RETURNS INTEGER FREE_IT
    ENTRY_POINT 'ageinhoursthresholdnull' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_AGEINMINUTES
    TIMESTAMP NULL,
    TIMESTAMP NULL
    RETURNS INTEGER FREE_IT
    ENTRY_POINT 'ageinminutesnull' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_AGEINMINUTESTHRESHOLD
    TIMESTAMP NULL,
    TIMESTAMP NULL,
    INTEGER NULL,
    INTEGER NULL,
    INTEGER NULL,
    INTEGER NULL
    RETURNS INTEGER FREE_IT
    ENTRY_POINT 'ageinminutes thresholdnull' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_AGEINMONTHS
    TIMESTAMP NULL,
    TIMESTAMP NULL
    RETURNS INTEGER FREE_IT
    ENTRY_POINT 'ageinmonthsnull' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_AGEINMONTHSTHRESHOLD
    TIMESTAMP NULL,
    TIMESTAMP NULL,
    INTEGER NULL,
    INTEGER NULL,
    INTEGER NULL,
    INTEGER NULL
    RETURNS INTEGER FREE_IT
    ENTRY_POINT 'ageinmonthsthresholdnull' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_AGEINSECONDS
    TIMESTAMP NULL,
    TIMESTAMP NULL
    RETURNS INTEGER FREE_IT
    ENTRY_POINT 'ageinsecondsnull' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_AGEINSECONDSTHRESHOLD
    TIMESTAMP NULL,
    TIMESTAMP NULL,
    INTEGER NULL,
    INTEGER NULL,
    INTEGER NULL,
    INTEGER NULL
    RETURNS INTEGER FREE_IT
    ENTRY_POINT 'ageinsecondsthresholdnull' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_AGEINWEEKS
    TIMESTAMP NULL,
    TIMESTAMP NULL
    RETURNS INTEGER FREE_IT
    ENTRY_POINT 'ageinweeksnull' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_AGEINWEEKSTHRESHOLD
    TIMESTAMP NULL,
    TIMESTAMP NULL,
    INTEGER NULL,
    INTEGER NULL,
    INTEGER NULL,
    INTEGER NULL
    RETURNS INTEGER FREE_IT
    ENTRY_POINT 'ageinweeksthresholdnull' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_AGEINYEARS
    TIMESTAMP NULL,
    TIMESTAMP NULL
    RETURNS INTEGER FREE_IT
    ENTRY_POINT 'ageinyearsnull' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_AGEINYEARSTHRESHOLD
    TIMESTAMP NULL,
    TIMESTAMP NULL,
    INTEGER NULL,
    INTEGER NULL,
    INTEGER NULL,
    INTEGER NULL
    RETURNS INTEGER FREE_IT
    ENTRY_POINT 'ageinyearsthresholdnull' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_CDOWLONG
    TIMESTAMP NULL
    RETURNS CSTRING(16) FREE_IT
    ENTRY_POINT 'cdowlong' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_CDOWLONGLANG
    TIMESTAMP NULL,
    CSTRING(2) NULL
    RETURNS CSTRING(16) FREE_IT
    ENTRY_POINT 'cdowlonglang' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_CDOWSHORT
    TIMESTAMP NULL
    RETURNS CSTRING(4) FREE_IT
    ENTRY_POINT 'cdowshort' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_CDOWSHORTLANG
    TIMESTAMP NULL,
    CSTRING(2) NULL
    RETURNS CSTRING(16) FREE_IT
    ENTRY_POINT 'cdowshortlang' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_CMONTHLONG
    TIMESTAMP NULL
    RETURNS CSTRING(16) FREE_IT
    ENTRY_POINT 'cmonthlong' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_CMONTHLONGLANG
    TIMESTAMP NULL,
    CSTRING(2) NULL
    RETURNS CSTRING(16) FREE_IT
    ENTRY_POINT 'cmonthlonglang' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_CMONTHSHORT
    TIMESTAMP NULL
    RETURNS CSTRING(4) FREE_IT
    ENTRY_POINT 'cmonthshort' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_CMONTHSHORTLANG
    TIMESTAMP NULL,
    CSTRING(2) NULL
    RETURNS CSTRING(16) FREE_IT
    ENTRY_POINT 'cmonthshortlang' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_DAYOFMONTH
    TIMESTAMP NULL
    RETURNS INTEGER FREE_IT
    ENTRY_POINT 'dayofmonth' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_DAYOFWEEK
    TIMESTAMP NULL
    RETURNS INTEGER FREE_IT
    ENTRY_POINT 'dayofweek' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_DAYOFYEAR
    TIMESTAMP NULL
    RETURNS INTEGER FREE_IT
    ENTRY_POINT 'dayofyear' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_DAYSBETWEEN
    TIMESTAMP NULL,
    TIMESTAMP NULL
    RETURNS INTEGER FREE_IT
    ENTRY_POINT 'daysbetween' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_DAYSOFMONTH
    INTEGER NULL,
    INTEGER NULL
    RETURNS INTEGER FREE_IT
    ENTRY_POINT 'daysofmonth' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_DTIME
    TIMESTAMP NULL
    RETURNS INTEGER FREE_IT
    ENTRY_POINT 'dtime' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_ENCODEDATE
    INTEGER NULL,
    INTEGER NULL,
    INTEGER NULL
    RETURNS DATE FREE_IT
    ENTRY_POINT 'encodedate' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_ENCODETIME
    INTEGER NULL,
    INTEGER NULL,
    INTEGER NULL
    RETURNS TIME FREE_IT
    ENTRY_POINT 'encodetime' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_ENCODETIMESTAMP
    INTEGER NULL,
    INTEGER NULL,
    INTEGER NULL,
    INTEGER NULL,
    INTEGER NULL,
    INTEGER NULL
    RETURNS TIMESTAMP FREE_IT
    ENTRY_POINT 'encodetimestamp' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_EQUALDATE
    TIMESTAMP NULL,
    TIMESTAMP NULL
    RETURNS INTEGER FREE_IT
    ENTRY_POINT 'equaldate' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_EQUALDATETIME
    TIMESTAMP NULL,
    TIMESTAMP NULL
    RETURNS INTEGER FREE_IT
    ENTRY_POINT 'equaldatetime' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_GFORMATD
    CSTRING(254) NULL,
    TIMESTAMP NULL
    RETURNS CSTRING(254) FREE_IT
    ENTRY_POINT 'gformatd' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_HOUR
    TIMESTAMP NULL
    RETURNS INTEGER FREE_IT
    ENTRY_POINT 'hour' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_HOURSBETWEEN
    TIMESTAMP NULL,
    TIMESTAMP NULL
    RETURNS INTEGER FREE_IT
    ENTRY_POINT 'hoursbetween' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_ISLEAPYEAR
    TIMESTAMP NULL
    RETURNS INTEGER FREE_IT
    ENTRY_POINT 'isleapyear' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_LASTDAY
    INTEGER NULL,
    INTEGER NULL
    RETURNS INTEGER FREE_IT
    ENTRY_POINT 'lastday' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_MAXDATE
    TIMESTAMP NULL,
    TIMESTAMP NULL
    RETURNS TIMESTAMP FREE_IT
    ENTRY_POINT 'maxdate' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_MINDATE
    TIMESTAMP NULL,
    TIMESTAMP NULL
    RETURNS TIMESTAMP FREE_IT
    ENTRY_POINT 'mindate' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_MINUTE
    TIMESTAMP NULL
    RETURNS INTEGER FREE_IT
    ENTRY_POINT 'minute' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_MINUTESBETWEEN
    TIMESTAMP NULL,
    TIMESTAMP NULL
    RETURNS INTEGER FREE_IT
    ENTRY_POINT 'minutesbetween' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_MONTH
    TIMESTAMP NULL
    RETURNS INTEGER FREE_IT
    ENTRY_POINT 'month' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_MONTHSBETWEEN
    TIMESTAMP NULL,
    TIMESTAMP NULL
    RETURNS INTEGER FREE_IT
    ENTRY_POINT 'monthsbetween' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_OSTERDATUM
    INTEGER NULL
    RETURNS DATE FREE_IT
    ENTRY_POINT 'osterdatum' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_QUARTER
    TIMESTAMP NULL
    RETURNS INTEGER FREE_IT
    ENTRY_POINT 'quarter' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_SECOND
    TIMESTAMP NULL
    RETURNS INTEGER FREE_IT
    ENTRY_POINT 'second' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_SECONDSBETWEEN
    TIMESTAMP NULL,
    TIMESTAMP NULL
    RETURNS INTEGER FREE_IT
    ENTRY_POINT 'secondsbetween' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_STRIPDATE
    TIMESTAMP NULL
    RETURNS TIMESTAMP FREE_IT
    ENTRY_POINT 'stripdate' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_STRIPTIME
    TIMESTAMP NULL
    RETURNS TIMESTAMP FREE_IT
    ENTRY_POINT 'striptime' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_STRTOTIME
    CSTRING(11) NULL
    RETURNS TIME FREE_IT
    ENTRY_POINT 'strtotime' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_WEEK
    TIMESTAMP NULL
    RETURNS INTEGER FREE_IT
    ENTRY_POINT 'week' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_WEEKOFYEAR
    TIMESTAMP NULL
    RETURNS INTEGER FREE_IT
    ENTRY_POINT 'weekofyear' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_WEEKSBETWEEN
    TIMESTAMP NULL,
    TIMESTAMP NULL
    RETURNS INTEGER FREE_IT
    ENTRY_POINT 'weeksbetween' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_WOY
    TIMESTAMP NULL
    RETURNS CSTRING(8) FREE_IT
    ENTRY_POINT 'woy' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_YEAR
    TIMESTAMP NULL
    RETURNS INTEGER FREE_IT
    ENTRY_POINT 'year' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_YEAROFYEAR
    TIMESTAMP NULL
    RETURNS INTEGER FREE_IT
    ENTRY_POINT 'yearofyear' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_YEARSBETWEEN
    TIMESTAMP NULL,
    TIMESTAMP NULL
    RETURNS INTEGER FREE_IT
    ENTRY_POINT 'yearsbetween' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_ZEITDIFFERENZ
    TIMESTAMP NULL,
    TIMESTAMP NULL,
    CSTRING(1) NULL
    RETURNS DOUBLE PRECISION FREE_IT
    ENTRY_POINT 'zeitdifferenz' MODULE_NAME 'FreeAdhocUDF';

/* adhoc 2006-12-03 */

DECLARE EXTERNAL FUNCTION F_EXTRACTYEARDAY
    TIMESTAMP NULL
    RETURNS INTEGER FREE_IT
    ENTRY_POINT 'r_yearday' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_EXTRACTWEEKDAY
    TIMESTAMP NULL
    RETURNS INTEGER FREE_IT
    ENTRY_POINT 'r_weekday' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_DOW
    TIMESTAMP NULL
    RETURNS INTEGER FREE_IT
    ENTRY_POINT 'r_dow' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_RISLEAPYEAR
    INTEGER NULL
    RETURNS INTEGER FREE_IT
    ENTRY_POINT 'r_isleapyear' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_RENCODEDATE
    INTEGER NULL,
    INTEGER NULL,
    INTEGER NULL
    RETURNS TIMESTAMP FREE_IT
    ENTRY_POINT 'r_encodedate' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_RENCODEDATETIME
    INTEGER NULL,
    INTEGER NULL,
    INTEGER NULL,
    INTEGER NULL,
    INTEGER NULL,
    INTEGER NULL
    RETURNS TIMESTAMP FREE_IT
    ENTRY_POINT 'r_encodedatetime' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_DATETOSTR
   TIMESTAMP NULL,
   CSTRING(254) NULL
   RETURNS CSTRING(254) FREE_IT
   ENTRY_POINT 'datetostr' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_FIRSTDAYMONTH
   TIMESTAMP NULL
   RETURNS TIMESTAMP FREE_IT
   ENTRY_POINT 'firstdaymonth' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_LASTDAYMONTH
   TIMESTAMP NULL
   RETURNS TIMESTAMP FREE_IT
   ENTRY_POINT 'lastdaymonth' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_ADDPERIOD
   CSTRING(254) NULL,
   CSTRING(254) NULL
   RETURNS CSTRING(254) FREE_IT
   ENTRY_POINT 'addperiod' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_SUBPERIOD
   CSTRING(254) NULL,
   CSTRING(254) NULL
   RETURNS CSTRING(254) FREE_IT
   ENTRY_POINT 'subperiod' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_PERIOD2SECONDS
   CSTRING(254) NULL
   RETURNS INTEGER FREE_IT
   ENTRY_POINT 'period2seconds' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_SECONDS2PERIOD
   INTEGER NULL
   RETURNS CSTRING(254) FREE_IT
   ENTRY_POINT 'seconds2period' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_TIMETODOUBLE
    TIMESTAMP NULL
    RETURNS DOUBLE PRECISION FREE_IT
    ENTRY_POINT 'timetodouble' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_DATETODOUBLE
    TIMESTAMP NULL
    RETURNS DOUBLE PRECISION FREE_IT
    ENTRY_POINT 'datetodouble' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_DOUBLETOTIME
    DOUBLE PRECISION NULL
    RETURNS TIMESTAMP FREE_IT
    ENTRY_POINT 'doubletotime' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_DOUBLETODATE
    DOUBLE PRECISION NULL
    RETURNS TIMESTAMP FREE_IT
    ENTRY_POINT 'doubletodate' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_MILLISECOND
    TIMESTAMP NULL
    RETURNS INTEGER FREE_IT
    ENTRY_POINT 'millisecond' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_INCDATE
   TIMESTAMP NULL,
   INTEGER NULL,
   INTEGER NULL,
   INTEGER NULL
   RETURNS TIMESTAMP FREE_IT
   ENTRY_POINT 'incdate' MODULE_NAME 'FreeAdhocUDF';
   
DECLARE EXTERNAL FUNCTION F_INCDATETIME
   TIMESTAMP NULL,
   INTEGER NULL,
   INTEGER NULL,
   INTEGER NULL,
   INTEGER NULL,
   INTEGER NULL,
   INTEGER NULL
   RETURNS TIMESTAMP FREE_IT
   ENTRY_POINT 'incdatetime' MODULE_NAME 'FreeAdhocUDF';

/* adhoc 2007-04-19 */

DECLARE EXTERNAL FUNCTION F_KALENDERWOCHE
   TIMESTAMP NULL
   RETURNS INTEGER FREE_IT
   ENTRY_POINT 'kalenderwoche' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_WEIBERFASTNACHT
    INTEGER NULL
    RETURNS DATE FREE_IT
    ENTRY_POINT 'weiberfastnacht' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_ROSENMONTAG
    INTEGER NULL
    RETURNS DATE FREE_IT
    ENTRY_POINT 'rosenmontag' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_KARNEVALSDIENSTAG
    INTEGER NULL
    RETURNS DATE FREE_IT
    ENTRY_POINT 'karnevalsdienstag' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_ASCHERMITTWOCH
    INTEGER NULL
    RETURNS DATE FREE_IT
    ENTRY_POINT 'aschermittwoch' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_PALMSONNTAG
    INTEGER NULL
    RETURNS DATE FREE_IT
    ENTRY_POINT 'palmsonntag' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_GRUENDONNERSTAG
    INTEGER NULL
    RETURNS DATE FREE_IT
    ENTRY_POINT 'gruendonnerstag' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_KARFREITAG
    INTEGER NULL
    RETURNS DATE FREE_IT
    ENTRY_POINT 'karfreitag' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_OSTERSAMSTAG
    INTEGER NULL
    RETURNS DATE FREE_IT
    ENTRY_POINT 'ostersamstag' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_OSTERMONTAG
    INTEGER NULL
    RETURNS DATE FREE_IT
    ENTRY_POINT 'ostermontag' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_HIMMELFAHRT
    INTEGER NULL
    RETURNS DATE FREE_IT
    ENTRY_POINT 'himmelfahrt' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_PFINGSTSONNTAG
    INTEGER NULL
    RETURNS DATE FREE_IT
    ENTRY_POINT 'pfingstsonntag' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_PFINGSTMONTAG
    INTEGER NULL
    RETURNS DATE FREE_IT
    ENTRY_POINT 'pfingstmontag' MODULE_NAME 'FreeAdhocUDF';

DECLARE EXTERNAL FUNCTION F_FRONLEICHNAM
    INTEGER NULL
    RETURNS DATE FREE_IT
    ENTRY_POINT 'fronleichnam' MODULE_NAME 'FreeAdhocUDF';


/* adhoc 2007-07-09 */

  
  
  
  
  
  
  
  
  
