SQL::Statement::Util - Objects & Methods for accessing parsed SQL Statements
Column Object
Column->name() # column name in upper-caseColumn->display_name() # column alias or name in user-supplied caseColumn->table() # name of table column belongs to, if knownColumn->function() # a Function object, if it's a computed column
Column->name() Column->display_name() Column->table() Column->function()
Function Object
SQL::Statement::Func Objects A new S::S::Func object is created for each function once per prepare, after which, the following methods are available:
name() # function's name, e.g. UPPERalias() # function's alias, e.g. c1args() # an arrayref of value objectsclass() # name of package holding func's subroutine, e.g. Bar::MyFuncssubname() # name of func's subroutine, e.g. SQL_FUNCTION_UPPER
At this point, only the name of the class and sub are known, it isn't known whether there actually is a corresponding subroutine in the class. Value objects in the args arrayref may also be unknown at this point: placeholders and column names have not yet been replaced with values. Each Func object is validated once per execute, during open_tables(). Validation requires the function's package and checks for the existence of a routine named with the function's subname. An error will be generated if the subroutine can't be found.
validate() # checks if the function corresponds to an available subroutine