rwlogo
SourcePro C++ 12.0

SourcePro® C++ API Reference Guide



   SourcePro C++
Documentation Home

RWDBStoredProc Class Reference
[Databases]

Encapsulates a database stored procedure, providing a uniform API to the common operations related to them. More...

#include <rw/db/stored.h>

List of all members.

Public Member Functions

 RWDBStoredProc ()
 RWDBStoredProc (const RWDBStoredProc &proc)
RWDBStoredProcoperator= (const RWDBStoredProc &proc)
RWDBDatabase database () const
RWCString name () const
RWDBStatus clear ()
void acquire () const
void release () const
void setErrorHandler (RWDBStatus::ErrorHandler handler)
RWDBStatus::ErrorHandler errorHandler () const
RWDBStatus status () const
bool isValid () const
bool isReady () const
RWDBResult execute ()
RWDBResult execute (const RWDBConnection &connection)
RWDBStatus fetchReturnParams ()
RWDBValue returnValue () const
RWDBStatus drop ()
RWDBStatus drop (const RWDBConnection &connection)
RWCString text (bool forceLookup=false) const
RWCString text (const RWDBConnection &connection, bool forceLookup=false) const
RWDBSchema params (bool forceLookup=false) const
RWDBSchema params (const RWDBConnection &connection, bool forceLookup=false) const
bool exists (bool forceLookup=false) const
bool exists (const RWDBConnection &connection, bool forceLookup=false) const
RWDBStoredProcoperator<< (RWDBValueManip value)
RWDBStoredProcoperator<< (const RWDBValue &value)
RWDBStoredProcoperator<< (char value)
RWDBStoredProcoperator<< (unsigned char value)
RWDBStoredProcoperator<< (short value)
RWDBStoredProcoperator<< (unsigned short value)
RWDBStoredProcoperator<< (int value)
RWDBStoredProcoperator<< (unsigned int value)
RWDBStoredProcoperator<< (long value)
RWDBStoredProcoperator<< (unsigned long value)
RWDBStoredProcoperator<< (long long value)
RWDBStoredProcoperator<< (unsigned long long value)
RWDBStoredProcoperator<< (float value)
RWDBStoredProcoperator<< (double value)
RWDBStoredProcoperator<< (long double value)
RWDBStoredProcoperator<< (const RWDecimalPortable &value)
RWDBStoredProcoperator<< (const RWDate &value)
RWDBStoredProcoperator<< (const RWDateTime &value)
RWDBStoredProcoperator<< (const RWDBDateTime &value)
RWDBStoredProcoperator<< (const RWDBDuration &value)
RWDBStoredProcoperator<< (const RWCString &value)
RWDBStoredProcoperator<< (const RWDBMBString &value)
RWDBStoredProcoperator<< (const RWBasicUString &value)
RWDBStoredProcoperator<< (const RWWString &value)
RWDBStoredProcoperator<< (const RWDBBlob &value)
RWDBStoredProcoperator<< (const RWDBBoundExpr &value)
RWDBStoredProcoperator<< (short *valPtr)
RWDBStoredProcoperator<< (unsigned short *valPtr)
RWDBStoredProcoperator<< (int *valPtr)
RWDBStoredProcoperator<< (unsigned int *valPtr)
RWDBStoredProcoperator<< (long *valPtr)
RWDBStoredProcoperator<< (unsigned long *valPtr)
RWDBStoredProcoperator<< (long long *valPtr)
RWDBStoredProcoperator<< (unsigned long long *valPtr)
RWDBStoredProcoperator<< (float *valPtr)
RWDBStoredProcoperator<< (double *valPtr)
RWDBStoredProcoperator<< (long double *valPtr)
RWDBStoredProcoperator<< (RWDecimalPortable *valPtr)
RWDBStoredProcoperator<< (RWDate *valPtr)
RWDBStoredProcoperator<< (RWDateTime *valPtr)
RWDBStoredProcoperator<< (RWDBDateTime *valPtr)
RWDBStoredProcoperator<< (RWDBDuration *valPtr)
RWDBStoredProcoperator<< (RWDBBlob *valPtr)
RWDBStoredProcoperator<< (RWCString *valPtr)
RWDBStoredProcoperator<< (RWDBMBString *valPtr)
RWDBStoredProcoperator<< (RWBasicUString *valPtr)
RWDBStoredProcoperator<< (RWWString *valPtr)
RWDBStoredProcoperator[] (const RWDBColumn &paramColumn)
RWDBStoredProcoperator[] (const RWCString &paramName)
RWDBStoredProcoperator[] (size_t index)
bool isNull (const RWDBColumn &column) const
bool isNull (const RWCString &name) const
bool isNull (size_t index) const

Detailed Description

Many modern RDBMS implementations include a mechanism to enforce database policy through stored procedures. Applications may be required to do much of their data manipulation through stored procedures. Unfortunately, the standards bodies have had little to say about stored procedures, so implementations vary widely among RDBMS vendors. If an RWDBStoredProc feature is not supported by the underlying database, The DB Interface Module reports an RWDBStatus::notSupported error. The remainder of this section assumes that all features are supported. Check the DB Access Module guide for information about what features are supported by a particular database.

RWDBStoredProc is an encapsulation of a database stored procedure. RWDBStoredProc supports creating and deleting stored procedures, retrieving stored procedures definitions, executing stored procedures, and processing results returned from stored procedure execution. Parameters may be passed to an RWDBStoredProc prior to execution, and the values of output parameters may be retrieved. If a database vendor's stored procedure may return multiple sets of results, RWDBStoredProc can access each result set in turn.

RWDBStoredProc uses an RWDBSchema to store information about its formal parameters. Use the insertion operator operator<<() to pass actual parameters to an RWDBStoredProc. Insert values if the stored procedure expects IN parameters; insert pointers if the stored procedure expects OUT or IN/OUT parameters and your application needs to obtain results through the parameters. Insert rwdbNull to pass a literal NULL by value.

Note:
It is an error to insert a NULL pointer; if this occurs, the status of the RWDBStoredProc changes to RWDBStatus::nullReference.

RWDBStoredProc maintains a notion of the current position in its parameter list. The current position is set to zero when the RWDBStoredProc is created, and reset to zero whenever the RWDBStoredProc is executed. Each insertion of an actual parameter increments the current position by one. The indexing operator operator[]() can be used to access a particular parameter position by number or by name. Given a stored procedure myStoredProc that expects the parameters number and name in that order, these notations are equivalent:

 RWCString  hello("Hello  World");

 myStoredProc  <<  1  <<  hello;

 myStoredProc[0]  <<  1;
 myStoredProc[1]  <<  hello;

 myStoredProc["name"]  <<  hello;
 myStoredProc["number"]  <<  1;

RWDBStoredProc does not check actual parameters for type; it allows the database to do type conversion. If there is a type incompatibility, the DB Interface Module passes along whatever the database reports to the application. The DB Interface Module produces an RWDBStatus::invalidPosition error if too many arguments are inserted into an RWDBStoredProc. No check is made for too few arguments. The database may supply defaults; if not, the DB Interface Module passes along whatever the database reports to the application.

In order to support parameter passing, The DB Interface Module uses a connection to query the database for schema information whenever an RWDBStoredProc is produced by an RWDBDatabase.

RWDBStoredProc is designed around the Interface/Implementation paradigm. An RWDBStoredProc instance is an interface to a reference-counted implementation; copy constructors and assignment operators produce additional references to a shared implementation. An RWDBStoredProc implementation is a base class from which a family of database-specific stored procedure implementations is derived.

Synopsis

 #include <rw/db/stored.h>

 RWDBStoredProc myProc = myDbase.storedProc("myProcName");

Examples

In this example, suppose there is a database procedure getId, which expects two parameters: name, an input string representing a customer's name, and id, an output integer parameter representing the customer's id. The procedure is supposed to look up the customer id for the given customer name. If successful, it places the id in its id parameter and returns 0. Otherwise it returns -1 and does not change id.

 RWDBStoredProc getId = myDbase.storedProc("getId");
 RWCString name("John Doe");
 int id;
 getId << name << &id;
 getId.execute();
 RWDBValue retValue = getId.returnValue();
 if (retValue.asInt() == 0)
 {
     cout << "John Doe's id is " << id << endl;
 }
 else
 {
     cout << "Can't find John Doe's id" << endl;
 }

Constructor & Destructor Documentation

RWDBStoredProc::RWDBStoredProc (  ) 

The default constructor creates an RWDBStoredProc whose status is RWDBStatus::notInitialized. This constructor is provided as a convenience, for example, for declaring an array of RWDBStoredProc objects. Usable RWDBStoredProc objects are obtained from RWDBDatabase instances.

RWDBStoredProc::RWDBStoredProc ( const RWDBStoredProc proc  ) 

Copy constructor. Self shares an implementation with proc.


Member Function Documentation

void RWDBStoredProc::acquire (  )  const

Attempts to acquire the internal mutex lock. If the mutex is already locked by another thread, the function blocks until the mutex is released. This function can be called from a const object.

Note:
In single-threaded builds, this function evaluates to a no-op.
RWDBStatus RWDBStoredProc::clear (  ) 

Clears all internal state.

RWDBDatabase RWDBStoredProc::database (  )  const

Returns the RWDBDatabase that produced self. Returns an RWDBDatabase whose status is RWDBStatus::notInitialized, if self was created with the default constructor.

RWDBStatus RWDBStoredProc::drop ( const RWDBConnection connection  ) 

Uses the supplied connection to execute the database-specific equivalent of the SQL statement:

DROP PROCEDURE <name>

where <name> is the name of the database stored procedure encapsulated by self. You can check the isValid() method of the return value to see if the operation succeeded. This function can behave asynchronously if executed using an asynchronous connection.

DB XA Module: May generate a server error. This method can still be used before XA connectivity is established.

RWDBStatus RWDBStoredProc::drop (  ) 

Uses a default database connection to execute the database-specific equivalent of the SQL statement:

DROP PROCEDURE <name>

where <name> is the name of the database stored procedure encapsulated by self. You can check the isValid() method of the return value to see if the operation succeeded.

DB XA Module: May generate a server error. This method can still be used before XA connectivity is established.

RWDBStatus::ErrorHandler RWDBStoredProc::errorHandler (  )  const

Returns the error handler attached to self.

RWDBResult RWDBStoredProc::execute ( const RWDBConnection connection  ) 

Uses the supplied connection to execute the stored procedure encapsulated by self. The connection is held by the RWDBResult until the RWDBResult is destroyed. The connection is also held by self until either fetchReturnParams() or returnValue() is called, or the RWDBStoredProc is destroyed. This function can behave asynchronously if executed using an asynchronous connection.

RWDBResult RWDBStoredProc::execute (  ) 

Uses a default database connection to execute the stored procedure encapsulated by self. The connection is held by the RWDBResult until the RWDBResult is destroyed. The connection is also held by self until either fetchReturnParams() or returnValue() is called, or the RWDBStoredProc is destroyed.

bool RWDBStoredProc::exists ( const RWDBConnection connection,
bool  forceLookup = false 
) const

Returns true if the stored procedure encapsulated by self exists in the database. The result is cached in self. If self's internal cache is empty, or if forceLookup is true, uses the supplied connection to obtain the information from the database, otherwise returns the cached information. If an error occurs, returns false.

bool RWDBStoredProc::exists ( bool  forceLookup = false  )  const

Returns true if the stored procedure encapsulated by self exists in the database. The result is cached in self. If self's internal cache is empty, or if forceLookup is true, uses a default database connection to obtain the information from the database, otherwise returns the cached information. If an error occurs, returns false.

RWDBStatus RWDBStoredProc::fetchReturnParams (  ) 

The connection used by the last call to execute() is used to obtain any output parameters returned by the database stored procedure. If execute() has not yet been successfully invoked, sets self's status and returns RWDBStatus::notConnected. Some databases do not support return parameters, in this case RWDBStatus::notSupported is returned. This function behaves asynchronously if the stored procedure was created using an asynchronous connection.

bool RWDBStoredProc::isNull ( size_t  index  )  const

Returns true if the last value fetched into the output parameter at position index was NULL. Otherwise returns false. If there is no such output parameter at index, self's status changes to RWDBStatus::invalidPosition.

bool RWDBStoredProc::isNull ( const RWCString name  )  const

Returns true if the last value fetched into the output parameter with the given name was NULL. Otherwise returns false. If there is no such output parameter with that given name, self's status changes to RWDBStatus::invalidPosition.

bool RWDBStoredProc::isNull ( const RWDBColumn column  )  const

Returns true if the last value fetched into the output parameter with the same name as column was NULL. Otherwise returns false. If there is no such output parameter with the same name, self's status changes to RWDBStatus::invalidPosition.

bool RWDBStoredProc::isReady (  )  const

This function returns true if the object is in ready state, indicating that accessing the object will not block. Accessing a nonready object may potentially block.

bool RWDBStoredProc::isValid (  )  const

Returns true if self's status is RWDBStatus::ok, otherwise returns false.

RWCString RWDBStoredProc::name (  )  const

Returns self's name.

RWDBStoredProc& RWDBStoredProc::operator<< ( RWWString valPtr  ) 

Passes valPtr as the nth parameter to self, where n is the current position in self's formal parameter list, and increments the current position by 1. The parameter is passed by reference. After executing the stored procedure, the variable addressed by valPtr is updated by calling either fetchReturnParams() or returnValue().

RWDBStoredProc& RWDBStoredProc::operator<< ( RWBasicUString valPtr  ) 

Passes valPtr as the nth parameter to self, where n is the current position in self's formal parameter list, and increments the current position by 1. The parameter is passed by reference. After executing the stored procedure, the variable addressed by valPtr is updated by calling either fetchReturnParams() or returnValue().

RWDBStoredProc& RWDBStoredProc::operator<< ( RWDBMBString valPtr  ) 

Passes valPtr as the nth parameter to self, where n is the current position in self's formal parameter list, and increments the current position by 1. The parameter is passed by reference. After executing the stored procedure, the variable addressed by valPtr is updated by calling either fetchReturnParams() or returnValue().

RWDBStoredProc& RWDBStoredProc::operator<< ( RWCString valPtr  ) 

Passes valPtr as the nth parameter to self, where n is the current position in self's formal parameter list, and increments the current position by 1. The parameter is passed by reference. After executing the stored procedure, the variable addressed by valPtr is updated by calling either fetchReturnParams() or returnValue().

RWDBStoredProc& RWDBStoredProc::operator<< ( RWDBBlob valPtr  ) 

Passes valPtr as the nth parameter to self, where n is the current position in self's formal parameter list, and increments the current position by 1. The parameter is passed by reference. After executing the stored procedure, the variable addressed by valPtr is updated by calling either fetchReturnParams() or returnValue().

RWDBStoredProc& RWDBStoredProc::operator<< ( RWDBDuration valPtr  ) 

Passes valPtr as the nth parameter to self, where n is the current position in self's formal parameter list, and increments the current position by 1. The parameter is passed by reference. After executing the stored procedure, the variable addressed by valPtr is updated by calling either fetchReturnParams() or returnValue().

RWDBStoredProc& RWDBStoredProc::operator<< ( RWDBDateTime valPtr  ) 

Passes valPtr as the nth parameter to self, where n is the current position in self's formal parameter list, and increments the current position by 1. The parameter is passed by reference. After executing the stored procedure, the variable addressed by valPtr is updated by calling either fetchReturnParams() or returnValue().

RWDBStoredProc& RWDBStoredProc::operator<< ( RWDateTime valPtr  ) 

Passes valPtr as the nth parameter to self, where n is the current position in self's formal parameter list, and increments the current position by 1. The parameter is passed by reference. After executing the stored procedure, the variable addressed by valPtr is updated by calling either fetchReturnParams() or returnValue().

RWDBStoredProc& RWDBStoredProc::operator<< ( RWDate valPtr  ) 

Passes valPtr as the nth parameter to self, where n is the current position in self's formal parameter list, and increments the current position by 1. The parameter is passed by reference. After executing the stored procedure, the variable addressed by valPtr is updated by calling either fetchReturnParams() or returnValue().

RWDBStoredProc& RWDBStoredProc::operator<< ( RWDecimalPortable valPtr  ) 

Passes valPtr as the nth parameter to self, where n is the current position in self's formal parameter list, and increments the current position by 1. The parameter is passed by reference. After executing the stored procedure, the variable addressed by valPtr is updated by calling either fetchReturnParams() or returnValue().

RWDBStoredProc& RWDBStoredProc::operator<< ( long double *  valPtr  ) 

Passes valPtr as the nth parameter to self, where n is the current position in self's formal parameter list, and increments the current position by 1. The parameter is passed by reference. After executing the stored procedure, the variable addressed by valPtr is updated by calling either fetchReturnParams() or returnValue().

RWDBStoredProc& RWDBStoredProc::operator<< ( double *  valPtr  ) 

Passes valPtr as the nth parameter to self, where n is the current position in self's formal parameter list, and increments the current position by 1. The parameter is passed by reference. After executing the stored procedure, the variable addressed by valPtr is updated by calling either fetchReturnParams() or returnValue().

RWDBStoredProc& RWDBStoredProc::operator<< ( float *  valPtr  ) 

Passes valPtr as the nth parameter to self, where n is the current position in self's formal parameter list, and increments the current position by 1. The parameter is passed by reference. After executing the stored procedure, the variable addressed by valPtr is updated by calling either fetchReturnParams() or returnValue().

RWDBStoredProc& RWDBStoredProc::operator<< ( unsigned long long *  valPtr  ) 

Passes valPtr as the nth parameter to self, where n is the current position in self's formal parameter list, and increments the current position by 1. The parameter is passed by reference. After executing the stored procedure, the variable addressed by valPtr is updated by calling either fetchReturnParams() or returnValue().

RWDBStoredProc& RWDBStoredProc::operator<< ( long long *  valPtr  ) 

Passes valPtr as the nth parameter to self, where n is the current position in self's formal parameter list, and increments the current position by 1. The parameter is passed by reference. After executing the stored procedure, the variable addressed by valPtr is updated by calling either fetchReturnParams() or returnValue().

RWDBStoredProc& RWDBStoredProc::operator<< ( unsigned long *  valPtr  ) 

Passes valPtr as the nth parameter to self, where n is the current position in self's formal parameter list, and increments the current position by 1. The parameter is passed by reference. After executing the stored procedure, the variable addressed by valPtr is updated by calling either fetchReturnParams() or returnValue().

RWDBStoredProc& RWDBStoredProc::operator<< ( long *  valPtr  ) 

Passes valPtr as the nth parameter to self, where n is the current position in self's formal parameter list, and increments the current position by 1. The parameter is passed by reference. After executing the stored procedure, the variable addressed by valPtr is updated by calling either fetchReturnParams() or returnValue().

RWDBStoredProc& RWDBStoredProc::operator<< ( unsigned int *  valPtr  ) 

Passes valPtr as the nth parameter to self, where n is the current position in self's formal parameter list, and increments the current position by 1. The parameter is passed by reference. After executing the stored procedure, the variable addressed by valPtr is updated by calling either fetchReturnParams() or returnValue().

RWDBStoredProc& RWDBStoredProc::operator<< ( int *  valPtr  ) 

Passes valPtr as the nth parameter to self, where n is the current position in self's formal parameter list, and increments the current position by 1. The parameter is passed by reference. After executing the stored procedure, the variable addressed by valPtr is updated by calling either fetchReturnParams() or returnValue().

RWDBStoredProc& RWDBStoredProc::operator<< ( unsigned short *  valPtr  ) 

Passes valPtr as the nth parameter to self, where n is the current position in self's formal parameter list, and increments the current position by 1. The parameter is passed by reference. After executing the stored procedure, the variable addressed by valPtr is updated by calling either fetchReturnParams() or returnValue().

RWDBStoredProc& RWDBStoredProc::operator<< ( short *  valPtr  ) 

Passes valPtr as the nth parameter to self, where n is the current position in self's formal parameter list, and increments the current position by 1. The parameter is passed by reference. After executing the stored procedure, the variable addressed by valPtr is updated by calling either fetchReturnParams() or returnValue().

RWDBStoredProc& RWDBStoredProc::operator<< ( const RWDBBoundExpr value  ) 

Inserts a placeholder and performs binding for in-type parameters. Here in-type binding includes in/out binding. The meaning of shifting in an RWDBBoundExpr with entries greater than 1 is vendor-dependent.

RWDBStoredProc& RWDBStoredProc::operator<< ( const RWDBBlob value  ) 

Passes value as the nth parameter to self, where n is the current position in self's formal parameter list, and increments the current position by one. The parameter is passed by value.

RWDBStoredProc& RWDBStoredProc::operator<< ( const RWWString value  ) 

Passes value as the nth parameter to self, where n is the current position in self's formal parameter list, and increments the current position by one. The parameter is passed by value.

RWDBStoredProc& RWDBStoredProc::operator<< ( const RWBasicUString value  ) 

Passes value as the nth parameter to self, where n is the current position in self's formal parameter list, and increments the current position by one. The parameter is passed by value.

RWDBStoredProc& RWDBStoredProc::operator<< ( const RWDBMBString value  ) 

Passes value as the nth parameter to self, where n is the current position in self's formal parameter list, and increments the current position by one. The parameter is passed by value.

RWDBStoredProc& RWDBStoredProc::operator<< ( const RWCString value  ) 

Passes value as the nth parameter to self, where n is the current position in self's formal parameter list, and increments the current position by one. The parameter is passed by value.

RWDBStoredProc& RWDBStoredProc::operator<< ( const RWDBDuration value  ) 

Passes value as the nth parameter to self, where n is the current position in self's formal parameter list, and increments the current position by one. The parameter is passed by value.

RWDBStoredProc& RWDBStoredProc::operator<< ( const RWDBDateTime value  ) 

Passes value as the nth parameter to self, where n is the current position in self's formal parameter list, and increments the current position by one. The parameter is passed by value.

RWDBStoredProc& RWDBStoredProc::operator<< ( const RWDateTime value  ) 

Passes value as the nth parameter to self, where n is the current position in self's formal parameter list, and increments the current position by one. The parameter is passed by value.

RWDBStoredProc& RWDBStoredProc::operator<< ( const RWDate value  ) 

Passes value as the nth parameter to self, where n is the current position in self's formal parameter list, and increments the current position by one. The parameter is passed by value.

RWDBStoredProc& RWDBStoredProc::operator<< ( const RWDecimalPortable value  ) 

Passes value as the nth parameter to self, where n is the current position in self's formal parameter list, and increments the current position by one. The parameter is passed by value.

RWDBStoredProc& RWDBStoredProc::operator<< ( long double  value  ) 

Passes value as the nth parameter to self, where n is the current position in self's formal parameter list, and increments the current position by one. The parameter is passed by value.

RWDBStoredProc& RWDBStoredProc::operator<< ( double  value  ) 

Passes value as the nth parameter to self, where n is the current position in self's formal parameter list, and increments the current position by one. The parameter is passed by value.

RWDBStoredProc& RWDBStoredProc::operator<< ( float  value  ) 

Passes value as the nth parameter to self, where n is the current position in self's formal parameter list, and increments the current position by one. The parameter is passed by value.

RWDBStoredProc& RWDBStoredProc::operator<< ( unsigned long long  value  ) 

Passes value as the nth parameter to self, where n is the current position in self's formal parameter list, and increments the current position by one. The parameter is passed by value.

RWDBStoredProc& RWDBStoredProc::operator<< ( long long  value  ) 

Passes value as the nth parameter to self, where n is the current position in self's formal parameter list, and increments the current position by one. The parameter is passed by value.

RWDBStoredProc& RWDBStoredProc::operator<< ( unsigned long  value  ) 

Passes value as the nth parameter to self, where n is the current position in self's formal parameter list, and increments the current position by one. The parameter is passed by value.

RWDBStoredProc& RWDBStoredProc::operator<< ( long  value  ) 

Passes value as the nth parameter to self, where n is the current position in self's formal parameter list, and increments the current position by one. The parameter is passed by value.

RWDBStoredProc& RWDBStoredProc::operator<< ( unsigned int  value  ) 

Passes value as the nth parameter to self, where n is the current position in self's formal parameter list, and increments the current position by one. The parameter is passed by value.

RWDBStoredProc& RWDBStoredProc::operator<< ( int  value  ) 

Passes value as the nth parameter to self, where n is the current position in self's formal parameter list, and increments the current position by one. The parameter is passed by value.

RWDBStoredProc& RWDBStoredProc::operator<< ( unsigned short  value  ) 

Passes value as the nth parameter to self, where n is the current position in self's formal parameter list, and increments the current position by one. The parameter is passed by value.

RWDBStoredProc& RWDBStoredProc::operator<< ( short  value  ) 

Passes value as the nth parameter to self, where n is the current position in self's formal parameter list, and increments the current position by one. The parameter is passed by value.

RWDBStoredProc& RWDBStoredProc::operator<< ( unsigned char  value  ) 

Passes value as the nth parameter to self, where n is the current position in self's formal parameter list, and increments the current position by one. The parameter is passed by value.

RWDBStoredProc& RWDBStoredProc::operator<< ( char  value  ) 

Passes value as the nth parameter to self, where n is the current position in self's formal parameter list, and increments the current position by one. The parameter is passed by value.

RWDBStoredProc& RWDBStoredProc::operator<< ( const RWDBValue value  ) 

Passes value as the nth parameter to self, where n is the current position in self's formal parameter list, and increments the current position by one. The parameter is passed by value.

RWDBStoredProc& RWDBStoredProc::operator<< ( RWDBValueManip  value  ) 

Passes value as the nth parameter to self, where n is the current position in self's formal parameter list, and increments the current position by one. The parameter is passed by value.

RWDBStoredProc& RWDBStoredProc::operator= ( const RWDBStoredProc proc  ) 

Assignment operator. Self shares an implementation with proc.

RWDBStoredProc& RWDBStoredProc::operator[] ( size_t  index  ) 

Self's current row position is set to index. If index is greater than or equal to the number of parameters expected by self, self's status is changed to RWDBStatus::invalidPosition. Returns a reference to self.

RWDBStoredProc& RWDBStoredProc::operator[] ( const RWCString paramName  ) 

Self's current row position is set to the index in self's schema of the first parameter whose name is paramName. If there is no such parameter, self's status changes to RWDBStatus::invalidPosition. Returns a reference to self.

RWDBStoredProc& RWDBStoredProc::operator[] ( const RWDBColumn paramColumn  ) 

Self's current row position is set to the index in self's schema of the first parameter whose name matches that of paramColumn. If there is no such parameter, self's status changes to RWDBStatus::invalidPosition. Returns reference to self.

RWDBSchema RWDBStoredProc::params ( const RWDBConnection connection,
bool  forceLookup = false 
) const

Returns an RWDBSchema, which represents self's formal parameter list. The result is cached in self. If self's internal cache is empty, or if forceLookup is true, the supplied connection is used to obtain schema from the database. Otherwise, returns the cached schema. Returns an empty schema if self has no parameters or if an error occurs. In the latter case, sets self's status to reflect the error.

RWDBSchema RWDBStoredProc::params ( bool  forceLookup = false  )  const

Returns an RWDBSchema which represents self's formal parameter list. The result is cached in self. If self's internal cache is empty, or if forceLookup is true, a default database connection is used to obtain schema from the database. Otherwise, returns the cached schema. Returns an empty schema if self has no parameters or if an error occurs. In the latter case, sets self's status to reflect the error.

void RWDBStoredProc::release (  )  const

Releases a previously acquired mutex. This function can be called from a const object.

Note:
In single-threaded builds, this function evaluates to a no-op.
RWDBValue RWDBStoredProc::returnValue (  )  const

Calls fetchReturnParams(), then, if no error has occurred, obtains the return value of the most recent execution of self in the database and returns it. If there is no return value, or if an error has occurred, returns a NULL RWDBValue. In the latter case sets self's status to reflect the error.

void RWDBStoredProc::setErrorHandler ( RWDBStatus::ErrorHandler  handler  ) 

Installs handler as self's error handler. The supplied handler is inherited by all objects produced by self. By default, an RWDBStatus::ErrorHandler is inherited from the object which produced self; this method overrides the default.

RWDBStatus RWDBStoredProc::status (  )  const

Returns the current status of self.

RWCString RWDBStoredProc::text ( const RWDBConnection connection,
bool  forceLookup = false 
) const

Returns the SQL text used to define the stored procedure encapsulated by self. The result is cached in self. If self's internal cache is empty, or if forceLookup is true, the supplied connection is used to obtain the SQL text from the database. Otherwise, returns the cached text. If unsuccessful, returns an empty string and sets self's status to reflect the error.

RWCString RWDBStoredProc::text ( bool  forceLookup = false  )  const

Returns the SQL text used to define the stored procedure encapsulated by self. The result is cached in self. If self's internal cache is empty, or if forceLookup is true, a default database connection is used to obtain the SQL text from the database. Otherwise, returns the cached text. If unsuccessful, returns an empty string and sets self's status to reflect the error.

 All Classes Functions Variables Typedefs Enumerations Enumerator Friends

© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.