Name
procedure_cols, sql_parse, sql_text, log_stats — introspect procedure metadata, parse SQL, and query log statistics
Synopsis
any procedure_cols(
|
in proc_name varchar); |
any sql_parse(
|
in sql_text varchar); |
varchar sql_text(
|
in tree any); |
any log_stats(
|
in ext_text varchar); |
Description
procedure_cols returns a vector describing the
parameters and result columns of a stored procedure. Each element holds
the name, SQL data type, nullability and parameter direction
(IN/OUT/INOUT) of one column. Pass SQL NULL to obtain the metadata of the
most recently compiled procedure on the current connection.
sql_parse parses sql_text and
returns the resulting abstract syntax tree as a nested vector. Useful for
static analysis and for generating equivalent SQL programmatically. No
semantic checks are performed; references are only checked when the tree
is compiled.
sql_text is the inverse of
sql_parse: it serialises a parse tree
tree back into SQL source text suitable for
re-parsing or for displaying in EXPLAIN output.
log_stats attaches a free-form text annotation to the
server's stats log entry for the current request. The annotation appears
in the request log and in
status output. Used
by performance tooling to tag interesting requests for later aggregation.