| DBIx-XMLServer documentation | view source | Contained in the DBIx-XMLServer distribution. |
DBIx::XMLServer::TextField - text field type
This class implements the built-in text field type of DBIx::XMLServer. Only the where method is overridden from the base class.
$sql_expression = $text_field->where($condition);
This field type understands three types of condition: a string comparison with wildcards; a regular expression test; and a not-null test.
=wild*card?expressionIf the first character of the condition is '=', then the rest of the condition is interpreted as a string, possible containing wildcards, to which the column is to be compared. First the string is escaped by the DBI system; then any characters '%' and '_' are escaped by prefixing with '\'; then the characters '*' and '?' are replaced by '%' and '_' respectively. The resulting SQL expression is one of the following:
<field> = <string> <field> LIKE <string>
depending on whether the string contains any wildcards.
~regexIf the first character of the condition is a tilde '~', then the rest of the condition is interpreted as a regular expression. It is escaped by the DBI system, and the SQL expression is
<field> RLIKE <string> .
(empty)If the condition is empty, then the SQL expression is
<field> IS NOT NULL .
!If the condition is the single character '!', then the SQL expression is
<field> IS NULL .
DBIx::XMLServer::Field
Martin Bright <martin@boojum.org.uk>
Copyright (C) 2003-4 Martin Bright
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| DBIx-XMLServer documentation | view source | Contained in the DBIx-XMLServer distribution. |