N
Neil Shadrach
I have a regular expression to filter results from an sql query.
It would help improve the overall efficiency if the result set could
be reduced by adding constraints to the query based on the regular
expression.
For example given the expression /^a (fatal|critical) error has
occurred$/
add "like 'a % error has occurred'" to the sql.
Are there any modules [1] or techniques which can derive an sql
wildcarded string from a regular expression? The regular expression
will still be applied to the results so it doesn't matter that the
wildcard string will match more.
The context is searching a historical database of error messages so
fixed strings with a few embedded variables are the norm.
Apologies if this message appears twice - I first posted it via an
internal news server last week but it doesn't appear to have got out
into the wider world.
Thanks
Neil Shadrach
[1] I have looked on CPAN but didn't find anything
It would help improve the overall efficiency if the result set could
be reduced by adding constraints to the query based on the regular
expression.
For example given the expression /^a (fatal|critical) error has
occurred$/
add "like 'a % error has occurred'" to the sql.
Are there any modules [1] or techniques which can derive an sql
wildcarded string from a regular expression? The regular expression
will still be applied to the results so it doesn't matter that the
wildcard string will match more.
The context is searching a historical database of error messages so
fixed strings with a few embedded variables are the norm.
Apologies if this message appears twice - I first posted it via an
internal news server last week but it doesn't appear to have got out
into the wider world.
Thanks
Neil Shadrach
[1] I have looked on CPAN but didn't find anything