Subject | Re: [firebird-support] CHECK for all numeric characters |
---|---|
Author | David Johnson |
Post date | 2005-09-01T17:25:22Z |
On Thu, 2005-09-01 at 18:26 +0200, Ivan Prenosil wrote:
I have recently had to coerce some character columns with garbage data
into numerics in another SQL dialect. I believe that there are UDF's
that will do this task:
length(rtrim(transform(column, '0123456789', ' '))) = 0
> > I'm creating a domain that's CHAR(11) and I'd like to add a check toNot quite ... this will allow '0A'.
> > make sure all the characters are numeric. I'm experiencing a brain
> > freeze right now and can't come up with one. Can anyone suggest the
> > appropriate CHECK statement(s)?
>
> CHECK (Value BETWEEN '00000000000' AND '99999999999')
>
> Ivan
>
>
I have recently had to coerce some character columns with garbage data
into numerics in another SQL dialect. I believe that there are UDF's
that will do this task:
length(rtrim(transform(column, '0123456789', ' '))) = 0