new CallableStatement()
Represents a callable statement
The CallableStatement class has a similar signature to the PreparedStatement class
Methods
-
async close()
-
Closes the statement.
Throws:
-
Throws an error if the object the method is being called on is not valid.
-
-
async execute() → {boolean}
-
Executes a specified statement
Throws:
-
Throws an error on invalid parameters or if the object the method is being called on is not valid.
Returns:
True if the execution yielded result sets, false if not- Type
- boolean
-
-
getBigInt(index) → {ctypes.Int64}
-
Returns an Int64 value of a BIGINT parameter
Parameters:
Name Type Description index
integer The index of the parameter starting from 1 Throws:
-
Throws an error if the index parameter is not valid or the SQL type of the queried parameter does not match.
Returns:
ctypes.Int64- Type
- ctypes.Int64
-
-
getBlob(index) → {ArrayBuffer}
-
Returns the ArrayBuffer value of a BLOB specified parameter
Parameters:
Name Type Description index
integer The index of the parameter starting from 1 Throws:
-
Throws an error if the index parameter is not valid or the SQL type of the queried parameter does not match.
Returns:
Blob representation- Type
- ArrayBuffer
-
-
getBString(index) → {ArrayBuffer}
-
Returns an ArrayBuffer object of the specified column. getBString is used for BINARY and VARBINARY column types.
Parameters:
Name Type Description index
integer The index of the parameter starting from 1 Throws:
-
Throws an error if the index parameter is not valid or the SQL type of the queried parameter does not match.
Returns:
value ArrayBuffer object- Type
- ArrayBuffer
-
-
getClob(index) → {string}
-
Returns the string value of a CLOB parameter
Parameters:
Name Type Description index
integer The index of the parameter starting from 1 Throws:
-
Throws an error if the index parameter is not valid or the SQL type of the queried parameter does not match.
Returns:
String representation- Type
- string
-
-
getDate(index) → {Date}
-
Used to retrieve the value of a DATE parameter
Parameters:
Name Type Description index
integer The index of the parameter, starting from 1 Throws:
-
Throws an error if the index parameter is not valid or the SQL type of the queried parameter does not match.
Returns:
A JavaScript date object representing the value- Type
- Date
-
-
getDecimal(index) → {number}
-
Returns a number value of a DECIMAL parameter
Parameters:
Name Type Description index
integer The index of the parameter starting from 1 Throws:
-
Throws an error if the index parameter is not valid or the SQL type of the queried parameter does not match.
Returns:
Number representation- Type
- number
-
-
getDouble(index) → {number}
-
Returns a number value of a DOUBLE, FLOAT or REAL parameter
Parameters:
Name Type Description index
integer The index of the parameter starting from 1 Throws:
-
Throws an error if the index parameter is not valid or the SQL type of the queried parameter does not match.
Returns:
Number representation- Type
- number
-
-
getFloat(columnIndex) → {number}
-
Returns a number value of the specified column. getFloat is used for FLOAT column types.
Parameters:
Name Type Description columnIndex
integer The target column starting from 1 Throws:
-
Throws an error if the index parameter is not valid.
Returns:
Number representation- Type
- number
-
-
getInteger(index) → {integer}
-
Returns an integer value of a TINYINT, SMALLINT, INT or BIGINT parameter types An exception will be thrown if the value is bigger than 9007199254740992 (2^53) or smaller than -9007199254740992 (-2^53).
Parameters:
Name Type Description index
integer The index of the parameter starting from 1 Throws:
-
Throws an error if the index parameter is not valid or the SQL type of the queried parameter does not match.
Returns:
Integer representation- Type
- integer
-
-
getMoreResults() → {boolean}
-
Checks if more result sets are available and prepares the next result set for retrieval
Throws:
-
Throws an error if the object the method is being called on is not valid.
Returns:
True if the next result set is available- Type
- boolean
-
-
getNClob(index) → {string}
-
Returns the string value of an NCLOB or TEXT parameter
Parameters:
Name Type Description index
integer The index of the parameter starting from 1 Throws:
-
Throws an error if the index parameter is not valid or the SQL type of the queried parameter does not match.
Returns:
String representation- Type
- string
-
-
getNString(index) → {string}
-
Returns the string value of an NCHAR, an NVARCHAR, or a SHORTTEXT parameter
Parameters:
Name Type Description index
integer The index of the parameter starting from 1 Throws:
-
Throws an error if the index parameter is not valid or the SQL type of the queried parameter does not match.
Returns:
String representation- Type
- string
-
-
getParameterMetaData() → {$.db.ParameterMetaData}
-
Returns the metadata for this statement
Throws:
-
Throws an error if the object the method is being called on is not valid.
Returns:
ParameterMetaData object -
-
getReal(columnIndex) → {number}
-
Returns a number value of the specified column. getReal is used for REAL column types.
Parameters:
Name Type Description columnIndex
integer The target column starting from 1 Throws:
-
Throws an error if the index parameter is not valid.
Returns:
Number representation- Type
- number
-
-
getResultSet() → {$.db.ResultSet}
-
Returns a result set representing a table output parameter
Throws:
-
Throws an error if the object the method is being called on is not valid.
Returns:
ResultSet of the next output table parameter- Type
- $.db.ResultSet
-
-
getSeconddate(index) → {Date}
-
Used to retrieve the value of a SECONDDATE parameter
Parameters:
Name Type Description index
integer The index of the parameter starting from 1 Throws:
-
Throws an error if the index parameter is not valid or the SQL type of the queried parameter does not match.
Returns:
A JavaScript date object representing the value- Type
- Date
-
-
getSQLWarning() → {Object|null}
-
Returns the warning of the most recently executed statement.
Throws:
Throws an error if the object the method is being called on is not valid.Returns:
The return value has two properties: 'code' and 'message'. 'null' is returned if the most recent statement didn't issue a warning.- Type
- Object | null
-
getString(index) → {string}
-
Returns a string value of a CHAR or VARCHAR parameter; ASCII only, not suitable for strings containing Unicode characters.
Parameters:
Name Type Description index
integer The index of the parameter starting from 1 Throws:
-
Throws an error if the index parameter is not valid or the SQL type of the queried parameter does not match.
Returns:
String representation- Type
- string
-
-
getText(index) → {string}
-
Returns the string value of a TEXT parameter
Parameters:
Name Type Description index
integer The index of the parameter starting from 1 Throws:
-
Throws an error if the index parameter is not valid or the SQL type of the queried parameter does not match.
Returns:
String representation- Type
- string
-
-
getTime(index) → {Date}
-
Used to retrieve the value of a TIME parameter
Parameters:
Name Type Description index
integer The index of the parameter starting from 1 Throws:
-
Throws an error if the index parameter is not valid or the SQL type of the queried parameter does not match.
Returns:
A JavaScript date object representing the value- Type
- Date
-
-
getTimestamp(index) → {Date}
-
Used to retrieve the value of a TIMESTAMP parameter.
As this type contains only time information and no date, the JavaScript's date object will always be 1 Jan 1970 plus the time offset.
For example: if the stored value is 10:00:00, the JavaScript date object will specify: 1 Jan 1970 10:00:00Parameters:
Name Type Description index
integer The index of the parameter starting from 1 Throws:
-
Throws an error if the index parameter is not valid or the SQL type of the queried parameter does not match.
Returns:
A JavaScript date object representing the value- Type
- Date
-
-
isClosed() → {boolean}
-
Checks if the statement is closed.
Throws:
-
Throws an error if the object the method is being called on is not valid.
Returns:
Returns true if the statement is already closed, false if not- Type
- boolean
-
-
setBigInt(index, value)
-
Sets an integer parameter used for BIGINT parameter types
Parameters:
Name Type Description index
integer The index of the parameter starting from 1 value
integer The number value to be set for this parameter Throws:
-
Throws an error on invalid parameters.
-
-
setBlob(index, value)
-
setBlob is used to specify the values for CHAR, VARCHAR, NCHAR, NVARCHAR, BINARY, VARBINARY parameter types.
Parameters:
Name Type Description index
integer The index of the parameter starting from 1 value
ArrayBuffer The ArrayBuffer object to be set for this parameter, can also be an array of integers or a string. Throws:
-
Throws an error on invalid parameters.
-
-
setBString(index, value)
-
Sets a string parameter used for BINARY, VARBINARY parameter types.
Remark: the BINARY type is deprecated - its behavior in row store and column store differs in that row store may pad with zeros.Parameters:
Name Type Description index
integer The index of the parameter starting from 1 value
ArrayBuffer The ArrayBuffer object to be set for this parameter. Throws:
-
Throws an error on invalid parameters.
-
-
setClob(index, value)
-
setClob is used to specify the values for CLOB parameter types.
Parameters:
Name Type Description index
integer The index of the parameter starting from 1 value
string The string value to be set for this parameter Throws:
-
Throws an error on invalid parameters.
-
-
setDate(index, value, format)
-
Sets a Date parameter for DATE parameters, but works with TIME and TIMESTAMP.
It is not possible to set the time with setDate; you can only set the dateParameters:
Name Type Argument Default Description index
integer The index of the parameter starting from 1 value
Date | string The date to be set for this parameter
The parameter can be a Date object, a string in default ptime format (YYYY-MM-DD), or a string in the optionally specified format.
For example: 'yyyymmdd' or 'yyyy-mm-dd' or 'yyyy/mm/dd'- Y,YY,YYY,YYYY-year
- D-day
- J-Julian day
- MONTH-by name,MON-abbr.
- M-month
- Q-quarter
- RM-Roman numeral month
- W-week of month
- WW-week of year.
Note that when you construct a new Date JavaScript object, the month number starts from 0 (not 1).
For example the following statement represents 1st of Jan, 2010:
new Date(2010,0,1);format
string <optional>
"" One of the following formats: Throws:
-
Throws an error on invalid parameters.
-
setDecimal(index, value)
-
setDecimal sets a decimal parameter used for DECIMAL parameter types
Parameters:
Name Type Description index
integer The index of the parameter starting from 1 value
number The number value to be set for this parameter Throws:
-
Throws an error on invalid parameters.
-
-
setDouble(index, value)
-
setDouble sets a double parameter used for FLOAT and DOUBLE parameter types
Parameters:
Name Type Description index
integer The index of the parameter starting from 1 value
number The number value to be set for this parameter Throws:
-
Throws an error on invalid parameters.
-
-
setFloat(index, value)
-
setFloat sets a float parameter used for FLOAT parameter types
Parameters:
Name Type Description index
integer The index of the parameter starting from 1 value
number The number value to be set for this parameter Throws:
-
Throws an error on invalid parameters.
-
-
setInteger(index, value)
-
Sets an integer parameter used for TINYINT, SMALLINT, INT parameter types
Parameters:
Name Type Description index
integer The index of the parameter starting from 1 value
integer The integer value to be set for this parameter Throws:
-
Throws an error on invalid parameters.
-
-
setNClob(index, value)
-
setNClob is used to specify the values for NCLOB parameter types.
Parameters:
Name Type Description index
integer The index of the parameter starting from 1 value
string The string value to be set for this parameter. Throws:
-
Throws an error on invalid parameters.
-
-
setNString(columnIndex, value)
-
Sets a string parameter used for NCHAR, NVARCHAR parameter types, which should be used for strings containing Unicode characters.
This function converts the given Unicode string into a storable format. Make sure you use getNString to read the data. If you use getString on a column you wrote with setNString, an exception is thrown if the string contains Unicode characters larger than 0xFFFF.Parameters:
Name Type Description columnIndex
integer The index of the parameter starting from 1 value
string The string value to be set for this parameter Throws:
-
Throws an error on invalid parameters.
-
-
setNull(index)
-
Sets a null parameter used for all parameter types
Parameters:
Name Type Description index
integer The index of the parameter starting from 1 Throws:
-
Throws an error on invalid parameters.
-
-
setReal(index, value)
-
setReal sets a real parameter used for REAL parameter types
Parameters:
Name Type Description index
integer The index of the parameter starting from 1 value
number The number value to be set for this parameter Throws:
-
Throws an error on invalid parameters.
-
-
setSmallInt(index, value)
-
Sets an integer parameter used for SMALLINT parameter types
Parameters:
Name Type Description index
integer The index of the parameter starting from 1 value
integer The integer value to be set for this parameter Throws:
-
Throws an error on invalid parameters.
-
-
setString(columnIndex, value)
-
Sets a string parameter used for CHAR, VARCHAR column types; ASCII only, not suitable for strings containing Unicode characters
This function can be used to store strings containing ASCII and a subset of Unicode (namely BMP; the first 0xFFFF characters).
This function does not convert data; to improve performance, it stores data directly in the database.
Note that special characters (in Unicode SMP or SIP) can cause the read operation to fail. For more information see Plane (Unicode).
If also need special Unicode characters or if you are not sure what this means it is safer to use setNString.Parameters:
Name Type Description columnIndex
integer The index of the parameter in the statement starting from 1 value
string The string value to be set for this parameter Throws:
-
Throws an error on invalid parameters.
-
-
setText(columnIndex, value)
-
setText is used to specify the values for TEXT column types.
Parameters:
Name Type Description columnIndex
integer The index of the parameter in the prepared statement starting from 1 value
string The string value to be set for this parameter Throws:
-
Throws an error on invalid parameters.
-
-
setTime(index, value, format)
-
Sets a Time parameter used for TIME parameter types (hour, min, sec) - milliseconds(mls) cannot be set
Parameters:
Name Type Argument Default Description index
integer The index of the parameter, starting from 1 value
Date | string The Date value to be set for this parameter - HH:MI:SS.FF AM
- HH24:MI:SS.FF
- HH:MI:SS AM
- HH24:MI:SS
- HH:MI AM
- HH24:MI
- HH24:MI:SS.FF Z
- HH24:MI:SS Z
format
string <optional>
"" One of the following formats: Throws:
-
Throws an error on invalid parameters.
-
setTimestamp(index, value, format)
-
Sets a Timestamp parameter used for TIMESTAMP parameter types
Parameters:
Name Type Argument Default Description index
integer The index of the parameter starting from 1 value
Date | string The timestamp value to be set for this parameter The default format is: date separator time, for example,
2001-01-02 01:02:03.123, where date is the format to use for the date value
(see setDate), separator can be a space, a comma, or the letter T, and
time is the format to use for the time value (see setTime).
Examples:
2001-01-02 01:02:03.123
2001-01-02,01:02:03.123
2001-01-02T01:02:03.123
st.setTimestamp(4,"01.02.2003 01:02:03.123", "DD.MM.YYYY HH:MI:SS.FF");format
string <optional>
"" Optional, see also setDate and setTime. Throws:
-
Throws an error on invalid parameters.
-
-
setTinyInt(index, value)
-
Sets an integer parameter used for TINYINT parameter types
Parameters:
Name Type Description index
integer The index of the parameter, starting from 1 value
integer The integer value to be set for this parameter (unsigned char: min 0, max 255) Throws:
-
Throws an error on invalid parameters.
-