1SQL::Statement::FunctioUns(e3r)Contributed Perl DocumentSaQtLi:o:nStatement::Function(3)
2
3
4

NAME

6       SQL::Statement::Function - abstract base class for all function
7       executing terms
8

SYNOPSIS

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

DESCRIPTION

14       SQL::Statement::Function is an abstract base class providing the
15       interface for all function executing terms.
16

INHERITANCE

18         SQL::Statement::Function
19         ISA SQL::Statement::Term
20

METHODS

22   DESTROY
23       Destroys the term and undefines the weak reference to the owner as well
24       as the reference to the parameter list.
25

NAME

27       SQL::Statement::Function::UserFunc - implements executing a perl
28       subroutine
29

SYNOPSIS

31         # create an user function term with an SQL::Statement object as owner,
32         # specifying the function name, the subroutine name (full qualified)
33         # and the parameters to the subroutine
34         my $term = SQL::Statement::Function::UserFunc->new( $owner, $name, $sub, \@params );
35         # access the result of that operation
36         $term->value( $eval );
37

DESCRIPTION

39       SQL::Statement::Function::UserFunc implements a term which returns the
40       result of the specified subroutine.
41

INHERITANCE

43         SQL::Statement::Function
44         ISA SQL::Statement::Term
45

METHODS

47   new
48       Instantiates a new "SQL::Statement::Function::UserFunc" instance.
49
50   value
51       Invokes the given subroutine with the values of the params and return
52       it's result:
53
54           my @params = map { $_->value($eval); } @{ $self->{PARAMS} };
55           return $subpkg->$subname( $self->{OWNER}, @params );
56

NAME

58       SQL::Statement::Function::NumericEval - implements numeric evaluation
59       of a term
60

SYNOPSIS

62         # create an user function term with an SQL::Statement object as owner,
63         # specifying the expression to evaluate and the parameters to the subroutine
64         my $term = SQL::Statement::NumericEval->new( $owner, $expr, \@params );
65         # access the result of that operation
66         $term->value( $eval );
67

DESCRIPTION

69       SQL::Statement::Function::NumericEval implements the numeric evaluation
70       of a term. All parameters are expected to be numeric.
71

INHERITANCE

73         SQL::Statement::Function::NumericEval
74         ISA SQL::Statement::Function
75           ISA SQL::Statement::Term
76

METHODS

78   new
79       Instantiates a new "SQL::Statement::Function::NumericEval" instance.
80       Takes $owner, $expr and \@params as arguments (in specified order).
81
82   value
83       Returns the result of the evaluated expression.
84

NAME

86       SQL::Statement::Function::Trim - implements the built-in trim function
87       support
88

SYNOPSIS

90         # create an trim function term with an SQL::Statement object as owner,
91         # specifying the spec, char and the parameters to the subroutine
92         my $term = SQL::Statement::Trim->new( $owner, $spec, $char, \@params );
93         # access the result of that operation
94         $term->value( $eval );
95

DESCRIPTION

97       SQL::Statement::Function::Trim implements string trimming.
98

INHERITANCE

100         SQL::Statement::Function::Trim
101         ISA SQL::Statement::Function
102           ISA SQL::Statement::Term
103

METHODS

105   new
106       Instantiates a new "SQL::Statement::Function::Trim" instance.  Takes
107       $owner, $spec, $char and \@params as arguments (in specified order).
108
109       Meaning of the parameters:
110
111       $spec
112           Can be on of 'LEADING', 'TRAILING' 'BOTH'. Trims the leading chars,
113           trailing chars or at both ends, respectively.
114
115           Defaults to 'BOTH'.
116
117       $char
118           The character to trim - defaults to ' '
119
120       \@params
121           Expected to be an array with exact 1 element (more are not
122           evaluated).
123
124   value
125       Returns the trimmed value of first parameter argument.
126

NAME

128       SQL::Statement::Function::SubString - implements the built-in
129       sub-string function support
130

SYNOPSIS

132         # create an substr function term with an SQL::Statement object as owner,
133         # specifying the start and length of the sub string to extract from the
134         # first element of \@params
135         my $term = SQL::Statement::SubString->new( $owner, $start, $length, \@params );
136         # access the result of that operation
137         $term->value( $eval );
138

DESCRIPTION

140       SQL::Statement::Function::SubString implements a sub-string extraction
141       term.
142

INHERITANCE

144         SQL::Statement::Function::SubString
145         ISA SQL::Statement::Function
146           ISA SQL::Statement::Term
147

METHODS

149   new
150       Instantiates a new "SQL::Statement::Function::SubString" instance.
151       Takes $owner, $start, $length and \@params as arguments (in specified
152       order).
153
154       Meaning of the parameters:
155
156       $start
157           Specifies the start position to extract the sub-string. This is
158           expected to be a SQL::Statement::Term instance. The first character
159           in a string has the position 1.
160
161       $length
162           Specifies the length of the extracted sub-string. This is expected
163           to be a SQL::Statement::Term instance.
164
165           If omitted, everything to the end of the string is returned.
166
167       \@params
168           Expected to be an array with exact 1 element (more are not
169           evaluated).
170
171   value
172       Returns the extracted sub-string value from first parameter argument.
173

NAME

175       SQL::Statement::Function::StrConcat - implements the built-in string
176       concatenation
177

SYNOPSIS

179         # create an substr function term with an SQL::Statement object as owner
180         # and \@params to concatenate
181         my $term = SQL::Statement::StrConcat->new( $owner, \@params );
182         # access the result of that operation
183         $term->value( $eval );
184

DESCRIPTION

186       SQL::Statement::Function::StrConcat implements a string concatenation
187       term.
188

INHERITANCE

190         SQL::Statement::Function::StrConcat
191         ISA SQL::Statement::Function
192           ISA SQL::Statement::Term
193

METHODS

195   new
196       Instantiates a new "SQL::Statement::Function::StrConcat" instance.
197
198   value
199       Returns the concatenated string composed of the parameter values.
200
202       Copyright (c) 2009-2020 by Jens Rehsack: rehsackATcpan.org
203
204       All rights reserved.
205
206       You may distribute this module under the terms of either the GNU
207       General Public License or the Artistic License, as specified in the
208       Perl README file.
209
210
211
212perl v5.34.0                      2021-07-22       SQL::Statement::Function(3)
Impressum