Subject RE: [firebird-support] Value check that I don't now how to solve
Author Richard Drent
DEAR Alex

I receive an error on

CREATE DOMAIN G_SPHPOWER_DOM AS
DECIMAL(4,2)
CHECK (INT_(VALUE*4)=0)


Dynamic SQL Error.
SQL error code = -804.
Function unknown.
INT_.

Other sugestions?



Richard


Hi Richard!

Create a UDF that takes a float parameter and simply give back the
fractional part of a number. (Like Delphi's FRAC function). Declare a
domain like this:

CREATE DOMAIN quarter_ AS
DECIMAL(18,2)
NOT NULL
CHECK (INT_(VALUE*4)=0)

If you multiply the input value with 4 and see the frac part of the
product, it must be zero in the right cases. This works for me.

Regards:Alex



To unsubscribe from this group, send an email to:
firebird-support-unsubscribe@yahoogroups.com



Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/