- COPYRIGHT & LICENSE
Fey::Literal::Function - Represents a literal function in a SQL statement
my $function = Fey::Literal::Function->new( 'LENGTH', $column );
This class represents a literal function in a SQL statement, such as
This module is a subclass of
This class provides the following methods:
This method creates a new
It requires at least one argument, which is the name of the SQL function that this literal represents. It can accept any number of additional optional arguments. These arguments must be either scalars, literals, or columns which belong to a table.
Any scalars passed in as arguments will be passed in turn to
Use this to explicitly set a function's alias name for use in SQL. If you don't set this it will be autogenerated as needed.
The function's name, as passed to the constructor.
Returns an array reference of the function's arguments, as passed to the constructor.
Returns the appropriate SQL snippet.
$function->sql_with_alias() causes a unique alias for the function to be created.
This class does the
This class overrides the
is_orderable() methods so that they only return true if the
$function->sql_with_alias() has been called previously. This function is called when a function is used in the
SELECT clause of a query. A function must be used in a
SELECT in order to be used in a
GROUP BY or
ORDER BY clause.
Dave Rolsky, <email@example.com>
See Fey for details on how to report bugs.
Copyright 2006-2009 Dave Rolsky, All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.