Ballerina API Documentation

Functions of ballerina.lang.datatables package

function close(datatable dt)

Releases the database connection.

Parameters:

Parameter NameData TypeDescription
dtdatatableThe datatable object

function getArray(datatable dt, int index) (map )

Retrieves arrays values of a given column index.

Parameters:

Parameter NameData TypeDescription
dtdatatableThe datatable object
indexint

Return Parameters:

Return VariableData TypeDescription
mapmap): The column value as map

function getArray(datatable dt, string name) (map )

Retrieves arrays values of a given column name.

Parameters:

Parameter NameData TypeDescription
dtdatatableThe datatable object
namestring

Return Parameters:

Return VariableData TypeDescription
mapmap): The column value as map

function getBoolean(datatable dt, string name) (boolean )

Retrieves the Boolean value of the designated column in the current row

Parameters:

Parameter NameData TypeDescription
dtdatatableThe datatable object
namestringThe column name of the output result.

Return Parameters:

Return VariableData TypeDescription
booleanThe column value as a Boolean

function getBoolean(datatable dt, int index) (boolean )

Retrieves the Boolean value of the designated column in the current row

Parameters:

Parameter NameData TypeDescription
dtdatatableThe datatable object
indexintThe column index position of the result. The first column is 1, the second is 2, etc.

Return Parameters:

Return VariableData TypeDescription
booleanThe column value as a Boolean

function getDouble(datatable dt, int index) (double )

Retrieves the double value of the designated column in the current row

Parameters:

Parameter NameData TypeDescription
dtdatatableThe datatable object
indexintThe column index position of the result. The first column is 1, the second is 2, etc.

Return Parameters:

Return VariableData TypeDescription
doubleThe column value as a double

function getDouble(datatable dt, string name) (double )

Retrieves the double value of the designated column in the current row

Parameters:

Parameter NameData TypeDescription
dtdatatableThe datatable object
namestringThe column name of the output result.

Return Parameters:

Return VariableData TypeDescription
doubleThe column value as a double

function getFloat(datatable dt, int index) (float )

Retrieves the float value of the designated column in the current row

Parameters:

Parameter NameData TypeDescription
dtdatatableThe datatable object
indexintThe column index position of the result. The first column is 1, the second is 2, etc.

Return Parameters:

Return VariableData TypeDescription
floatThe column value as a float

function getFloat(datatable dt, string name) (float )

Retrieves the float value of the designated column in the current row

Parameters:

Parameter NameData TypeDescription
dtdatatableThe datatable object
namestringThe column name of the output result.

Return Parameters:

Return VariableData TypeDescription
floatThe column value as a float

function getInt(datatable dt, string name) (int )

Retrieves the integer value of the designated column in the current row

Parameters:

Parameter NameData TypeDescription
dtdatatableThe datatable object
namestringThe column name of the output result.

Return Parameters:

Return VariableData TypeDescription
intThe column value as an integer

function getInt(datatable dt, int index) (int )

Retrieves the integer value of the designated column in the current row

Parameters:

Parameter NameData TypeDescription
dtdatatableThe datatable object
indexintThe column index position of the result. The first column is 1, the second is 2, etc.

Return Parameters:

Return VariableData TypeDescription
intThe column value as an integer

function getLong(datatable dt, int index) (long )

Retrieves the long value of the designated column in the current row

Parameters:

Parameter NameData TypeDescription
dtdatatableThe datatable object
indexintThe column index position of the result. The first column is 1, the second is 2, etc.

Return Parameters:

Return VariableData TypeDescription
longThe column value as a long

function getLong(datatable dt, string column, string type) (long )

Retrieves the long value of the designated column in the current row for the given column type: date, time, or timestamp

Parameters:

Parameter NameData TypeDescription
dtdatatableThe datatable object
columnstringdt: The datatable object
typestringDatabase table column type. Supported values are date, time, timestamp

Return Parameters:

Return VariableData TypeDescription
longThe column value as a long

function getLong(datatable dt, string name) (long )

Retrieves the long value of the designated column in the current row

Parameters:

Parameter NameData TypeDescription
dtdatatableThe datatable object
namestringThe column name of the output result.

Return Parameters:

Return VariableData TypeDescription
longThe column value as a long

function getLong(datatable dt, int index, string type) (long )

Retrieves the long value of the designated column in the current row for the given column type: date, time, or timestamp

Parameters:

Parameter NameData TypeDescription
dtdatatableThe datatable object
indexintThe column index position of the result. The first column is 1, the second is 2, etc.
typestringDatabase table column type. Supported values are date, time, timestamp

Return Parameters:

Return VariableData TypeDescription
longThe column value as a long

function getString(datatable dt, int index) (string )

Retrieves the string value of the designated column in the current row

Parameters:

Parameter NameData TypeDescription
dtdatatableThe datatable object
indexintThe column index position of the result. The first column is 1, the second is 2, etc.

Return Parameters:

Return VariableData TypeDescription
stringThe column value as a string

function getString(datatable dt, string column, string type) (string )

Retrieves the base64encoded string value of the designated column in the current row for the given column type: blob, clob, nclob, or binary

Parameters:

Parameter NameData TypeDescription
dtdatatableThe datatable object
columnstringdt: The datatable object
typestringDatabase table column type. Supported values are blob, clob, nclob, binary.

Return Parameters:

Return VariableData TypeDescription
stringThe column value as a string

function getString(datatable dt, int index, string type) (string )

Retrieves the base64encoded string value of the designated column in the current row for the given column type: blob, clob, nclob, or binary

Parameters:

Parameter NameData TypeDescription
dtdatatableThe datatable object
indexintThe column index position of the result. The first column is 1, the second is 2, etc.
typestringDatabase table column type. Supported values are blob, clob, nclob, binary.

Return Parameters:

Return VariableData TypeDescription
stringThe column value as a string

function getString(datatable dt, string name) (string )

Retrieves the string value of the designated column in the current row

Parameters:

Parameter NameData TypeDescription
dtdatatableThe datatable object
namestringThe column name of the output result.

Return Parameters:

Return VariableData TypeDescription
stringThe column value as a string

function getValueAsString(datatable dt, string name) (string )

Retrieves the string value of the designated column in the current row. The value of type blob and binary columns will return as a Base64Encoded string.

Parameters:

Parameter NameData TypeDescription
dtdatatableThe datatable object
namestringThe column name of the output result.

Return Parameters:

Return VariableData TypeDescription
stringThe column value as a string

function getValueAsString(datatable dt, int index) (string )

Retrieves the string value of the designated column in the current row. The value of type blob and binary columns will return as a Base64Encoded string.

Parameters:

Parameter NameData TypeDescription
dtdatatableThe datatable object
indexintThe column index position of the result. The first column is 1, the second is 2, etc.

Return Parameters:

Return VariableData TypeDescription
stringThe column value as a string

function next(datatable dt) (boolean )

Checks for a new row in the given datatable. If a new row is found, moves the cursor to it.

Parameters:

Parameter NameData TypeDescription
dtdatatableThe datatable object

Return Parameters:

Return VariableData TypeDescription
booleanTrue if there is a new row; false otherwise

function toJson(datatable dt) (json )

Outputs the dataset in JSON format as a stream.

Parameters:

Parameter NameData TypeDescription
dtdatatableThe datatable object

Return Parameters:

Return VariableData TypeDescription
jsonThe resulting dataset in JSON format

function toXml(datatable dt, string rootWrapper, string rowWrapper) (xml )

Outputs the dataset in XML format as a stream. This function will add 'results' and 'result' if the root wrapper and row wrapper elements are not provided.

Parameters:

Parameter NameData TypeDescription
dtdatatableThe datatable object
rootWrapperstringThe root wrapper element
rowWrapperstringThe row wrapper element

Return Parameters:

Return VariableData TypeDescription
xmlThe resulting dataset in XML format with given root wrapper and row wrapper. The default will be results and result if the wrapper isn't provided.


Menu

  • Functions
    • close(datatable dt)
    • getArray(datatable dt, int index) (map )
    • getArray(datatable dt, string name) (map )
    • getBoolean(datatable dt, string name) (boolean )
    • getBoolean(datatable dt, int index) (boolean )
    • getDouble(datatable dt, int index) (double )
    • getDouble(datatable dt, string name) (double )
    • getFloat(datatable dt, int index) (float )
    • getFloat(datatable dt, string name) (float )
    • getInt(datatable dt, string name) (int )
    • getInt(datatable dt, int index) (int )
    • getLong(datatable dt, int index) (long )
    • getLong(datatable dt, string column, string type) (long )
    • getLong(datatable dt, string name) (long )
    • getLong(datatable dt, int index, string type) (long )
    • getString(datatable dt, int index) (string )
    • getString(datatable dt, string column, string type) (string )
    • getString(datatable dt, int index, string type) (string )
    • getString(datatable dt, string name) (string )
    • getValueAsString(datatable dt, string name) (string )
    • getValueAsString(datatable dt, int index) (string )
    • next(datatable dt) (boolean )
    • toJson(datatable dt) (json )
    • toXml(datatable dt, string rootWrapper, string rowWrapper) (xml )

Copyright 2017 Ballerina API Documentation