Subject Re: I can't Backup/Restore a FB 2.01 database after creating it using a nScript
Author marc_guillot
Thank you, Paul, but it doesn't works, this formula will say that I'am
37 years old, but it's not true, I will be 37 in October.

I think I will use the solution proposed by John :

COMPUTED BY (cast(((current_date - cast(CLI_BIRTHDAY as date)) /
365.25) - 0.5 as integer))

--- In firebird-support@yahoogroups.com, "Mercea Paul"
<paul.mercea@...> wrote:
>
> You can use EXTRACT to do that:
>
> COMPUTED BY ( CAST((EXTRACT(YEAR FROM CURRENT_DATE)-EXTRACT(YEAR FROM
> CLI_BIRTHDAY)) as integer)
>
>
>
> Regards,
>
> Paul
>
>
>
> From: firebird-support@yahoogroups.com
> [mailto:firebird-support@yahoogroups.com] On Behalf Of marc_guillot
> Sent: Wednesday, March 14, 2007 9:30 PM
> To: firebird-support@yahoogroups.com
> Subject: [firebird-support] I can't Backup/Restore a FB 2.01
database after
> creating it using a nScript
>
>
>
> Hello.
>
> I creates a FB 2.01 using an Script (so I'am sure it's not corrupted),
> but it fails in backup/restore.
>
> gbak finishes Backup with no problem, but when restoring I get an
> error of FLOOR (from ib_udf.dll) not registered.
>
> ¿ In FB 2.01 there is not possible to backup/restore a database that
> uses udf's into their computed fields ?.
>
> I uses FLOOR udf, in a computed field who calculates the age of a
> person (from his birthday), if somebody knows anyway to calculate it
> without using udf's, i could avoid the problem.
>
> COMPUTED BY (cast(floor((current_date-cast(CLI_BIRTHDAY as
> date))/365.25) as integer))
>
> Thank you.
>
>
>
>
>
> [Non-text portions of this message have been removed]
>