Subject | Re: Add Year function |
---|---|
Author | alanpltse |
Post date | 2006-04-10T03:29:18Z |
Hi Adam,
My Firebird database is dialect 3, does it make any difference from
dialect 1?
And the field type I used is DATE.
My Firebird database is dialect 3, does it make any difference from
dialect 1?
And the field type I used is DATE.
--- In firebird-support@yahoogroups.com, "Adam" <s3057043@...> wrote:
>
> Alan,
>
> There must be something you are not telling us. The following script
> works fine. You should not have a suspend in this stored procedure
> because you don't return anything, but it runs anyway.
>
> ----
>
> DECLARE EXTERNAL FUNCTION ADDYEAR
> TIMESTAMP, INT
> RETURNS TIMESTAMP
> ENTRY_POINT 'ADDYEAR' MODULE_NAME 'FBUDF';
>
> CREATE TABLE OLDDATETABLE
> (
> TRANSACTION_DATE TIMESTAMP
> );
>
> COMMIT;
>
> SET TERM ^ ;
>
> CREATE OR ALTER PROCEDURE ADDYEAR_PROCEDURE
> AS
> BEGIN
> UPDATE OLDDATETABLE
> SET TRANSACTION_DATE = ADDYEAR(TRANSACTION_DATE, 100)
> WHERE TRANSACTION_DATE < 1910;
> SUSPEND;
> END
> ^
>
> SET TERM ; ^
>
> COMMIT;
>
> EXECUTE PROCEDURE ADDYEAR_PROCEDURE;
>
> COMMIT;
>
> ----
>
> Adam
>