TIBCO ActiveSpaces®
Functions
statement.h File Reference

A statment object is used execute SQL and return a resultset. More...

Functions

TIBDG_API void tibdgStatement_ClearParameters (tibEx e, tibdgStatement statement)
 Clears all of the parameter values set on the statement object. More...
 
TIBDG_API void tibdgStatement_Close (tibEx e, tibdgStatement statement)
 Close the statement object. More...
 
TIBDG_API tibdgResultSet tibdgStatement_ExecuteQuery (tibEx e, tibdgStatement statement, tibProperties props)
 Executes the query on the statement object and returns the resultset object. More...
 
TIBDG_API tibdgResultSetMetadata tibdgStatement_GetResultSetMetadata (tibEx e, tibdgStatement statement)
 Get the metadata associated with a statement. More...
 
TIBDG_API void tibdgStatement_SetDateTime (tibEx e, tibdgStatement statement, tibint32_t parameterIndex, const tibDateTime *dt)
 Sets a datetime value to a parameter number in a statement object. More...
 
TIBDG_API void tibdgStatement_SetDouble (tibEx e, tibdgStatement statement, tibint32_t parameterIndex, tibdouble_t dvalue)
 Sets a double value to a parameter number in a statement object. More...
 
TIBDG_API void tibdgStatement_SetLong (tibEx e, tibdgStatement statement, tibint32_t parameterIndex, tibint64_t lvalue)
 Sets a long value to a parameter number in a statement object. More...
 
TIBDG_API void tibdgStatement_SetNull (tibEx e, tibdgStatement statement, tibint32_t parameterIndex)
 Sets an empty value for a parameter number in a statement object. More...
 
TIBDG_API void tibdgStatement_SetOpaque (tibEx e, tibdgStatement statement, tibint32_t parameterIndex, const void *ovalue, tibint32_t size)
 Sets an opaque value to a parameter number in a statement object. More...
 
TIBDG_API void tibdgStatement_SetString (tibEx e, tibdgStatement statement, tibint32_t parameterIndex, const char *svalue)
 Sets a string value to a parameter number in a statement object. More...
 

Detailed Description

A statment object is used execute SQL and return a resultset.

A program that creates a statement object must explicitly call tibdgStatement_Close to reclaim its resources.

Function Documentation

TIBDG_API void tibdgStatement_ClearParameters ( tibEx  e,
tibdgStatement  statement 
)

Clears all of the parameter values set on the statement object.

After calling this function, all parameters must be set again before calling ExecuteQuery. A partially bound statement object may be closed without calling this function.

Parameters
eThe exception object captures information about failures.
statementThe statement to clear bindings
Returns
void
TIBDG_API void tibdgStatement_Close ( tibEx  e,
tibdgStatement  statement 
)

Close the statement object.

Note that all resultset objects must also be closed to allow for the statement's resources to also be reclaimed.

Parameters
eThe exception object captures information about failures.
statementThe statement to be closed.
Returns
void
TIBDG_API tibdgResultSet tibdgStatement_ExecuteQuery ( tibEx  e,
tibdgStatement  statement,
tibProperties  props 
)

Executes the query on the statement object and returns the resultset object.

Cannot be called if there are any open resultsets on the statement object.

Parameters
eThe exception object captures information about failures.
statementThe statement from which to execute the query.
propsOptional. NULL to omit.
Returns
tibdgResultSet
TIBDG_API tibdgResultSetMetadata tibdgStatement_GetResultSetMetadata ( tibEx  e,
tibdgStatement  statement 
)

Get the metadata associated with a statement.

Parameters
eThe exception object captures information about failures.
statementThe statement to get metadata
Returns
On success, this call returns the resultset Metadata
On failure, this call returns NULL.
TIBDG_API void tibdgStatement_SetDateTime ( tibEx  e,
tibdgStatement  statement,
tibint32_t  parameterIndex,
const tibDateTime *  dt 
)

Sets a datetime value to a parameter number in a statement object.

Copies the datetime parameter so that the program is allowed to free or modify it after the function returns.

Note that parameter numbers start from 1. Setting the same parameter number multiple times is allowed, even with different types, as long as when ExecuteQuery is called all parameters are set and have the correct types.

Parameters
eThe exception object captures information about failures.
statementThe statement from which to bind the value.
parameterIndexThe parameter number to set.
dtThe datetime value to set into the statement.
Returns
void
TIBDG_API void tibdgStatement_SetDouble ( tibEx  e,
tibdgStatement  statement,
tibint32_t  parameterIndex,
tibdouble_t  dvalue 
)

Sets a double value to a parameter number in a statement object.

Note that parameter numbers start from 1. Setting the same parameter number multiple times is allowed, even with different types, as long as when ExecuteQuery is called all parameters are set and have the correct types.

Parameters
eThe exception object captures information about failures.
statementThe statement from which to bind the value.
parameterIndexThe parameter number to set.
dvalueThe double value to set into the statement.
Returns
void
TIBDG_API void tibdgStatement_SetLong ( tibEx  e,
tibdgStatement  statement,
tibint32_t  parameterIndex,
tibint64_t  lvalue 
)

Sets a long value to a parameter number in a statement object.

Note that parameter numbers start from 1. Setting the same parameter number multiple times is allowed, even with different types, as long as when ExecuteQuery is called all parameters are set and have the correct types.

Parameters
eThe exception object captures information about failures.
statementThe statement from which to bind the value.
parameterIndexThe parameter number to set.
lvalueThe long value to set into the statement.
Returns
void
TIBDG_API void tibdgStatement_SetNull ( tibEx  e,
tibdgStatement  statement,
tibint32_t  parameterIndex 
)

Sets an empty value for a parameter number in a statement object.

Note that parameter numbers start from 1. Setting the same parameter number multiple times is allowed, even with different types, as long as when ExecuteQuery is called all parameters are set and have the correct types.

Parameters
eThe exception object captures information about failures.
statementThe statement containing the parameter.
parameterIndexThe parameter number to set.
Returns
void
TIBDG_API void tibdgStatement_SetOpaque ( tibEx  e,
tibdgStatement  statement,
tibint32_t  parameterIndex,
const void *  ovalue,
tibint32_t  size 
)

Sets an opaque value to a parameter number in a statement object.

Copies the opaque parameter so that the program is allowed to free or modify it after the function returns.

Note that parameter numbers start from 1. Setting the same parameter number multiple times is allowed, even with different types, as long as when ExecuteQuery is called all parameters are set and have the correct types.

Parameters
eThe exception object captures information about failures.
statementThe statement from which to bind the value.
parameterIndexThe parameter number to set.
ovalueThe opaque value to set into the statement.
sizeThe size of the opaque in bytes.
Returns
void
TIBDG_API void tibdgStatement_SetString ( tibEx  e,
tibdgStatement  statement,
tibint32_t  parameterIndex,
const char *  svalue 
)

Sets a string value to a parameter number in a statement object.

Copies the string parameter so that the program is allowed to free or modify it after the function returns.

Note that parameter numbers start from 1. Setting the same parameter number multiple times is allowed, even with different types, as long as when ExecuteQuery is called all parameters are set and have the correct types.

Parameters
eThe exception object captures information about failures.
statementThe statement from which to bind the value.
parameterIndexThe parameter number to set.
svalueThe string value to set into the statement.
Returns
void