# SQL::Statement::Function - abstract base class for all function executi... - perldoc - [phpMan]

## NAME
    [SQL::Statement::Function](https://www.chedong.com/phpMan.php/perldoc/SQL%3A%3AStatement%3A%3AFunction/markdown) - abstract base class for all function executing terms

## SYNOPSIS
      # this class does not have a common constructor, because all derived classes
      # have their special requirements

## DESCRIPTION
    [SQL::Statement::Function](https://www.chedong.com/phpMan.php/perldoc/SQL%3A%3AStatement%3A%3AFunction/markdown) is an abstract base class providing the interface for all function
    executing terms.

## INHERITANCE
      [SQL::Statement::Function](https://www.chedong.com/phpMan.php/perldoc/SQL%3A%3AStatement%3A%3AFunction/markdown)
      ISA [SQL::Statement::Term](https://www.chedong.com/phpMan.php/perldoc/SQL%3A%3AStatement%3A%3ATerm/markdown)

## METHODS
  DESTROY
    Destroys the term and undefines the weak reference to the owner as well as the reference to the
    parameter list.

## NAME
    [SQL::Statement::Function::UserFunc](https://www.chedong.com/phpMan.php/perldoc/SQL%3A%3AStatement%3A%3AFunction%3A%3AUserFunc/markdown) - implements executing a perl subroutine

## SYNOPSIS
      # create an user function term with an [SQL::Statement](https://www.chedong.com/phpMan.php/perldoc/SQL%3A%3AStatement/markdown) object as owner,
      # specifying the function name, the subroutine name (full qualified)
      # and the parameters to the subroutine
      my $term = [SQL::Statement::Function::UserFunc](https://www.chedong.com/phpMan.php/perldoc/SQL%3A%3AStatement%3A%3AFunction%3A%3AUserFunc/markdown)->new( $owner, $name, $sub, \@params );
      # access the result of that operation
      $term->value( $eval );

## DESCRIPTION
    [SQL::Statement::Function::UserFunc](https://www.chedong.com/phpMan.php/perldoc/SQL%3A%3AStatement%3A%3AFunction%3A%3AUserFunc/markdown) implements a term which returns the result of the specified
    subroutine.

## INHERITANCE
      [SQL::Statement::Function](https://www.chedong.com/phpMan.php/perldoc/SQL%3A%3AStatement%3A%3AFunction/markdown)
      ISA [SQL::Statement::Term](https://www.chedong.com/phpMan.php/perldoc/SQL%3A%3AStatement%3A%3ATerm/markdown)

## METHODS
  new
    Instantiates a new "[SQL::Statement::Function::UserFunc](https://www.chedong.com/phpMan.php/perldoc/SQL%3A%3AStatement%3A%3AFunction%3A%3AUserFunc/markdown)" instance.

  value
    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 );

## NAME
    [SQL::Statement::Function::NumericEval](https://www.chedong.com/phpMan.php/perldoc/SQL%3A%3AStatement%3A%3AFunction%3A%3ANumericEval/markdown) - implements numeric evaluation of a term

## SYNOPSIS
      # create an user function term with an [SQL::Statement](https://www.chedong.com/phpMan.php/perldoc/SQL%3A%3AStatement/markdown) object as owner,
      # specifying the expression to evaluate and the parameters to the subroutine
      my $term = [SQL::Statement::NumericEval](https://www.chedong.com/phpMan.php/perldoc/SQL%3A%3AStatement%3A%3ANumericEval/markdown)->new( $owner, $expr, \@params );
      # access the result of that operation
      $term->value( $eval );

## DESCRIPTION
    [SQL::Statement::Function::NumericEval](https://www.chedong.com/phpMan.php/perldoc/SQL%3A%3AStatement%3A%3AFunction%3A%3ANumericEval/markdown) implements the numeric evaluation of a term. All
    parameters are expected to be numeric.

## INHERITANCE
      [SQL::Statement::Function::NumericEval](https://www.chedong.com/phpMan.php/perldoc/SQL%3A%3AStatement%3A%3AFunction%3A%3ANumericEval/markdown)
      ISA [SQL::Statement::Function](https://www.chedong.com/phpMan.php/perldoc/SQL%3A%3AStatement%3A%3AFunction/markdown)
        ISA [SQL::Statement::Term](https://www.chedong.com/phpMan.php/perldoc/SQL%3A%3AStatement%3A%3ATerm/markdown)

## METHODS
  new
    Instantiates a new "[SQL::Statement::Function::NumericEval](https://www.chedong.com/phpMan.php/perldoc/SQL%3A%3AStatement%3A%3AFunction%3A%3ANumericEval/markdown)" instance. Takes *$owner*, *$expr* and
    *\@params* as arguments (in specified order).

  value
    Returns the result of the evaluated expression.

## NAME
    [SQL::Statement::Function::Trim](https://www.chedong.com/phpMan.php/perldoc/SQL%3A%3AStatement%3A%3AFunction%3A%3ATrim/markdown) - implements the built-in trim function support

## SYNOPSIS
      # create an trim function term with an [SQL::Statement](https://www.chedong.com/phpMan.php/perldoc/SQL%3A%3AStatement/markdown) object as owner,
      # specifying the spec, char and the parameters to the subroutine
      my $term = [SQL::Statement::Trim](https://www.chedong.com/phpMan.php/perldoc/SQL%3A%3AStatement%3A%3ATrim/markdown)->new( $owner, $spec, $char, \@params );
      # access the result of that operation
      $term->value( $eval );

## DESCRIPTION
    [SQL::Statement::Function::Trim](https://www.chedong.com/phpMan.php/perldoc/SQL%3A%3AStatement%3A%3AFunction%3A%3ATrim/markdown) implements string trimming.

## INHERITANCE
      [SQL::Statement::Function::Trim](https://www.chedong.com/phpMan.php/perldoc/SQL%3A%3AStatement%3A%3AFunction%3A%3ATrim/markdown)
      ISA [SQL::Statement::Function](https://www.chedong.com/phpMan.php/perldoc/SQL%3A%3AStatement%3A%3AFunction/markdown)
        ISA [SQL::Statement::Term](https://www.chedong.com/phpMan.php/perldoc/SQL%3A%3AStatement%3A%3ATerm/markdown)

## METHODS
  new
    Instantiates a new "[SQL::Statement::Function::Trim](https://www.chedong.com/phpMan.php/perldoc/SQL%3A%3AStatement%3A%3AFunction%3A%3ATrim/markdown)" instance. Takes *$owner*, *$spec*, *$char*
    and *\@params* as arguments (in specified order).

    Meaning of the parameters:

    *$spec*
        Can be on of 'LEADING', 'TRAILING' 'BOTH'. Trims the leading chars, trailing chars or at
        both ends, respectively.

        Defaults to 'BOTH'.

    *$char*
        The character to trim - defaults to ' '

    *\@params*
        Expected to be an array with exact 1 element (more are not evaluated).

  value
    Returns the trimmed value of first parameter argument.

## NAME
    [SQL::Statement::Function::SubString](https://www.chedong.com/phpMan.php/perldoc/SQL%3A%3AStatement%3A%3AFunction%3A%3ASubString/markdown) - implements the built-in sub-string function support

## SYNOPSIS
      # create an substr function term with an [SQL::Statement](https://www.chedong.com/phpMan.php/perldoc/SQL%3A%3AStatement/markdown) 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](https://www.chedong.com/phpMan.php/perldoc/SQL%3A%3AStatement%3A%3ASubString/markdown)->new( $owner, $start, $length, \@params );
      # access the result of that operation
      $term->value( $eval );

## DESCRIPTION
    [SQL::Statement::Function::SubString](https://www.chedong.com/phpMan.php/perldoc/SQL%3A%3AStatement%3A%3AFunction%3A%3ASubString/markdown) implements a sub-string extraction term.

## INHERITANCE
      [SQL::Statement::Function::SubString](https://www.chedong.com/phpMan.php/perldoc/SQL%3A%3AStatement%3A%3AFunction%3A%3ASubString/markdown)
      ISA [SQL::Statement::Function](https://www.chedong.com/phpMan.php/perldoc/SQL%3A%3AStatement%3A%3AFunction/markdown)
        ISA [SQL::Statement::Term](https://www.chedong.com/phpMan.php/perldoc/SQL%3A%3AStatement%3A%3ATerm/markdown)

## METHODS
  new
    Instantiates a new "[SQL::Statement::Function::SubString](https://www.chedong.com/phpMan.php/perldoc/SQL%3A%3AStatement%3A%3AFunction%3A%3ASubString/markdown)" instance. Takes *$owner*, *$start*,
    *$length* and *\@params* as arguments (in specified order).

    Meaning of the parameters:

    *$start*
        Specifies the start position to extract the sub-string. This is expected to be a
        [SQL::Statement::Term](https://www.chedong.com/phpMan.php/perldoc/SQL%3A%3AStatement%3A%3ATerm/markdown) instance. The first character in a string has the position 1.

    *$length*
        Specifies the length of the extracted sub-string. This is expected to be a
        [SQL::Statement::Term](https://www.chedong.com/phpMan.php/perldoc/SQL%3A%3AStatement%3A%3ATerm/markdown) instance.

        If omitted, everything to the end of the string is returned.

    *\@params*
        Expected to be an array with exact 1 element (more are not evaluated).

  value
    Returns the extracted sub-string value from first parameter argument.

## NAME
    [SQL::Statement::Function::StrConcat](https://www.chedong.com/phpMan.php/perldoc/SQL%3A%3AStatement%3A%3AFunction%3A%3AStrConcat/markdown) - implements the built-in string concatenation

## SYNOPSIS
      # create an substr function term with an [SQL::Statement](https://www.chedong.com/phpMan.php/perldoc/SQL%3A%3AStatement/markdown) object as owner
      # and \@params to concatenate
      my $term = [SQL::Statement::StrConcat](https://www.chedong.com/phpMan.php/perldoc/SQL%3A%3AStatement%3A%3AStrConcat/markdown)->new( $owner, \@params );
      # access the result of that operation
      $term->value( $eval );

## DESCRIPTION
    [SQL::Statement::Function::StrConcat](https://www.chedong.com/phpMan.php/perldoc/SQL%3A%3AStatement%3A%3AFunction%3A%3AStrConcat/markdown) implements a string concatenation term.

## INHERITANCE
      [SQL::Statement::Function::StrConcat](https://www.chedong.com/phpMan.php/perldoc/SQL%3A%3AStatement%3A%3AFunction%3A%3AStrConcat/markdown)
      ISA [SQL::Statement::Function](https://www.chedong.com/phpMan.php/perldoc/SQL%3A%3AStatement%3A%3AFunction/markdown)
        ISA [SQL::Statement::Term](https://www.chedong.com/phpMan.php/perldoc/SQL%3A%3AStatement%3A%3ATerm/markdown)

## METHODS
  new
    Instantiates a new "[SQL::Statement::Function::StrConcat](https://www.chedong.com/phpMan.php/perldoc/SQL%3A%3AStatement%3A%3AFunction%3A%3AStrConcat/markdown)" instance.

  value
    Returns the concatenated string composed of the parameter values.

## AUTHOR AND COPYRIGHT
    Copyright (c) 2009-2020 by Jens Rehsack: rehsackATcpan.org

    All rights reserved.

    You may distribute this module under the terms of either the GNU General Public License or the
    Artistic License, as specified in the Perl README file.

