Oracle® C++ Call Interface Programmer's Guide 10g Release 1 (10.1) Part Number B10778-01 |
|
|
View PDF |
A Statement
object is used for executing SQL statements. The statement may be a query returning result set, or a non-query statement returning an update count. Non-query SQL can be insert, update, or delete statements. Non-query SQL statements can also be DML statements (such as create, grant, and so on) or stored procedure calls.
A query, insert / update / delete, or stored procedure call statements may have IN
bind parameters. A DML returning insert / update / delete statement or stored procedure call may have OUT
bind parameters. Finally, a stored procedure call statement may have bind parameters that are both IN
and OUT
, referred to as IN
/OUT
parameters.
The Statement
class methods are divided into three categories:
Statement
methods applicable to all statements
Methods applicable to prepared statements with IN
bind parameters
Methods applicable to callable statements and DML returning statements with OUT
bind parameters.
Table 10-37 Constants of the Statement Class
Constant | Description |
---|---|
NEEDS_STREAM_DATA |
Output Streams must be written for the streamed IN bind parameters. If there is more than one streamed parameter, call the getCurrentStreamParam() method to find out the bind parameter needing the stream. If the statement is executed iteratively, call getCurrentIteration() to find the iteration for which stream needs to be written. |
PREPARED |
The Statement object is set to a query. |
RESULT_SET_AVAILABLE |
The getResultSet() method must be called to get the result set. |
STREAM_DATA_AVAILABLE |
Input Streams must be read for the streamed OUT bind parameters. If there is more than one streamed parameter, call the getCurrentStreamParam() method to find out the bind parameter needing the stream. If the statement is executed iteratively, call getCurrentIteration() to find the iteration for which stream needs to be read |
UNPREPARED |
The Statement object is not set to a query. |
UPDATE_COUNT_AVAILABLE |
The getUpdateCount() method must be called to find out the update count |
Table 10-38 Summary of Statement Methods
Method | Description |
---|---|
addIteration() |
Add an iteration for execution. |
closeResultSet() |
Immediately releases a result set's database and OCCI resources instead of waiting for automatic release. |
closeStream() |
Close the stream specified by the parameter stream . |
disableCaching() |
Disables statement caching. |
execute() |
Execute the SQL statement. |
executeArrayUpdate() |
Execute insert/update/delete statements which use only the setDataBuffer() or stream interface for bind parameters. |
executeQuery() |
Execute a SQL statement that returns a single ResultSet . |
executeUpdate() |
Execute a SQL statement that does not return a ResultSet . |
getAutoCommit() |
Return the current auto-commit state. |
getBfile() |
Return the value of a BFILE as a Bfile object. |
getBlob() |
Return the value of a BLOB as a Blob object. |
getBytes() |
Return the value of a SQL BINARY or VARBINARY parameter as Bytes . |
getCharSet() |
Return the character set that is in effect for the specified parameter. |
getClob() |
Return the value of a CLOB as a Clob object. |
getConnection() |
Returns the connection from which the Statement object was instantiated. |
getCurrentIteration() |
Return the iteration number of the current iteration that is being processed. |
getCurrentStreamIteration() |
Return the current iteration for which stream data is to be read or written. |
getCurrentStreamParam() |
Return the parameter index of the current output Stream that must be read or written. |
getCursor() |
Return the REF CURSOR value of an OUT parameter as a ResultSet . |
getDatabaseNCHARParam() |
Return whether data is in NCHAR character set. |
getDate() |
Return the value of a parameter as a Date object |
getBDouble() |
Return the value of a parameter as an IEEE754 double. |
getDouble() |
Return the value of a parameter as a C++ double. |
getBFloat() |
Return the value of a parameter as an IEEE754 float. |
getFloat() |
Return the value of a parameter as a C++ float. |
getInt() |
Return the value of a parameter as a C++ int. |
getIntervalDS() |
Return the value of a parameter as a IntervalDS object. |
getIntervalYM() |
Return the value of a parameter as a IntervalYM object. |
getMaxIterations() |
Return the current limit on maximum number of iterations. |
getMaxParamSize() |
Return the current max parameter size limit. |
getNumber() |
Return the value of a parameter as a Number object. |
getObject() |
Return the value of a parameter as a PObject . |
getOCIStatement() |
Return the OCI statement handle associated with the Statement . |
getRef() |
Return the value of a REF parameter as RefAny |
getResultSet() |
Return the current result as a ResultSet . |
getRowid() |
Return the row id parameter value as a Bytes object. |
getSQL() |
Return the current SQL string associated with the Statement object. |
getSQLUString() |
Return the current SQL string associated with the Statement object; globalization enabled. |
getStream() |
Return the value of the parameter as a stream. |
getString() |
Return the value of the parameter as a string. |
getTimestamp() |
Return the value of the parameter as a Timestamp object |
getUInt() |
Return the value of the parameter as a C++ unsigned int |
getUpdateCount() |
Return the current result as an update count for non-query statements. |
getUString() |
Return the value of a UString . |
getVector() |
Return the specified parameter as a vector. |
getVectorOfRefs() |
Returns the column in the current position as a vector of REF s. |
isNull() |
Check whether the parameter is NULL . |
isTruncated() |
Check whether the value is truncated. |
preTruncationLength() |
Returns the actual length of the parameter before truncation. |
registerOutParam() |
Register the type and max size of the OUT parameter. |
setAutoCommit() |
Specify auto commit mode. |
setBfile() |
Set a parameter to a Bfile value. |
setBinaryStreamMode() |
Specify that a column is to be returned as a binary stream. |
setBlob() |
Set a parameter to a Blob value. |
setBytes() |
Set a parameter to a Bytes array. |
setCharacterStreamMode() |
Specify that a column is to be returned as a character stream. |
setCharSet() |
Specify the character set for the specified parameter. |
setClob() |
Set a parameter to a Clob value. |
setDate() |
Set a parameter to a Date value. |
setDatabaseNCHARParam() |
Set to true if the data is to be in the NCHAR character set of the database; set to false to restore the default. |
setDataBuffer() |
Specify a data buffer where data would be available for reading or writing. |
setDataBufferArray() |
Specify an array of data buffers where data would be available for reading or writing. |
setBDouble() |
Set a parameter to an IEEE double value. |
setDouble() |
Set a parameter to a C++ double value. |
setErrorOnNull() |
Enable/disable exceptions for reading of NULL values. |
setErrorOnTruncate() |
Enable/disable exception when truncation occurs. |
setBFloat() |
Set a parameter to an IEEE float value. |
setFloat() |
Set a parameter to a C++ float value. |
setInt() |
Set a parameter to a C++ int value. |
setIntervalDS() |
Set a parameter to a IntervalDS value. |
setIntervalYM() |
Set a parameter to a IntervalYM value. |
setMaxIterations() |
Set the maximum number of invocations that will be made for the DML statement. |
setMaxParamSize() |
Set the maximum amount of data that can sent or returned from the parameter. |
setNull() |
Set a parameter to SQL NULL . |
setNumber() |
Set a parameter to a Number value. |
setObject() |
Set the value of a parameter using an object. |
setPrefetchMemorySize() |
Set the amount of memory that will be used internally by OCCI to store data fetched during each round trip to the server. |
setPrefetchRowCount() |
Set the number of rows that will be fetched internally by OCCI during each round trip to the server. |
setRowid() |
Set a row id bytes array for a bind position. |
setSQL() |
Associate new SQL string with Statement object. |
setSQLUString() |
Associate new SQL string with Statement object; globalization enabled. |
setString() |
Set a parameter for a specified index. |
setTimestamp() |
Set a parameter to a Timestamp value. |
setUInt() |
Set a parameter to a C++ unsigned int value. |
setUString() |
Set a parameter for a specified index; globalization enabled. |
setVector() |
Set a parameter to a vector of unsigned int. |
setVectorOfRefs() |
Sets a parameter to a vector; should be used when the type is a collection of REF s. |
status() |
Return the current status of the statement. This is useful when there is streamed data to be written. |
After specifying set parameters, an iteration is added for execution.
void addIteration();
In many cases, it is desirable to immediately release a result set's database and OCCI resources instead of waiting for this to happen when it is automatically closed; the closeResultSet() method provides this immediate release.
void closeResultSet( ResultSet *resultSet);
Parameter | Description |
---|---|
resultSet |
The resultset to be closed. The resultset should have been obtained by a call to the getResultSet() method on this statement. |
Closes the stream specified by the parameter stream
.
void closeStream( Stream *stream);
Parameter | Description |
---|---|
stream |
The stream to ne closed. |
Disables statement caching. Used if a user wishes to destroy a statement instead of caching it. Effective only if statement caching is enabled.
void disableCaching();
Executes an SQL statement that may return either a result set or an update count. The statement may have read-able streams which may have to be written, in which case the results of the execution may not be readily available. The returned value is one of the following defined constants of the Statement
class (see Table 10-37): PREPARED
, UNPREPARED
, RESULT_SET_AVAILABLE
, UPDATE_COUNT_AVAILABLE
, NEEDS_STREAM_DATA
, and STREAM_DATA_AVAILABLE
.
If only one OUT
value is returned for each invocation of the DML returning statement, iterative executes can be performed for DML returning statements. If output streams are used for OUT
bind variables, they must be completely read in order. The getCurrentStreamParam() method would indicate which stream needs to be read. Similarly, getCurrentIteration() would indicate the iteration for which data is available.
Syntax | Description |
---|---|
Status execute( const string &sql=""); |
Executes the SQL Statement. |
Status execute( const UString &sql); |
Executes the SQL Statement; globalization enabled. |
Parameter | Description |
---|---|
sql |
The SQL statement to be executed. This can be NULL if the executeArrayUpdate() method was used to associate the sql with the statement. |
Executes insert/update/delete statements which use only the setDataBuffer() or stream interface for bind parameters. The bind parameters must be arrays of size arrayLength parameter. The statement may have read-able streams which may have to be written. The returned value is one of the following, and are defined as constants of the Statement
class in Table 10-37: PREPARED
, UNPREPARED
, UPDATE_COUNT_AVAILABLE
, NEEDS_STREAM_DATA
, and STREAM_DATA_AVAILABLE
The returned value is one of the following:
If only one OUT
value is returned for each invocation of the DML returning statement, array executes can be done for DML returning statements also. If output streams are used for OUT
bind variables, they must be completely read in order. The getCurrentStreamParam() method would indicate which stream needs to be read. Similarly, getCurrentIteration() would indicate the iteration for which data is available.
Note: You cannot perform array executes for queries or callable statements |
Status executeArrayUpdate( unsigned int arrayLength);
Parameter | Description |
---|---|
arrayLength |
The number of elements provided in each buffer of bind variables. |
Execute a SQL statement that returns a ResultSet
. Should not be called for a statement which is not a query, has streamed parameters. Returns a ResultSet
that contains the data produced by the query.
Syntax | Description |
---|---|
ResultSet* executeQuery( const string &sql=""); |
Executes the SQL Statement that returns a ResultSet . |
ResultSet* executeQuery( const UString &sql); |
Executes the SQL Statement that returns a ResultSet; globalization enabled. |
Parameter | Description |
---|---|
sql |
The SQL statement to be executed. This can be NULL if the executeArrayUpdate() method was used to associate the sql with the statement. |
Executes a non-query statement such as a SQL INSERT
, UPDATE
, DELETE
statement, a DDL statement such as CREATE
/ALTER
and so on, or a stored procedure call. Returns either the row count for INSERT
, UPDATE
or DELETE
or 0
for SQL statements that return nothing.
Syntax | Description |
---|---|
unsigned int executeUpdate( const string &sql=""); |
Executes a non-query statement. |
unsigned int executeUpdate( const UString &sql); |
Executes a non-query statement; globalization enabled. |
Parameter | Description |
---|---|
sql |
The SQL statement to be executed. This can be NULL if the executeArrayUpdate() method was used to associate the sql with the statement. |
Returns the current auto-commit state.
bool getAutoCommit() const;
Returns the value of a BFILE
parameter as a Bfile
object.
Bfile getBfile( unsigned int paramIndex);
Parameter | Description |
---|---|
paramIndex |
Parameter index; first parameter is 1, second is 2,... |
Returns the value of a BLOB
parameter as a Blob
.
Blob getBlob( unsigned int paramIndex);
Parameter | Description |
---|---|
paramIndex |
Parameter index; first parameter is 1, second is 2,... |
Returns the value of n SQL BINARY
or VARBINARY
parameter as Bytes
; if the value is SQL NULL
, the result is NULL
.
Bytes getBytes( unsigned int paramIndex);
Parameter | Description |
---|---|
paramIndex |
Parameter index; first parameter is 1, second is 2,... |
Returns the character set that is in effect for the specified parameter, as a string.
string getCharSet( unsigned int paramIndex) const;
Parameter | Description |
---|---|
paramIndex |
Parameter index; first parameter is 1, second is 2,... |
Get the value of a CLOB
parameter as a Clob
. Returns the parameter value.
Clob getClob( unsigned int paramIndex);
Parameter | Description |
---|---|
paramIndex |
Parameter index; first parameter is 1, second is 2,... |
Returns the connection from which the Statement
object was instantiated.
const Connection* getConnection() const;
If the prepared statement has any output Streams
, this method returns the current iteration of the statement that is being processed by OCCI. If this method is called after all the invocations in the set of iterations has been processed, it returns 0
. Returns the iteration number of the current iteration that is being processed. The first iteration is numbered 1
and so on. If the statement has finished execution, a 0
is returned.
unsigned int getCurrentIteration() const;
Returns the current parameter stream for which data is available.
unsigned int getCurrentStreamIteration() const;
Returns the parameter index of the current output Stream
parameter that must be written. If the prepared statement has any output Stream
parameters, this method returns the parameter index of the current output Stream
that must be written. If no output Stream
needs to be written, or there are no output Stream
parameters in the prepared statement, this method returns 0
.
unsigned int getCurrentStreamParam() const;
Gets the REF
CURSOR
value of an OUT
parameter as a ResultSet
. Data can be fetched from this result set. The OUT
parameter must be registered as CURSOR
with the registerOutParam() method. Returns a ResultSet
for the OUT
parameter value.
Note: If there are multipleREF CURSORs being returned due to a batched call, data from each cursor must be completely fetched before retrieving the next REF CURSOR and starting fetch on it. |
ResultSet * getCursor( unsigned int paramIndex);
Parameter | Description |
---|---|
paramIndex |
Parameter index; first parameter is 1, second is 2,... |
Returns whether data is in NCHAR
character set or not.
bool getDatabaseNCHARParam( unsigned int paramIndex) const;
Parameter | Description |
---|---|
paramIndex |
Parameter index; first parameter is 1, second is 2,... |
Get the value of a SQL DATE
parameter as a Date
object. Returns the parameter value; if the value is SQL NULL
, the result is NULL
.
Date getDate( unsigned int paramIndex) const;
Parameter | Description |
---|---|
paramIndex |
Parameter index; first parameter is 1, second is 2,... |
Gets the value of an IEEE754 DOUBLE
column, which has been defined as an OUT
bind. If the value is SQL NULL
, the result is 0
.
BDouble getBDouble( unsigned int paramIndex) = 0;
Parameter | Description |
---|---|
paramIndex |
Parameter index; first parameter is 1, second is 2,... |
Get the value of a DOUBLE
parameter as a C++ double
. Returns the parameter value; if the value is SQL NULL
, the result is 0.
double getDouble( unsigned int paramIndex);
Parameter | Description |
---|---|
paramIndex |
Parameter index; first parameter is 1, second is 2,... |
Gets the value of an IEEE754 FLOAT
column, which has been defined as an OUT
bind. If the value is SQL NULL
, the result is 0
.
BFloat getBFloat( unsigned int paramIndex) = 0;
Parameter | Description |
---|---|
paramIndex |
Parameter index; first parameter is 1, second is 2,... |
Get the value of a FLOAT
parameter as a C++ float
. Returns the parameter value; if the value is SQL NULL
, the result is 0
.
float getFloat( unsigned int paramIndex);
Parameter | Description |
---|---|
paramIndex |
Parameter index; first parameter is 1, second is 2,... |
Get the value of an INTEGER
parameter as a C++ int. Returns the parameter value; if the value is SQL NULL
, the result is 0
.
unsigned int getInt( unsigned int paramIndex);
Parameter | Description |
---|---|
paramIndex |
Parameter index; first parameter is 1, second is 2,... |
Get the value of a parameter as a IntervalDS
object.
IntervalDS getIntervalDS( unsigned int paramIndex);
Parameter | Description |
---|---|
paramIndex |
Parameter index; first parameter is 1, second is 2,... |
Get the value of a parameter as a IntervalYM
object.
IntervalYM getIntervalYM( unsigned int paramIndex);
Parameter | Description |
---|---|
paramIndex |
Parameter index; first parameter is 1, second is 2,... |
Gets the current limit on maximum number of iterations. Default is 1
. Returns the current maximum number of iterations.
unsigned int getMaxIterations() const;
The maxParamSize
limit (in bytes) is the maximum amount of data sent or returned for any parameter value; it only applies to character and binary types. If the limit is exceeded, the excess data is silently discarded. Returns the current max
parameter size limit.
unsigned int getMaxParamSize( unsigned int paramIndex) const;
Parameter | Description |
---|---|
paramIndex |
Parameter index; first parameter is 1, second is 2,... |
Get the value of a NUMERIC
parameter as a Number
object. Returns the parameter value; if the value is SQL NULL
, the result is NULL
.
Number getNumber( unsigned int paramIndex);
Parameter | Description |
---|---|
paramIndex |
Parameter index; first parameter is 1, second is 2,... |
Get the value of a parameter as a PObject
. This method returns an PObject
whose type corresponds to the SQL type that was registered for this parameter using registerOutParam(). Returns A PObject
holding the OUT
parameter value.
Note: This method may be used to read database-specific, abstract data types. |
Syntax | Description |
---|---|
PObject * getObject( unsigned int paramIndex); |
Get the value of a parameter as a PObject . |
PObject * getObject( unsigned int paramIndex const UString &sqltyp); |
Get the value of a parameter as a PObject ; globalization enabled. |
Parameter | Description |
---|---|
paramIndex |
Parameter index; first parameter is 1, second is 2,... |
sqltyp |
SQL Type name of the object. |
Get the OCI statement handle associated with the Statement
.
LNOCIStmt * getOCIStatement() const;
Get the value of a REF
parameter as RefAny
. Returns the parameter value.
RefAny getRef( unsigned int paramIndex);
Parameter | Description |
---|---|
paramIndex |
Parameter index; first parameter is 1, second is 2,... |
Returns the current result as a ResultSet
.
ResultSet * getResultSet();
Get the rowid
parameter value as a Bytes
.
Bytes getRowid( unsigned int paramIndex);
Parameter | Description |
---|---|
paramIndex |
Parameter index; first parameter is 1, second is 2,... |
Returns the current SQL string associated with the Statement object.
string getSQL() const;
Returns the current SQL UString
associated with the Statement object; globalization enabled.
UString getSQLUString() const;
Returns the value of the parameter as a stream.
Stream * getStream( unsigned int paramIndex);
Parameter | Description |
---|---|
paramIndex |
Parameter index; first parameter is 1, second is 2,... |
Get the value of a CHAR
, VARCHAR
, or LONGVARCHAR
parameter as an string. Returns the parameter value; if the value is SQL NULL
, the result is empty string.
string getString( unsigned int paramIndex);
Parameter | Description |
---|---|
paramIndex |
Parameter index; first parameter is 1, second is 2,... |
Get the value of a SQL TIMESTAMP
parameter as a Timestamp
object. Returns the parameter value; if the value is SQL NULL
, the result is NULL
Timestamp getTimestamp( unsigned int paramIndex);
Parameter | Description |
---|---|
paramIndex |
Parameter index; first parameter is 1, second is 2,... |
Get the value of a BIGINT
parameter as a C++ unsigned int. Returns the parameter value; if the value is SQL NULL
, the result is 0
.
unsigned int getUInt( unsigned int paramIndex);
Parameter | Description |
---|---|
paramIndex |
Parameter index; first parameter is 1, second is 2,... |
Returns the current result as an update count.
unsigned int getUpdateCount() const;
Return the value as a UString.
Note: This method should be called only if the environment's character set is UTF16, or ifsetCharset() method has been called to explicitly retrieve UTF16 data. |
UString getUString( unsigned int paramIndex);
Parameter | Description |
---|---|
paramIndex |
Parameter index; first parameter is 1, second is 2,... |
Returns the column in the current position as a vector. The column at the position, specified by index, should be a collection type (varray
or nested table). The SQL type of the elements in the collection should be compatible with the type of the vector.
Syntax | Description |
---|---|
void getVector( Statement *stmt, unsigned int paramIndex, std::vector<UString> &vect); |
Used for vectors of UString Class ; globalization enabled. |
void getVector( Statement *stmt, unsigned int paramIndex, vector<BDouble> &vect); |
Used for BDouble vectors. |
void getVector( Statement *stmt, unsigned int paramIndex, vector<BFile> &vect); |
Used for vectors of BfileClass. |
void getVector( Statement *stmt, unsigned int paramIndex, vector<BFloat> &vect); |
Used for BFloat vectors. |
void getVector( Statement *stmt, unsigned int paramIndex, vector<Blob> &vect); |
Used for vectors of Blob Class. |
void getVector( Statement *stmt, unsigned int paramIndex, vector<Clob> &vect); |
Used for Clob vectors. |
void getVector( Statement *stmt, unsigned int paramIndex, vector<Date> &vect); |
Used for vectors of Date Class. |
void getVector( Statement *stmt, unsigned int paramIndex, vector<double> &vect); |
Used for vectors of double Class. |
void getVector( Statement *stmt, unsigned int paramIndex, vector<float> &vect); |
Used for vectors of float Class. |
void getVector( Statement *stmt, unsigned int paramIndex, vector<int> &vect); |
Used for vectors of int Class. |
void getVector( Statement *stmt, unsigned int paramIndex, vector<IntervalDS> &vect); |
Used for vectors of IntervalDSClass. |
void getVector( Statement *stmt, unsigned int paramIndex, vector<IntervalYM> &vect); |
Used for vectors of IntervalYM Class. |
void getVector( Statement *stmt, unsigned int paramIndex, vector<Number> &vect); |
Used for vectors of Number Class. |
void getVector( Statement *stmt, unsigned int paramIndex, vector<RefAny> &vect); |
Used for vectors of RefAnyClass. |
void getVector( Statement *stmt, unsigned int paramIndex, vector<string> &vect); |
Used for vectors of string Class. |
void getVector( Statement *stmt, unsigned int paramIndex, vector<T *> &vect); |
Intended for use on platforms where partial ordering of function templates is supported. |
void getVector( Statement *stmt, unsigned int paramIndex, vector<T> &vect); |
Intended for use on platforms where partial ordering of function templates is not supported, such as Windows NT. For OUT binds and DML returning statements. |
void getVector( Statement *stmt, unsigned int paramIndex, vector<Timestamp> &vect); |
Used for vectors of Timestamp Class. |
void getVector( Statement *stmt, unsigned int paramIndex, vector<u <Ref<T> > &vect); |
Available only on platforms where partial ordering of function templates is supported. |
void getVector( Statement *stmt, unsigned int paramIndex, vector<unsigned int> &vect); |
Used for on vectors of unsigned int Class. |
Parameter | Description |
---|---|
stmt |
The statement. |
paramIndex |
Parameter index. |
vect |
Reference to the vector (OUT parameter) into which the values should be retrieved. |
This method returns the column in the current position as a vector of REFs. The column should be a collection type (varray or nested table) of REFs. Used with OUT
binds and DML returning clauses.
void getVectorOfRefs( Statement *stmt, unsigned int colIndex, vector< Ref<T> > &vect);
Parameter | Description |
---|---|
stmt |
The statement object. |
colIndex |
Column index; first column is 1, second is 2,... |
vect |
The reference to the vector of REF s (OUT parameter). It is recommended to use getVectorOfRefs() instead of specialized getVector() function for Ref<T>. |
An OUT
parameter may have the value of SQL NULL
; wasNull()
reports whether the last value read has this special value. Note that you must first call ge
txxx
()
on a parameter to read its value and then call wasNull()
to see if the value was SQL NULL
. Returns TRUE
if the last parameter read was SQL NULL
.
bool isNull( unsigned int paramIndex ) const;
Parameter | Description |
---|---|
paramIndex |
Parameter index; first parameter is 1, second is 2,... |
This method checks whether the value of the parameter is truncated. If the value of the parameter is truncated, then TRUE
is returned; otherwise, FALSE
is returned.
bool isTruncated( unsigned int paramIndex) const;
Parameter | Description |
---|---|
paramIndex |
Parameter index; first parameter is 1, second is 2,... |
Returns the actual length of the parameter before truncation.
int preTruncationLength( unsigned int paramIndex) const;
Parameter | Description |
---|---|
paramIndex |
Parameter index; first parameter is 1, second is 2,... |
This method registers the type
of each out
parameter of a PL/SQL stored procedure. Before executing a PL/SQL stored procedure, you must explicitly call this method to register the type
of each out
parameter. This method should be called for out
parameters only. Use the set
xxx
()
method for in/out parameters.
When reading the value of an out
parameter, you must use the get
xxx
()
method that corresponds to the parameter's registered SQL type. For example, use getInt
or getNumber
when OCCIINT
or OCCINumber
is the type specified.
If a PL/SQL stored procedure has an out
parameter of type
ROWID
, the type
specified in this method should be OCCISTRING
. The value of the out
parameter can then be retrieved by calling the getString()
method.
If a PL/SQL stored procedure has an in/out parameter of type ROWID
, call the methods setString()
and getString()
to set the type and retrieve the value of the IN
/OUT
parameter.
Syntax | Description |
---|---|
void registerOutParam( unsigned int paramIndex, Type type, unsigned int maxSize=0, const string &sqltype=""); |
Register the type of each out parameter of a PL/SQL stored procedure. |
void registerOutParam( unsigned int paramIndex, Type type, unsigned int maxSize=0, const UString &schName, const UString &sqltype); |
Register the type of each out parameter of a PL/SQL stored procedure; globalization enabled. |
Parameter | Description |
---|---|
paramIndex |
Parameter index; first parameter is 1, second is 2,... |
type |
SQL type code defined by type ; only datatypes corresponding to OCCI data types such as Date , Bytes , and so on. |
maxSize |
The maximum size of the retrieved value. For datatypes of OCCIBYTES and OCCISTRING , maxSize should be greater than 0 . |
schName |
The schema name. |
sqltype |
The name of the type in the data base (used for types which have been created with CREATE TYPE ). |
A Statement
can be in auto-commit mode. In this case any statement executed is also automatically committed. By default, the auto-commit mode is turned-off.
void setAutoCommit( bool autoCommit);
Parameter | Description |
---|---|
autoCommit |
TRUE enables auto-commit; FALSE disables auto-commit. |
Set a parameter to a Bfile
value.
void setBfile( unsigned int paramIndex, const Bfile &val);
Parameter | Description |
---|---|
paramIndex |
Parameter index; first parameter is 1, second is 2,... |
val |
The parameter value. |
Defines that a column is to be returned as a binary stream.
Syntax | Description |
---|---|
void setBinaryStreamMode( unsigned int colIndex, unsigned int size); |
Sets column returned to be a binary stream. |
void setBinaryStreamMode( unsigned int colIndex, unsigned int size bool inArg); |
Sets column returned to be a binary stream; used when have PL/SQL IN or IN/OUT arguments in the bind position. |
Parameter | Description |
---|---|
colIndex |
Column index; first column is 1, second is 2,... |
size |
The amount of data to be read or returned as a binary Stream . |
inArg |
Pass TRUE if the bind position is a PL/SQL IN or IN/OUT argument |
Set a parameter to a Blob
value.
void setBlob( unsigned int paramIndex, const Blob &val);
Parameter | Description |
---|---|
paramIndex |
Parameter index; first parameter is 1, second is 2,... |
val |
The parameter value. |
Set a parameter to a Bytes
array.
void setBytes( unsigned int paramIndex, const Bytes &val);
Parameter | Description |
---|---|
paramIndex |
Parameter index; first parameter is 1, second is 2,... |
val |
The parameter value. |
Defines that a column is to be returned as a character stream.
Syntax | Description |
---|---|
void setCharacterStreamMode( unsigned int colIndex, unsigned int size); |
Sets column returned to be a character stream. |
void setCharacterStreamMode( unsigned int colIndex, unsigned int size, bool inArg); |
Sets column returned to be a character stream; used when have PL/SQL IN or IN/OUT arguments in the bind position. |
Parameter | Description |
---|---|
colIndex |
Column index; first column is 1, second is 2,... |
size |
The amount of data to be read or returned as a character Stream . |
inArg |
Pass TRUE if the bind position is a PL/SQL IN or IN/OUT argument |
Overrides the default character set for the specified parameter. Data is assumed to be in the specified character set and is converted to database character set. For OUT
binds, this specifies the character set to which database characters are converted to.
void setCharSet( unsigned int paramIndex, string charSet);
Parameter | Description |
---|---|
paramIndex |
Parameter index; first parameter is 1, second is 2,... |
charSet |
Selected character set, as a string. |
Set a parameter to a Clob
value.
void setClob( unsigned int paramIndex, const Clob &val);
Parameter | Description |
---|---|
paramIndex |
Parameter index; first parameter is 1, second is 2,... |
val |
The parameter value. |
Set a parameter to a Date
value.
void setDate( unsigned int paramIndex, const Date &val);
Parameter | Description |
---|---|
paramIndex |
Parameter index; first parameter is 1, second is 2,... |
val |
The parameter value. |
If the parameter is going to be inserted in a column that contains data in the database's NCHAR
character set, then OCCI must be informed by passing a TRUE
value. A FALSE
can be passed to restore the dafault.Returns returns the character set that is in effect for the specified parameter.
void setDatabaseNCHARParam( unsigned int paramIndex, bool isNCHAR);
Parameter | Description |
---|---|
paramIndex |
Parameter index; first parameter is 1, second is 2,... |
isNCHAR |
TRUE if this parameter contains data in Database's NCHAR character set; FALSE otherwise |
Specifies a data buffer where data would be available. Also, used for OUT
bind parameters of callable statements (and DML returning OUT
binds in future).
The buffer
parameter is a pointer to a user allocated data buffer. The current length of data must be specified in the length
parameter. The amount of data should not exceed the size
parameter. Finally, type
is the data type of the data.
Note that not all types
can be supplied in the buffer. For example, all OCCI allocated types (such as Bytes
, Date
and so on) cannot be provided by the setDataBuffer() interface. Similarly, C++ Standard Library strings cannot be provided with the setDataBuffer()interface either. The type
can be any of OCI data types such VARCHAR2
, CSTRING
, CHARZ
and so on.
If setDataBuffer() is used to specify data for iterative or array executes, it should be called only once in the first iteration only. For subsequent iterations, OCCI would assume that data is at buffer +(i*size)
location where i
is the iteration number. Similarly the length of the data would be assumed to be at (length+i).
void setDataBuffer( unsigned int paramIndex, void *buffer, Type type, sb4 size, ub2 *length, sb2 *ind = NULL, ub2 *rc= NULL);
Parameter | Description |
---|---|
paramIndex |
Parameter index; first parameter is 1, second is 2,... |
buffer |
Pointer to user-allocated buffer; if iterative or array executes are done, it should have numIterations() size bytes in it. |
type |
Type of the data that is provided (or retrieved) in the buffer. |
size |
Size of the data buffer; for iterative and array executes, it is the size of each element of the data items. |
length |
Pointer to the length of data in the buffer; for iterative and array executes, it should be an array of length data for each buffer element; the size of the array should be equal to arrayLength() . |
ind |
Indicator. For iterative and array executes, an indicator for every buffer element. |
rc |
Return code; for iterative and array executes, a return code for every buffer element. |
Specify an array of data buffers where data would be available for reading or writing. Used for IN
, OUT
, and IN/OUT
bind parameters for stored procedures which read/write array parameters.
A stored procedure can have an array of values for IN
, IN/OUT
, or OUT
parameters. In this case, the parameter must be specified using the setDataBufferArray() method. The array is specified just as for the setDataBuffer() method for iterative or array executes, but the number of elements in the array is determined by *arrayLength
parameter.
For OUT
and IN/OUT
parameters, the maximum number of elements in the array is specified by the arraySize
parameter. Note that for iterative prepared statements, the number of elements in the array is determined by the number of iterations, and for array executes the number of elements in the array is determined by the arrayLength
parameter of the executeArrayUpdate() method. However, for array parameters of stored procedures, the number of elements in the array must be specified in the arrayLength
parameter of the setDataBufferArray() method because each parameter may have a different size array.
This is different from prepared statements where for iterative and array executes, the number of elements in the array for each parameter is the same and is determined by the number of iterations of the statement, but a callable statement is executed only once, and each of its parameter can be a varying length array with possibly a different length.
Note: ForOUT and IN/OUT binds, the number of elements returned in the array is returned in arrayLength as well. The client must make sure that it has allocated size *arraySize bytes for the buffer . |
void setDataBufferArray( unsigned int paramIndex, void *buffer, Type type, ub4 arraySize, ub4 *arrayLength, sb4 elementSize, ub2 *elementLength, sb2 *ind = NULL, ub2 *rc = NULL);
Parameter | Description |
---|---|
paramIndex |
Parameter index; first parameter is 1, second is 2,... |
buffer |
Pointer to user-allocated buffer. It should have size* arraySize bytes in it. |
type |
Type of the data that is provided (or retrieved) in the buffer. |
arraySize |
Maximum number of elements in the array. |
arrayLength |
Pointer to number of current elements in the array. |
elementSize |
Size of the data buffer for each element. |
elementLemgth |
Pointer to an array of lengths. elementLength[i] has the current length of the i th element of the array. |
ind |
Pointer to an array of indicators. An indicator for every buffer element. |
rcs |
Pointer to an array of return codes. |
Sets an IEEE754 double as a bind value to a Statement
object at the position specified by paramIndex
attribute.
void setBDouble( unsigned int paramIndex, const BDouble dval) = 0;
Parameter | Description |
---|---|
paramIndex |
Parameter index; first parameter is 1, second is 2,... |
dval |
The parameter value. |
Sets an IEEE754 float as a bind value to a Statement
object at the position specified by the paramIndex
attribute.
void setBFloat( unsigned int paramIndex, const BFloat fval) = 0;
Parameter | Description |
---|---|
paramIndex |
Parameter index; first parameter is 1, second is 2,... |
fval |
The parameter value. |
Sets a parameter to a C++ double value.
void setDouble( unsigned int paramIndex, double val);
Parameter | Description |
---|---|
paramIndex |
Parameter index; first parameter is 1, second is 2,... |
val |
The parameter value. |
Enables/disables exceptions for reading of NULL
values on paramIndex parameter of the statement. If exceptions are enabled, calling a get
xxx
()
on paramIndex
parameter would result in an SQLException
if the parameter value is NULL
. This call can also be used to disable exceptions.
void setErrorOnNUll( unsigned int paramIndex, bool causeException);
Parameter | Description |
---|---|
paramIndex |
Parameter index; first parameter is 1, second is 2,... |
causeException |
Enable exceptions if TRUE . Disable if FALSE . |
This method enables/disables exceptions when truncation occurs.
void setErrorOnTruncate( unsigned int paramIndex, bool causeException);
Parameter | Description |
---|---|
paramIndex |
Parameter index; first parameter is 1, second is 2,... |
causeException |
Enable exceptions if TRUE . Disable if FALSE . |
Set a parameter to a C++ float value.
void setFloat( unsigned int paramIndex, float val);
Parameter | Description |
---|---|
paramIndex |
Parameter index; first parameter is 1, second is 2,... |
val |
The parameter value. |
Set a parameter to a C++ int value.
void setInt( unsigned int paramIndex, int val);
Parameter | Description |
---|---|
paramIndex |
Parameter index; first parameter is 1, second is 2,... |
val |
The parameter value. |
Set a parameter to a IntervalDS
value.
void setIntervalDS( unsigned int paramIndex, const IntervalDS &val);
Parameter | Description |
---|---|
paramIndex |
Parameter index; first parameter is 1, second is 2,... |
val |
The parameter value. |
Set a parameter to a Interval
value.
void setIntervalYM( unsigned int paramIndex, const IntervalYM &val);
Parameter | Description |
---|---|
paramIndex |
Parameter index; first parameter is 1, second is 2,... |
val |
The parameter value. |
Sets the maximum number of invocations that will be made for the DML statement. This must be called before any parameters are set on the prepared statement. The larger the iterations, the larger the numbers of parameters sent to the server in one round trip. However, a large number causes more memory to be reserved for all the parameters. Note that this is just the maximum limit. Actual number of iterations depends on the number of calls to addIteration().
void setMaxIterations( unsigned int maxIterations);
Parameter | Description |
---|---|
maxIterations |
Maximum number of iterations allowed on this statement. |
This method sets the maximum amount of data to be sent or received for the specified parameter. It only applies to character and binary data. If the maximum amount is exceeded, the excess data is discarded. This method can be very useful when working with a LONG
column. It can be used to truncate the LONG
column by reading or writing it into a string or Bytes
data type.
If the getSQL() or setBytes() method has been called to bind a value to an IN
/OUT
parameter of a PL/SQL procedure, and the size of the OUT
value is expected to be greater than the size of the IN
value, then setMaxParamSize() should be called.
void setMaxParamSize( unsigned int paramIndex, unsigned int maxSize);
Parameter | Description |
---|---|
paramIndex |
Parameter index; first parameter is 1, second is 2,... |
maxSize |
The new maximum parameter size limit; must be >0. |
Set a parameter to SQL NULL
. Note that you must specify the parameter's SQL type.
void setNull( unsigned int paramIndex, Type type);
Parameter | Description |
---|---|
paramIndex |
Parameter index; first parameter is 1, second is 2,... |
type |
SQL type. |
Set a parameter to a Number
value.
void setNumber( unsigned int paramIndex, const Number &val);
Parameter | Description |
---|---|
paramIndex |
Parameter index; first parameter is 1, second is 2,... |
val |
The parameter value. |
Set the value of a parameter using an object; use the C++.lang equivalent objects for integral values. The OCCI specification specifies a standard mapping from C++ Object
types to SQL types. The given parameter C++ object will be converted to the corresponding SQL type before being sent to the database.
Syntax | Description |
---|---|
void setObject( unsigned int paramIndex, PObject* val); |
Set the value of a parameter using an object. |
void setObject( unsigned int paramIndex, PObject* val, const USting &sqltyp); |
Set the value of a parameter using an object; globalization enabled. |
Parameter | Description |
---|---|
paramIndex |
Parameter index; first parameter is 1, second is 2,... |
val |
The object containing the input parameter value. |
sqltyp |
The SQL type name of the object to be set. |
Set the amount of memory that will be used internally by OCCI to store data fetched during each round trip to the server. A value of 0
means that the amount of data fetched during the round trip is constrained by the FetchRowCount
parameter. If both parameters are nonzero, the smaller of the two is used.
void setPrefetchMemorySize( unsigned int bytes);
Parameter | Description |
---|---|
bytes |
Number of bytes to use for storing data fetched during each round trip to the server. |
Set the number of rows that will be fetched internally by OCCI during each round trip to the server. A value of 0
means that the amount of data fetched during the round trip is constrained by the FetchMemorySize
parameter. If both parameters are nonzero, the smaller of the two is used. If both of these parameters are zero, row count internally defaults to 1
row and that is the value returned from the getFetchRowCount()
method.
void setPrefetchRowCount( unsigned int rowCount);
Parameter | Description |
---|---|
rowCount |
Number of rows to fetch for each round trip to the server. |
Set a Rowid
bytes array for a bind position.
void setRowid( unsigned int paramIndex, const Bytes &val);
Parameter | Description |
---|---|
paramIndex |
Parameter index; first parameter is 1, second is 2,... |
val |
The parameter value. |
A new SQL string can be associated with a Statement
object by this call. Resources associated with the previous SQL statement are freed. In particular, a previously obtained result set is invalidated. If an empty sql string, "", was used when the Statement
was created, a setSQL
method with the proper SQL string must be done prior to execution.
void setSQL( const string &sql);
Parameter | Description |
---|---|
sql |
Any SQL statement. |
Associate an SQL statement with this object. Unicode support: the client Environment
should be initialized in OCCIUTIF16 mode.
void setSQLUString( const UString &sql);
Parameter | Description |
---|---|
sql |
Any SQL statement, in character set associated with the connection source of the statement. |
Set a parameter for a specified index.
void setString( unsigned int paramIndex, const string &val);
Parameter | Description |
---|---|
paramIndex |
Parameter index; first parameter is 1, second is 2,... |
val |
The parameter value. |
Set a parameter to a Timestamp
value.
void setTimestamp( unsigned int paramIndex, const Timestamp &val);
Parameter | Description |
---|---|
paramIndex |
Parameter index; first parameter is 1, second is 2,... |
val |
The parameter value. |
Set a parameter to a C++ unsigned int value.
void setUInt( unsigned int paramIndex, unsigned int val);
Parameter | Description |
---|---|
paramIndex |
Parameter index; first parameter is 1, second is 2,... |
val |
The parameter value. |
Set a parameter for a specified index; globalization enabled.
void setUString( unsigned int paramIndex, const UString &val);
Parameter | Description |
---|---|
paramIndex |
Parameter index; first parameter is 1, second is 2,... |
val |
The parameter value. |
Sets a parameter to a vector. This method should be used when the type is a collection type, varrays or nested tables. The SQL Type of the elements in the collection should be compatible with the type of the vector. For example, if the collection is a varray of VARCHAR2
, use vector<string>.
Syntax | Description |
---|---|
void setVector( Statement *stmt, unsigned int paramIndex, const OCCI_STD_NAMESPACE::vector< T > &vect, const OCCI_STD_NAMESPACE::string &schemaName, const OCCI_STD_NAMESPACE::string &typeName); |
Intended for use on platforms where partial ordering of function templates is not supported, such as Windows NT. Multibyte support. |
void setVector( Statement *stmt, unsigned int paramIndex, const OCCI_STD_NAMESPACE::vector<T* > &vect, const OCCI_STD_NAMESPACE::string &schemaName, const OCCI_STD_NAMESPACE::string &typeName); |
Intended for use on platforms where partial ordering of function templates is supported. Multibyte support. |
void setVector( Statement *stmt, unsigned int paramIndex, const std::vector<Bfile> &vect, const UString &sqltype; |
Sets a const Bfile vector |
void setVector( Statement *stmt, unsigned int paramIndex, const std::vector<Blob> &vect, const UString &sqltype; |
Sets a const Blob vector. |
void setVector( Statement *stmt, unsigned int paramIndex, const std::vector<Clob> &vect, const UString &sqltype; |
Sets a const Clob vector. |
void setVector( Statement *stmt, unsigned int paramIndex, const std::vector<double> &vect, const UString &sqltype; |
Sets a const double vector. |
void setVector( Statement *stmt, unsigned int paramIndex, const std::vector<float> &vect, const UString &sqltype; |
Sets a const float vector. |
void setVector( Statement *stmt, unsigned int paramIndex, const std::vector<int> &vect, const UString &sqltype; |
Sets a const int vector. |
void setVector( Statement *stmt, unsigned int paramIndex, const std::vector<IntervalDS> &vect, const UString &sqltype; |
Sets a const IntervalDS vector. |
void setVector( Statement *stmt, unsigned int paramIndex, const std::vector<Number> &vect, const UString &sqltype; |
Sets a const Number vector. |
void setVector( Statement *stmt, unsigned int paramIndex, const std::vector<RefAny> &vect, const UString &sqltype; |
Sets a const RefAny vector. |
void setVector( Statement *stmt, unsigned int paramIndex, const std::vector<Timestamp> &vect, const UString &sqltype; |
Sets a const Timestamp vector. |
void setVector( Statement *stmt, unsigned int paramIndex, const std::vector<unsigned int> &vect, const UString &sqltype; |
Sets a const unsigned int vector. |
void setVector( Statement *stmt, unsigned int paramIndex, const vector<BDouble> &vect const string &sqltype); |
Sets a BDouble vector. |
void setVector( Statement *stmt, unsigned int paramIndex, const vector<Bfile> &vect, const string &schemaName, const string &typeName); |
Sets a const Bfile vector; multibyte support. |
void setVector( Statement *stmt, unsigned int paramIndex, const vector<Bfile> &vect, const UString &schemaName, const UString &typeName); |
Sets a const BFile vector; UTF16 support. |
void setVector( Statement *stmt, unsigned int paramIndex, const vector<BFloat> &vect const string &sqltype); |
Sets a BFloat vector. |
void setVector( Statement *stmt, unsigned int paramIndex, const vector<Blob> &vect, const string &schemaName, const string &typeName); |
Sets a const Blob vector; multibyte support. |
void setVector( Statement *stmt, unsigned int paramIndex, const vector<Blob> &vect, const UString &schemaName, const UString &typeName); |
Sets a const Blob vector; UTF16 support. |
void setVector( Statement *stmt, unsigned int paramIndex, const vector<Clob> &vect, const string &schemaName, const string &typeName); |
Sets a const Clob vector; multibyte support. |
void setVector( Statement *stmt, unsigned int paramIndex, const vector<Clob> &vect, const UString &schemaName, const UString &typeName); |
Sets a const Clob vector; UTF16 support. |
void setVector( Statement *stmt, unsigned int paramIndex, const vector<Date> &vect, const string &schemaName, const string &typeName); |
Sets a const Date vector; multibyte support. |
void setVector( Statement *stmt, unsigned int paramIndex, const vector<Date> &vect, const UString &schemaName, const UString &typeName); |
Sets a const Date vector; UTF16 support. |
void setVector( Statement *stmt, unsigned int paramIndex, const vector<Date> &vect, const UString &sqltype; |
Sets a const Date vector. |
void setVector( Statement *stmt, unsigned int paramIndex, const vector<double> &vect, const string &schemaName, const string &typeName); |
Sets a const double vector; multibyte support. |
void setVector( Statement *stmt, unsigned int paramIndex, const vector<double> &vect, const UString &schemaName, const UString &typeName); |
Sets a const double vector; UTF16 support. |
void setVector( Statement *stmt, unsigned int paramIndex, const vector<float> &vect, const string &schemaName, const string &typeName); |
Sets a const float vector; multibyte support. |
void setVector( Statement *stmt, unsigned int paramIndex, const vector<float> &vect, const UString &schemaName, const UString &typeName); |
Sets a const float vector; UTF16 support. |
void setVector( Statement *stmt, unsigned int paramIndex, const vector<int> &vect, const string &schemaName, const string &typeName); |
Sets a const int vector; multibyte support. |
void setVector( Statement *stmt, unsigned int paramIndex, const vector<int> &vect, const UString &schemaName, const UString &typeName); |
Sets a const int vector; UTF16 support. |
void setVector( Statement *stmt, unsigned int paramIndex, const vector<IntervalDS> &vect, const string &schemaName, const string &typeName); |
Sets a const IntervalDS vector; multibyte support. |
void setVector( Statement *stmt, unsigned int paramIndex, const vector<IntervalDS> &vect, const UString &schemaName, const UString &typeName); |
Sets a const IntervalDS vector; UTF16 support. |
void setVector( Statement *stmt, unsigned int paramIndex, const vector<IntervalYM> &vect, const string &schemaName, const string &typeName); |
Sets a const IntervalYM vector; multibyte support. |
void setVector( Statement *stmt, unsigned int paramIndex, const vector<IntervalYM> &vect, const UString &schemaName, const UString &typeName); |
Sets a const IntervalYM vector; UTF16 support |
void setVector( Statement *stmt, unsigned int paramIndex, const vector<IntervalYM> &vect, const UString &sqltype; |
Sets a const IntervalDS vector. |
void setVector( Statement *stmt, unsigned int paramIndex, const vector<Number> &vect, const string &schemaName, const string &typeName); |
Sets a const Number vector; multibyte support. |
void setVector( Statement *stmt, unsigned int paramIndex, const vector<Number> &vect, const UString &schemaName, const UString &typeName); |
Sets a const Number vector; UTF16 support. |
void setVector( Statement *stmt, unsigned int paramIndex, const vector<RefAny> &vect, const string &schemaName, const string &typeName); |
Sets a const RefAny vector; multibyte support. |
void setVector( Statement *stmt, unsigned int paramIndex, const vector<RefAny> &vect, const UString &schemaName, const UString &typeName); |
Sets a const RefAny vector; UTF16 support. |
void setVector( Statement *stmt, unsigned int paramIndex, const vector<string> &vect, const string &schemaName, const string &typeName); |
Sets a const string vector; multibyte support. |
void setVector( Statement *stmt, unsigned int paramIndex, const vector<string> &vect, const UString &schemaName, const UString &typeName); |
Sets a const string vector; UTF16 support. |
void setVector( Statement *stmt, unsigned int paramIndex, const vector<Timestamp> &vect, const string &schemaName, const string &typeName); |
Sets a const Timestamp vector; multibyte support. |
void setVector( Statement *stmt, unsigned int paramIndex, const vector<Timestamp> &vect, const UString &schemaName, const UString &typeName); |
Sets a const Timestamp vector; UTF16 support. |
void setVector( Statement *stmt, unsigned int paramIndex, const vector<unsigned int> &vect, const string &schemaName, const string &typeName); |
Sets a const unsigned int vector; multibyte support. |
void setVector( Statement *stmt, unsigned int paramIndex, const vector<unsigned int> &vect, const UString &schemaName, const UString &typeName); |
Sets a const unsigned int vector; UTF16 support. |
void setVector( Statement *stmt, unsigned int paramIndex, const vector<UString> &vect, const UString &sqltype); |
Sets a const UString vector; unicode support. The client Environment should be initialized in OCCIUTIF16 mode. |
void setVector( Statement *stmt, unsigned int paramIndex, vector<Bfile> &vect, string &sqltype; |
Sets a Bfile vector. |
void setVector( Statement *stmt, unsigned int paramIndex, vector<Blob> &vect, string &sqltype; |
Sets a Blob vector. |
void setVector( Statement *stmt, unsigned int paramIndex, vector<Clob> &vect, string &sqltype; |
Sets a Clob vector. |
void setVector( Statement *stmt, unsigned int paramIndex, vector<Date> &vect, string &sqltype; |
Sets a Date vector. |
void setVector( Statement *stmt, unsigned int paramIndex, vector<double> &vect, string &sqltype; |
Sets a double vector. |
void setVector( Statement *stmt, unsigned int paramIndex, vector<float> &vect, string &sqltype; |
Sets a float vector. |
void setVector( Statement *stmt, unsigned int paramIndex, vector<int> &vect, string &sqltype; |
Sets an int vector . |
void setVector( Statement *stmt, unsigned int paramIndex, vector<IntervalDS> &vect, string &sqltype; |
Sets an IntervalDS vector. |
void setVector( Statement *stmt, unsigned int paramIndex, vector<IntervalYM> &vect, string &sqltype; |
Sets an IntervalYM vector. |
void setVector( Statement *stmt, unsigned int paramIndex, vector<Number> &vect, string &sqltype; |
Sets a Number vector. |
void setVector( Statement *stmt, unsigned int paramIndex, vector<RefAny> &vect, string &sqltype; |
Sets a RefAn y vector. |
void setVector( Statement *stmt, unsigned int paramIndex, vector<string> &vect, string &sqltype; |
Sets a string vector. |
void setVector( Statement *stmt, unsigned int paramIndex, vector<Timestamp> &vect, string &sqltype; |
Sets a Timestamp vector. |
void setVector( Statement *stmt, unsigned int paramIndex, vector<unsigned int> &vect, string &sqltype; |
Sets an unsigned int vector. |
template <class T> void setVector( Statement *stmt, unsigned int paramIndex, const vector< T* > &vect, const string &sqltype); |
Intended for use on platforms where partial ordering of function templates is not supported. |
template <class T> void setVector( Statement *stmt, unsigned int paramIndex, const vector< T* > &vect, const UString &sqltype); |
Intended for use on platforms where partial ordering of function templates is not supported; globalization enabled. |
template <class T> void setVector( Statement *stmt, unsigned int paramIndex, const vector<Ref<T>> &vect, const UString &sqltype); |
Available only on platforms where partial ordering of function templates is supported. setVectorOfRefs() can be used instead; globalization enabled. |
template <class T> void setVector( Statement *stmt, unsigned int paramIndex, const vector<T> &vect, const string &sqltype); |
Intended for use on platforms where partial ordering of function templates is supported. |
template <class T> void setVector( Statement *stmt, unsigned int paramIndex, vector<Ref<T>> &vect, string &sqltype); |
Available only on platforms where partial ordering of function templates is supported. setVectorOfRefs() can be used instead. |
Parameter | Description |
---|---|
stmt |
Statement on which parameter is to be set. |
paramIndex |
Parameter index; first parameter is 1, second is 2,... |
vect |
The vector to be set. |
sqltype |
Sqltype of the collection in the database. For example, CREATE TYPE num_coll AS VARRAY OF NUMBER . And the column/parameter type is num_coll . The sqltype would be num_coll . |
schemaName |
Name of the schema used |
typeName |
Type |
Sets a parameter to a vector; should be used when the type is a collection of REF
s are varrays or nested tables of REF
s.
Syntax | Description |
---|---|
template <class T> void setVectorOfRefs( Statement *stmt, unsigned int paramIndex, const vector<Ref<T> > &vect, const string &sqltype) ; |
Sets a parameter to a vector; should be used when the type is a collection of REF s are varrays or nested tables of REF s. |
template <class T> void setVectorOfRefs( Statement *stmt, unsigned int paramIndex, const vector<Ref<T> > &vect, const string &sqltype) ; |
Used for multibyte support. |
template <class T> void setVectorOfRefs( Statement *stmt, unsigned int paramIndex, const vector<Ref<T>> &vect, const string &schemaName, const string &typeName); |
Used for multibyte support. |
template <class T> void setVectorOfRefs( Statement *stmt, unsigned int paramIndex, const vector<Ref<T> &vect, const UString &schemaName, const UString &typeName); |
Used for UTF16 support on platforms where partial ordering of function templates is not supported, such as Windows NT. |
template <class T> void setVector( Statement *stmt, unsigned int paramIndex, const OCCI_STD_NAMESPACE::vector<T* > &vect, const UString &schemaName, const UString &typeName) ; |
Used for UTF16 support on platforms where partial ordering of function templates is supported. |
Parameter | Description |
---|---|
stmt |
Statement on which parameter is to be set. |
paramIndex |
Parameter index; first parameter is 1, second is 2,... |
vect |
Vector to be set. |
sqltype |
Sqltype of the parameter or column. Use setVectorOfRefs() instead of specialized function setVector() for Ref<T> . |
schemaName |
Name of the schema used |
typeName |
Type |
Returns the current status of the statement. Useful when there is streamed data to be written (or read). Other methods such as getCurrentStreamParam() and getCurrentIteration() can be called to find out the streamed parameter that needs to be written and the current iteration number for an iterative or array execute. The status() method can be called repeatedly to find out the status of the execution.
The returned value is one of the following, and are defined as constants of the Statement
class in Table 10-37: PREPARED
, UNPREPARED
, RESULT_SET_AVAILABLE
, UPDATE_COUNT_AVAILABLE
, NEEDS_STREAM_DATA
, and STREAM_DATA_AVAILABLE
Status status() const;