Chr
Definition
The chr
method allows you to add the CHR
function to the query. The CHR
function is used to return the corresponding character against the given code within the argument.
There are 2 ways to call this method:
1. Calling from a KColumn
or a KTableColumn
The only one method available to use this functionality calling from a KColumn
or a KTableColumn
is:
chr()
: It does not receive any parameters. TheKColumn
orKTableColumn
that invokes the method will be the one supplied to theCHR
function.
Example
Java code:
k
.select(
APP_USER.EMAIL.ascii().chr()
)
.from(APP_USER)
.multiple();
SQL generated:
SELECT
CHR(ASCII(au.email))
FROM app_user au
Parameters:
- None
2. Calling from the KFunction
class
The only one method available to use this functionality calling from the KFunction
class is:
chr(KColumn kColumn)
: Receives aKColumn
or aKTableColumn
which will be supplied to theCHR
function.
To use this way, you need to import the static functions as follows:
import static com.myzlab.k.KFunction.*;
Example
Java code:
k
.select(
chr(ascii(APP_USER.EMAIL))
)
.from(APP_USER)
.multiple();
SQL generated:
SELECT
CHR(ASCII(au.email))
FROM app_user au
Parameters:
- None