Qore SqlUtil Module Reference 1.0

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes

All Classes Namespaces Functions Variables Groups Pages
Functions
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_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:

- uop_prepend(): prepend a string to the output of a column
- uop_append(): append a string to the output of a column
- uop_upper(): return a column in upper case
- uop_lower(): return a column in lower case

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

  uop | the update operator (one of SQL Update Operators)
  arg | the argument to the operator
  nest | any 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

  arg | the text to prepend to the row values in the output column
  nest | any 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

  nest | any 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

  arg | the text to prepend to the row values in the output column
  nest | any nested operation to the operator

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

  nest | any nested operation to the operator

Returns
  an update operator description hash corresponding to the arguments for use in update statements