Subject | Re: Add Year function |
---|---|
Author | alanpltse |
Post date | 2006-04-10T01:18:11Z |
Hi Adam,
Yes, I found the script:
declare external function addYear
timestamp, int
returns timestamp
entry_point 'addYear' module_name 'fbudf'
But I got the same error AddYear is not defined when I compile my
stored procedure.
CREATE PROCEDURE ADDYEAR_PROCEDURE
AS
BEGIN
UPDATE OldDateTable
SET Transaction_Date = ADDYEAR(Transaction_Date, 100)
WHERE Transaction_Date < 1910;
SUSPEND;
END
Yes, I found the script:
declare external function addYear
timestamp, int
returns timestamp
entry_point 'addYear' module_name 'fbudf'
But I got the same error AddYear is not defined when I compile my
stored procedure.
CREATE PROCEDURE ADDYEAR_PROCEDURE
AS
BEGIN
UPDATE OldDateTable
SET Transaction_Date = ADDYEAR(Transaction_Date, 100)
WHERE Transaction_Date < 1910;
SUSPEND;
END
--- In firebird-support@yahoogroups.com, "Adam" <s3057043@...> wrote:
>
>
> > How do I declare that in the database using IBExpert or EMS
> IBManager ?
>
> AddYear is not a built in function in Firebird. It is an external
> function (UDF). In order to access an external function, your
> database must contain the details of the function (what its called,
> what parameters are there, what are the data types, how to clean up
> memory, and which dll the function call is in). If your database does
> not contain the declaration, you might as well be
> calling 'FlyToTheMoon', because Firebird will have just as much idea
> how that can be done.
>
> Although AddYear is an external function, it is inside a library that
> ships with Firebird. Specifically:
>
> [Firebird install path]\UDF\fbudf.dll
>
> There is a corresponding .sql file in the same folder that contains
> the declarations. You just need to find the appropriate one and run
> it (or just run the whole script).
>
> But the rule is, if you haven't declared the external function inside
> the fdb itself, you can't use it.
>
> Adam
>