Upper
Definition
The upper method allows you to add the UPPER function to the query. The UPPER function is used to convert a string from lower case to upper case.
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:
upper(): It does not receive any parameters. TheKColumnorKTableColumnthat invokes the method will be the one supplied to theUPPERfunction.
Example
Java code:
k
.select(
APP_USER.EMAIL.upper()
)
.from(APP_USER)
.multiple();
SQL generated:
SELECT
UPPER(au.email)
FROM app_user au
Parameters:
- None
2. Calling from the KFunction class
The methods available to use this functionality calling from the KFunction class are:
upper(KColumn kColumn): Receives aKColumnor aKTableColumnwhich will be supplied to theUPPERfunction.upper(KValTextField kValTextField): Receives aKValTextFieldwhich will be supplied to theUPPERfunction.
To use this way, you need to import the static functions as follows:
import static com.myzlab.k.KFunction.*;
Example: (KColumn)
Java code:
k
.select(
upper(APP_USER.EMAIL)
)
.from(APP_USER)
.multiple();
SQL generated:
SELECT
UPPER(au.email)
FROM app_user au
Parameters:
- None
Example: (KValTextField)
Java code:
k
.select(
upper(val("A short text"))
)
.single();
SQL generated:
SELECT UPPER(?1)
Parameters:
- ?1: "A short text"