Qore SqlUtil Module Reference  1.2
SQL Update Operator Functions

Functions

hash SqlUtil::make_uop (string uop, any arg, *hash nest)
 returns a hash with uop, arg, and nest keys More...
 
hash SqlUtil::uop_append (string arg, *hash nest)
 returns a hash for the "append" or concatenate operator with the given argument More...
 
hash SqlUtil::uop_lower (*hash nest)
 returns a hash for the "lower" operator with the given argument; returns a column value in lower case More...
 
hash SqlUtil::uop_prepend (string arg, *hash nest)
 returns a hash for the "prepend" operator with the given argument More...
 
hash SqlUtil::uop_seq (string seq)
 returns a hash for the "seq" operator with the given argument giving the sequence name whose value should be returned More...
 
hash SqlUtil::uop_upper (*hash nest)
 returns a hash for the "upper" operator with the given argument; returns a column value in upper case More...
 

Detailed Description

These are functions that can be used as the values of update keys in select statements:

Update operator functions can be nested as in the following example:

Example:
my int $rows_updated = t.update(("permission_type": uop_append("-migrated", uop_lower())));

Function Documentation

hash SqlUtil::make_uop ( string  uop,
any  arg,
*hash  nest 
)

returns a hash with uop, arg, and nest keys

Parameters
uopthe update operator (one of SQL Update Operators)
argthe argument to the operator
nestany nested operation to the operator
Returns
an update operator description hash corresponding to the arguments for use in update statements
Note
Normally this function is not called directly, but rather by the other update operator functions
hash SqlUtil::uop_append ( string  arg,
*hash  nest 
)

returns a hash for the "append" or concatenate operator with the given argument

Example:
my int $rows_updated = t.update(("permission_type": uop_append("-migrated", uop_lower())));
Parameters
argthe text to prepend to the row values in the output column
nestany nested operation to the operator
Returns
an update operator description hash corresponding to the arguments for use in update statements
hash SqlUtil::uop_lower ( *hash  nest)

returns a hash for the "lower" operator with the given argument; returns a column value in lower case

Example:
my int $rows_updated = t.update(("permission_type": uop_lower()));
Parameters
nestany nested operation to the operator
Returns
an update operator description hash corresponding to the arguments for use in update statements
hash SqlUtil::uop_prepend ( string  arg,
*hash  nest 
)

returns a hash for the "prepend" operator with the given argument

Example:
my int $rows_updated = t.update(("permission_type": uop_prepend("migrated-", uop_lower())));
Parameters
argthe text to prepend to the row values in the output column
nestany nested operation to the operator
Returns
an update operator description hash corresponding to the arguments for use in update statements
hash SqlUtil::uop_seq ( string  seq)

returns a hash for the "seq" operator with the given argument giving the sequence name whose value should be returned

Example:
my *list $rows = $table.selectRows(("columns": ("id", "name", cop_seq("xid")), "where": ("type": "user")));
Parameters
seqthe name of the sequence whose value should be returned
Returns
an update operator description hash corresponding to the arguments for use in update statements
hash SqlUtil::uop_upper ( *hash  nest)

returns a hash for the "upper" operator with the given argument; returns a column value in upper case

Example:
my int $rows_updated = t.update(("permission_type": uop_upper()));
Parameters
nestany nested operation to the operator
Returns
an update operator description hash corresponding to the arguments for use in update statements