Implements the built-in string concatenation
# this class doesn't have a common constructor, because all derived classes # have their special requirements
SQL::Statement::Function is an abstract base class providing the interface for all function executing terms.
SQL::Statement::Function ISA SQL::Statement::Term
Destroys the term and undefines the weak reference to the owner as well as the reference to the parameter list.
# create an user function term with an SQL::Statement object as owner, # specifying the function name, the subroutine name (full qualified) # and the parameters to the subroutine my $term = SQL::Statement::Function::UserFunc->new( $owner, $name, $sub, \@params ); # access the result of that operation $term->value( $eval );
SQL::Statement::Function::UserFunc implements a term which returns the result of the specified subroutine.
SQL::Statement::Function ISA SQL::Statement::Term
Instantiates a new \*(C`SQL::Statement::Function::UserFunc\*(C' instance.
Invokes the given subroutine with the values of the params and return it's result:
my @params = map { $_->value($eval); } @{ $self->{PARAMS} }; return $subpkg->$subname( $self->{OWNER}, @params );
# create an user function term with an SQL::Statement object as owner, # specifying the expression to evaluate and the parameters to the subroutine my $term = SQL::Statement::NumericEval->new( $owner, $expr, \@params ); # access the result of that operation $term->value( $eval );
SQL::Statement::Function::NumericEval implements the numeric evaluation of a term. All parameters are expected to be numeric.
SQL::Statement::Function::NumericEval ISA SQL::Statement::Function ISA SQL::Statement::Term
Instantiates a new \*(C`SQL::Statement::Function::NumericEval\*(C' instance. Takes $owner, $expr and \@params as arguments (in specified order).
Returns the result of the evaluated expression.
# create an trim function term with an SQL::Statement object as owner, # specifying the spec, char and the parameters to the subroutine my $term = SQL::Statement::Trim->new( $owner, $spec, $char, \@params ); # access the result of that operation $term->value( $eval );
SQL::Statement::Function::Trim implements string trimming.
SQL::Statement::Function::Trim ISA SQL::Statement::Function ISA SQL::Statement::Term
Instantiates a new \*(C`SQL::Statement::Function::Trim\*(C' instance. Takes $owner, $spec, $char and \@params as arguments (in specified order).
Meaning of the parameters: Can be on of '\s-1LEADING\s0', '\s-1TRAILING\s0' '\s-1BOTH\s0'. Trims the leading chars, trailing chars or at both ends, respectively. Defaults to '\s-1BOTH\s0'. The character to trim - defaults to ' '
Expected to be an array with exact 1 element (more aren't evaluated).
Returns the trimmed value of first parameter argument.
# create an substr function term with an SQL::Statement object as owner, # specifying the start and length of the sub string to extract from the # first element of \@params my $term = SQL::Statement::SubString->new( $owner, $start, $length, \@params ); # access the result of that operation $term->value( $eval );
SQL::Statement::Function::SubString implements a sub-string extraction term.
SQL::Statement::Function::SubString ISA SQL::Statement::Function ISA SQL::Statement::Term
Instantiates a new \*(C`SQL::Statement::Function::SubString\*(C' instance. Takes $owner, $start, $length and \@params as arguments (in specified order).
Meaning of the parameters: Specifies the start position to extract the sub-string. This is expected to be a SQL::Statement::Term instance. The first character in a string has the position 1. Specifies the length of the extracted sub-string. This is expected to be a SQL::Statement::Term instance. If omitted, everything to the end of the string is returned.
Expected to be an array with exact 1 element (more aren't evaluated).
Returns the extracted sub-string value from first parameter argument.
# create an substr function term with an SQL::Statement object as owner # and \@params to concatenate my $term = SQL::Statement::StrConcat->new( $owner, \@params ); # access the result of that operation $term->value( $eval );
SQL::Statement::Function::StrConcat implements a string concatenation term.
SQL::Statement::Function::StrConcat ISA SQL::Statement::Function ISA SQL::Statement::Term
Instantiates a new \*(C`SQL::Statement::Function::StrConcat\*(C' instance.
Returns the concatenated string composed of the parameter values.
Copyright (c) 2009,2010 by Jens Rehsack: rehsackATcpan.org
All rights reserved.
You may distribute this module under the terms of either the \s-1GNU\s0 General Public License or the Artistic License, as specified in the Perl \s-1README\s0 file.