1 cast
Convert an expression or column to the type indicated in the type attribute.
<cast
type='type'
size='size'
ids='y|yes'
db2='y|yes'
oracle='y|yes'
>
<string /> *
</cast>
Attributes | |||||
---|---|---|---|---|---|
Name | Type | Required | Default | Description | |
Atype | string | Possible values are:: serial, smallint, int, integer, smallfloat, float, decimal, boolean, char, nchar, varchar, lvarchar, date, datetime, interval, byte, text, clob or blob. | |||
Asize | string | The size of the converted column. | |||
Aids | string | For ids databases. | |||
Adb2 | string | For db2 databases. | |||
Aoracle | string | For Oracle databases. |
Arguments | |||||
---|---|---|---|---|---|
Name | Type | Required | Unique | Nullable | Description |
Estring | string | Column name or expression. |
Example
Convert column c of type char to an integer.
Copy
<select> <columns> <cast type='INT'>c</cast> <!-- Formato XML --> </columns> <from table='test'/> </select>
2 char
Convert a column or numeric expression to text. It is useful when concatenating strings with numbers.
<char>
<expresion /> *
</char>
Arguments | |||||
---|---|---|---|---|---|
Name | Type | Required | Unique | Nullable | Description |
Eexpresion | string |
Example
Copy
<select> <columns> 'remesa' || <char>numrem</char> </columns> <from table='cremesa'/> </select>
3 smallint
It allows to convert a column or numerical expression into smallint data type.
<smallint>
<expresion /> *
</smallint>
Arguments | |||||
---|---|---|---|---|---|
Name | Type | Required | Unique | Nullable | Description |
Eexpresion | string |
Example
Copy
<select> <columns> <smallint>10</smallint> </columns> <from table='cremesa'/> </select>