Subject | Re: [firebird-support] Regular Expressions & Domains |
---|---|
Author | Helen Borrie |
Post date | 2003-06-24T13:59:07Z |
At 12:16 PM 24/06/2003 +0000, you wrote:
something like CHECK (VALUE = lower(VALUE)) actually works.
attributes of incoming values for validation, but you can't use the domain
to change a value. Provided you discover that a CHECK constraint can
process a UDF call, you could have VALUE checked against some regex
matchstring...
What I yearn for is a nice little UDF-ish library that processes RegExs,
which I would use in triggers. Now - domain triggers - there's a superb idea.
libraries). Another "branch" in the UDF paradigm, along with blob filters
and collations. I was exploring the possibility of doing it at one stage,
in Object Pascal, so it could be maintained as a single codebase for both
Linux and Windows. That doesn't provide a blanket solution for all
supported platforms though.
cover. There's a lot of confusion about the standard. It doesn't prevent
you from implementing a feature - it only requires you to surface a
standard feature in a specific way.
ibphoenix website (Downloads > contributed > UDFs)
clearer about what you wanted to achieve. Breaking the current
implementation of domains is a matter for an ODS change. A better place to
raise it is in firebird-Architect (where a clear exposition gets a more
receptive response than anything this vague).
Dealing with it via triggers doesn't require a violation of domain
standards and it's a more robust approach, IMO - a question of expanding an
existing paradigm.
Domain triggers is an interesting idea - it's moving towards
object-relational when you can build into a domain the ability for its
members (wherever they live in the database) to alter their own inputs...
But you certainly can't do
create domain blatt as (ManipulateMe(varchar(30)), since UDFs must take
constants as arguments, amongst other problems.
someone will get interested in doing it.
Helen
>Hello,No.
>
>I think I might be advised to take this to a development forum, but
>here goes anyway....
>
>I have seen from the "Open Requests" list at Sourceforge that a
>reques was made some time ago for the use of regexps in the "Where"
>clause of a select statement.
>
>However, I was wondering if regexps are usable now. I found this
>document on the IBPhonix site:
>
>http://www.ibphoenix.com/a2340.htm
>
>It talks about the aim to have UDF library in Interbase 5.0 that
>would (or might) include a regexp match function.
>
>My question is a) does such a function exist in any available UDF
>library (I cannot find it),
>b) could such a UDF be used in theIf at all, only in a CHECK constraint. But I haven't tested to see whether
>definition of a Domain?
something like CHECK (VALUE = lower(VALUE)) actually works.
>It appears to me that this would be a useful thing. My thinking isHmm, in what way would you use it? In a domain, you can prescribe
>that it would allow for a very precise but flexible mechanism for
>defining domains.
attributes of incoming values for validation, but you can't use the domain
to change a value. Provided you discover that a CHECK constraint can
process a UDF call, you could have VALUE checked against some regex
matchstring...
What I yearn for is a nice little UDF-ish library that processes RegExs,
which I would use in triggers. Now - domain triggers - there's a superb idea.
>Furthermore, if the definition could itself beThat's why I think a regex processor needs its own library (or
>retrieved from the database it could be used in any programming
>languages that supported the same school of regexps, thus providing a
>single point of control for valid values as data was entered on the
>client-side.
libraries). Another "branch" in the UDF paradigm, along with blob filters
and collations. I was exploring the possibility of doing it at one stage,
in Object Pascal, so it could be maintained as a single codebase for both
Linux and Windows. That doesn't provide a blanket solution for all
supported platforms though.
>I held back in the past from making such a suggestion because IUDFs, blob filters, collations are all extensions that the standard doesn't
>realised that it would probably not be compliant with the SQL-92 etc
>standards. However, I seem to remember a recent discussion in the
>groups here that it was stated that Firebird can have additional
>features which are not in SQL 92 if they are useful to users.
cover. There's a lot of confusion about the standard. It doesn't prevent
you from implementing a feature - it only requires you to surface a
standard feature in a specific way.
>I don't mind being told to take this request to the development forumThere might be - you can catch up with the latest UDF contributions at the
>(is that on Yahoo?), but I would like to know if there is such a UDF
ibphoenix website (Downloads > contributed > UDFs)
>and if the UDF could be used to define a domain.It's a development idea worth discussion but I think you'd need to be
clearer about what you wanted to achieve. Breaking the current
implementation of domains is a matter for an ODS change. A better place to
raise it is in firebird-Architect (where a clear exposition gets a more
receptive response than anything this vague).
Dealing with it via triggers doesn't require a violation of domain
standards and it's a more robust approach, IMO - a question of expanding an
existing paradigm.
Domain triggers is an interesting idea - it's moving towards
object-relational when you can build into a domain the ability for its
members (wherever they live in the database) to alter their own inputs...
> From my reading ofYou could test it in a CHECK constraint.
>the documentation a domain definition couldn't use a UDF
But you certainly can't do
create domain blatt as (ManipulateMe(varchar(30)), since UDFs must take
constants as arguments, amongst other problems.
>, so I thinkPossibly, but the more well-considered a feature request, the more likely
>this might well have to be made into a feature request.
someone will get interested in doing it.
Helen