Bonjour,
j'ai téléchargé la bibliotheque 'FreeUDFLib' pour installer des UDF.
Après avoir installé à fonction year :
DECLARE EXTERNAL FUNCTION B_YEAR
DATE
RETURNS INTEGER BY VALUE
ENTRY_POINT 'YEAR' MODULE_NAME 'FreeUDFLib.dll';
j'ai voulue la tester avec la commande sql ci-dessous :
select b_year(cast('12/06/2004' as Date)) from rdb$database.
Resultat: j'obtient le message suivant:
!---------------------------------------------!
!Invalid request BLR at offset 60. !
!Function B_YEAR is not defined. !
!module name or entrypoint could not be found.!
!-------------------------------------------- !
La Dll est bien dans les répertoires:
C:\Program Files\Firebird\udf
C:\Program Files\Firebird\Bin
C:\Program Files\Firebird\LIB
-------------------------------
Quelle est la cause de cette erreur ?
Que faut-il faire ?
-------------------------------------------
Voici quelques lignes tirées du code source:
type
TCTimeStructure = record
tm_sec : integer; // Seconds
tm_min : integer; // Minutes
tm_hour : integer; // Hour (0--23)
tm_mday : integer; // Day of month (1--31)
tm_mon : integer; // Month (0--11)
tm_year : integer; // Year (calendar year minus 1900)
tm_wday : integer; // Weekday (0--6) Sunday = 0)
tm_yday : integer; // Day of year (0--365)
tm_isdst : integer; // 0 if daylight savings time is not in effect)
end;
PCTimeStructure = ^TCTimeStructure;
TM = TCTimeStructure;
PTM = ^TM;
function Year(ib_date: PISC_QUAD): Integer;
const cYearOffset = 1900;
var
tm_date: tm;
begin
isc_decode_date(ib_date, @tm_date);
result := tm_date.tm_year + cYearOffset;
end;
Partager