rwlogo
SourcePro C++ 12.0

SourcePro® C++ API Reference Guide



   SourcePro C++
Documentation Home

RWDBBoundExpr Class Reference
[Expressions]

Acts as a placeholder in a dynamic SQL statement, providing a type-safe interface for binding a local variable to a dynamic SQL statement. More...

#include <rw/db/expr.h>

Inheritance diagram for RWDBBoundExpr:
RWDBExpr

List of all members.

Public Member Functions

 RWDBBoundExpr ()
 RWDBBoundExpr (short *valuePtr, RWDBNullIndicator *nullIndicator=NULL, size_t entries=1)
 RWDBBoundExpr (unsigned short *valuePtr, RWDBNullIndicator *nullIndicator=NULL, size_t entries=1)
 RWDBBoundExpr (int *i, RWDBNullIndicator *nullIndicator=NULL, size_t entries=1)
 RWDBBoundExpr (unsigned int *valuePtr, RWDBNullIndicator *nullIndicator=NULL, size_t entries=1)
 RWDBBoundExpr (long *valuePtr, RWDBNullIndicator *nullIndicator=NULL, size_t entries=1)
 RWDBBoundExpr (unsigned long *valuePtr, RWDBNullIndicator *nullIndicator=NULL, size_t entries=1)
 RWDBBoundExpr (long long *valuePtr, RWDBNullIndicator *nullIndicator=NULL, size_t entries=1)
 RWDBBoundExpr (unsigned long long *valuePtr, RWDBNullIndicator *nullIndicator=NULL, size_t entries=1)
 RWDBBoundExpr (float *valuePtr, RWDBNullIndicator *nullIndicator=NULL, size_t entries=1)
 RWDBBoundExpr (double *valuePtr, RWDBNullIndicator *nullIndicator=NULL, size_t entries=1)
 RWDBBoundExpr (long double *valuePtr, RWDBNullIndicator *nullIndicator=NULL, size_t entries=1)
 RWDBBoundExpr (RWCString *valuePtr, RWDBNullIndicator *nullIndicator=NULL, size_t entries=1)
 RWDBBoundExpr (RWDecimalPortable *valuePtr, RWDBNullIndicator *nullIndicator=NULL, size_t entries=1)
 RWDBBoundExpr (RWDate *valuePtr, RWDBNullIndicator *nullIndicator=NULL, size_t entries=1)
 RWDBBoundExpr (RWDateTime *valuePtr, RWDBNullIndicator *nullIndicator=NULL, size_t entries=1)
 RWDBBoundExpr (RWDBDateTime *valuePtr, RWDBNullIndicator *nullIndicator=NULL, size_t entries=1)
 RWDBBoundExpr (RWDBDuration *valuePtr, RWDBNullIndicator *nullIndicator=NULL, size_t entries=1)
 RWDBBoundExpr (RWDBBlob *valuePtr, RWDBNullIndicator *nullIndicator=NULL, size_t entries=1)
 RWDBBoundExpr (RWDBMBString *valuePtr, RWDBNullIndicator *nullIndicator=NULL, size_t entries=1)
 RWDBBoundExpr (RWBasicUString *valuePtr, RWDBNullIndicator *nullIndicator=NULL, size_t entries=1)
 RWDBBoundExpr (RWWString *valuePtr, RWDBNullIndicator *nullIndicator=NULL, size_t entries=1)

Detailed Description

RWDBBoundExpr is a specialized type of RWDBExpr that is evaluated as a placeholder within a dynamic SQL statement. It provides a type-safe interface that allows applications to bind a local variable and an optional null indicator to a dynamic SQL statement.

Synopsis

 #include <rw/db/expr.h>

Related Classes

RWDBBoundExpr can be used in conjunction with any other expression classes and operators, such as RWDBAssignment.

Other classes that use RWDBBoundExpr include RWDBSelector, RWDBDeleter, RWDBInserter, and RWDBUpdater.

Examples

In this example, an RWDBBoundExpr is created and shifted into an RWDBInserter. The RWDBInserter is then executed several times after changing the bound local variable.

 RWDBConnection connection = myDbase.connection();
 RWDBTable myTable = myDbase.table("myTable");
 RWDBInserter inserter = myDbase.inserter( myTable );
 RWDBNullIndicator nullIndicator = 0;
 float avg = .453;
 inserter << RWDBBoundExpr(&avg, &nullIndicator);
 inserter.execute( connection );            // Insert .453.

 nullIndicator = RWDBNullIndicator(true);   // Set to true.
 inserter.execute( connection );            // Insert null.

 nullIndicator = RWDBNullIndicator(false);  // Set to false.
 avg = .329;
 inserter.execute( connection );            // Insert .329
Note:
An explicit connection is used for each execution of the RWDBInserter. The application must ensure that the bound local variable and the RWDBNullIndicator pointed to by the optional null indicator remain in scope for all executions.

Constructor & Destructor Documentation

RWDBBoundExpr::RWDBBoundExpr (  ) 

The default constructor builds an empty RWDBBoundExpr. An empty RWDBBoundExpr is one whose method asString(const RWDBPhraseBook& phraseBook) returns an SQL NULL keyword, as specified in phraseBook.

RWDBBoundExpr::RWDBBoundExpr ( short *  valuePtr,
RWDBNullIndicator nullIndicator = NULL,
size_t  entries = 1 
)

Creates an RWDBBoundExpr from the given value, and an optional pointer to a null indicator. Sets entries to 1, where entries is the number of entries that valuePtr and nullIndicator point to, and 1 is the only currently supported value.

When the asString() method expands in the context of a dynamic SQL statement, the RWDBBoundExpr becomes a placeholder, with syntax that varies among Access Modules. The application's value and the dynamic SQL statement are then considered bound. If the optional pointer to a null indicator is passed, the bound value is treated as NULL when the value pointed at by nullIndicator is nonzero.

RWDBBoundExpr::RWDBBoundExpr ( unsigned short *  valuePtr,
RWDBNullIndicator nullIndicator = NULL,
size_t  entries = 1 
)

Creates an RWDBBoundExpr from the given value, and an optional pointer to a null indicator. Sets entries to 1, where entries is the number of entries that valuePtr and nullIndicator point to, and 1 is the only currently supported value.

When the asString() method expands in the context of a dynamic SQL statement, the RWDBBoundExpr becomes a placeholder, with syntax that varies among Access Modules. The application's value and the dynamic SQL statement are then considered bound. If the optional pointer to a null indicator is passed, the bound value is treated as NULL when the value pointed at by nullIndicator is nonzero.

RWDBBoundExpr::RWDBBoundExpr ( int *  i,
RWDBNullIndicator nullIndicator = NULL,
size_t  entries = 1 
)

Creates an RWDBBoundExpr from the given value, and an optional pointer to a null indicator. Sets entries to 1, where entries is the number of entries that valuePtr and nullIndicator point to, and 1 is the only currently supported value.

When the asString() method expands in the context of a dynamic SQL statement, the RWDBBoundExpr becomes a placeholder, with syntax that varies among Access Modules. The application's value and the dynamic SQL statement are then considered bound. If the optional pointer to a null indicator is passed, the bound value is treated as NULL when the value pointed at by nullIndicator is nonzero.

RWDBBoundExpr::RWDBBoundExpr ( unsigned int *  valuePtr,
RWDBNullIndicator nullIndicator = NULL,
size_t  entries = 1 
)

Creates an RWDBBoundExpr from the given value, and an optional pointer to a null indicator. Sets entries to 1, where entries is the number of entries that valuePtr and nullIndicator point to, and 1 is the only currently supported value.

When the asString() method expands in the context of a dynamic SQL statement, the RWDBBoundExpr becomes a placeholder, with syntax that varies among Access Modules. The application's value and the dynamic SQL statement are then considered bound. If the optional pointer to a null indicator is passed, the bound value is treated as NULL when the value pointed at by nullIndicator is nonzero.

RWDBBoundExpr::RWDBBoundExpr ( long *  valuePtr,
RWDBNullIndicator nullIndicator = NULL,
size_t  entries = 1 
)

Creates an RWDBBoundExpr from the given value, and an optional pointer to a null indicator. Sets entries to 1, where entries is the number of entries that valuePtr and nullIndicator point to, and 1 is the only currently supported value.

When the asString() method expands in the context of a dynamic SQL statement, the RWDBBoundExpr becomes a placeholder, with syntax that varies among Access Modules. The application's value and the dynamic SQL statement are then considered bound. If the optional pointer to a null indicator is passed, the bound value is treated as NULL when the value pointed at by nullIndicator is nonzero.

RWDBBoundExpr::RWDBBoundExpr ( unsigned long *  valuePtr,
RWDBNullIndicator nullIndicator = NULL,
size_t  entries = 1 
)

Creates an RWDBBoundExpr from the given value, and an optional pointer to a null indicator. Sets entries to 1, where entries is the number of entries that valuePtr and nullIndicator point to, and 1 is the only currently supported value.

When the asString() method expands in the context of a dynamic SQL statement, the RWDBBoundExpr becomes a placeholder, with syntax that varies among Access Modules. The application's value and the dynamic SQL statement are then considered bound. If the optional pointer to a null indicator is passed, the bound value is treated as NULL when the value pointed at by nullIndicator is nonzero.

RWDBBoundExpr::RWDBBoundExpr ( long long *  valuePtr,
RWDBNullIndicator nullIndicator = NULL,
size_t  entries = 1 
)

Creates an RWDBBoundExpr from the given value, and an optional pointer to a null indicator. Sets entries to 1, where entries is the number of entries that valuePtr and nullIndicator point to, and 1 is the only currently supported value.

When the asString() method expands in the context of a dynamic SQL statement, the RWDBBoundExpr becomes a placeholder, with syntax that varies among Access Modules. The application's value and the dynamic SQL statement are then considered bound. If the optional pointer to a null indicator is passed, the bound value is treated as NULL when the value pointed at by nullIndicator is nonzero.

RWDBBoundExpr::RWDBBoundExpr ( unsigned long long *  valuePtr,
RWDBNullIndicator nullIndicator = NULL,
size_t  entries = 1 
)

Creates an RWDBBoundExpr from the given value, and an optional pointer to a null indicator. Sets entries to 1, where entries is the number of entries that valuePtr and nullIndicator point to, and 1 is the only currently supported value.

When the asString() method expands in the context of a dynamic SQL statement, the RWDBBoundExpr becomes a placeholder, with syntax that varies among Access Modules. The application's value and the dynamic SQL statement are then considered bound. If the optional pointer to a null indicator is passed, the bound value is treated as NULL when the value pointed at by nullIndicator is nonzero.

RWDBBoundExpr::RWDBBoundExpr ( float *  valuePtr,
RWDBNullIndicator nullIndicator = NULL,
size_t  entries = 1 
)

Creates an RWDBBoundExpr from the given value, and an optional pointer to a null indicator. Sets entries to 1, where entries is the number of entries that valuePtr and nullIndicator point to, and 1 is the only currently supported value.

When the asString() method expands in the context of a dynamic SQL statement, the RWDBBoundExpr becomes a placeholder, with syntax that varies among Access Modules. The application's value and the dynamic SQL statement are then considered bound. If the optional pointer to a null indicator is passed, the bound value is treated as NULL when the value pointed at by nullIndicator is nonzero.

RWDBBoundExpr::RWDBBoundExpr ( double *  valuePtr,
RWDBNullIndicator nullIndicator = NULL,
size_t  entries = 1 
)

Creates an RWDBBoundExpr from the given value, and an optional pointer to a null indicator. Sets entries to 1, where entries is the number of entries that valuePtr and nullIndicator point to, and 1 is the only currently supported value.

When the asString() method expands in the context of a dynamic SQL statement, the RWDBBoundExpr becomes a placeholder, with syntax that varies among Access Modules. The application's value and the dynamic SQL statement are then considered bound. If the optional pointer to a null indicator is passed, the bound value is treated as NULL when the value pointed at by nullIndicator is nonzero.

RWDBBoundExpr::RWDBBoundExpr ( long double *  valuePtr,
RWDBNullIndicator nullIndicator = NULL,
size_t  entries = 1 
)

Creates an RWDBBoundExpr from the given value, and an optional pointer to a null indicator. Sets entries to 1, where entries is the number of entries that valuePtr and nullIndicator point to, and 1 is the only currently supported value.

When the asString() method expands in the context of a dynamic SQL statement, the RWDBBoundExpr becomes a placeholder, with syntax that varies among Access Modules. The application's value and the dynamic SQL statement are then considered bound. If the optional pointer to a null indicator is passed, the bound value is treated as NULL when the value pointed at by nullIndicator is nonzero.

RWDBBoundExpr::RWDBBoundExpr ( RWCString valuePtr,
RWDBNullIndicator nullIndicator = NULL,
size_t  entries = 1 
)

Creates an RWDBBoundExpr from the given value, and an optional pointer to a null indicator. Sets entries to 1, where entries is the number of entries that valuePtr and nullIndicator point to, and 1 is the only currently supported value.

When the asString() method expands in the context of a dynamic SQL statement, the RWDBBoundExpr becomes a placeholder, with syntax that varies among Access Modules. The application's value and the dynamic SQL statement are then considered bound. If the optional pointer to a null indicator is passed, the bound value is treated as NULL when the value pointed at by nullIndicator is nonzero.

RWDBBoundExpr::RWDBBoundExpr ( RWDecimalPortable valuePtr,
RWDBNullIndicator nullIndicator = NULL,
size_t  entries = 1 
)

Creates an RWDBBoundExpr from the given value, and an optional pointer to a null indicator. Sets entries to 1, where entries is the number of entries that valuePtr and nullIndicator point to, and 1 is the only currently supported value.

When the asString() method expands in the context of a dynamic SQL statement, the RWDBBoundExpr becomes a placeholder, with syntax that varies among Access Modules. The application's value and the dynamic SQL statement are then considered bound. If the optional pointer to a null indicator is passed, the bound value is treated as NULL when the value pointed at by nullIndicator is nonzero.

RWDBBoundExpr::RWDBBoundExpr ( RWDate valuePtr,
RWDBNullIndicator nullIndicator = NULL,
size_t  entries = 1 
)

Creates an RWDBBoundExpr from the given value, and an optional pointer to a null indicator. Sets entries to 1, where entries is the number of entries that valuePtr and nullIndicator point to, and 1 is the only currently supported value.

When the asString() method expands in the context of a dynamic SQL statement, the RWDBBoundExpr becomes a placeholder, with syntax that varies among Access Modules. The application's value and the dynamic SQL statement are then considered bound. If the optional pointer to a null indicator is passed, the bound value is treated as NULL when the value pointed at by nullIndicator is nonzero.

RWDBBoundExpr::RWDBBoundExpr ( RWDateTime valuePtr,
RWDBNullIndicator nullIndicator = NULL,
size_t  entries = 1 
)

Creates an RWDBBoundExpr from the given value, and an optional pointer to a null indicator. Sets entries to 1, where entries is the number of entries that valuePtr and nullIndicator point to, and 1 is the only currently supported value.

When the asString() method expands in the context of a dynamic SQL statement, the RWDBBoundExpr becomes a placeholder, with syntax that varies among Access Modules. The application's value and the dynamic SQL statement are then considered bound. If the optional pointer to a null indicator is passed, the bound value is treated as NULL when the value pointed at by nullIndicator is nonzero.

RWDBBoundExpr::RWDBBoundExpr ( RWDBDateTime valuePtr,
RWDBNullIndicator nullIndicator = NULL,
size_t  entries = 1 
)

Creates an RWDBBoundExpr from the given value, and an optional pointer to a null indicator. Sets entries to 1, where entries is the number of entries that valuePtr and nullIndicator point to, and 1 is the only currently supported value.

When the asString() method expands in the context of a dynamic SQL statement, the RWDBBoundExpr becomes a placeholder, with syntax that varies among Access Modules. The application's value and the dynamic SQL statement are then considered bound. If the optional pointer to a null indicator is passed, the bound value is treated as NULL when the value pointed at by nullIndicator is nonzero.

RWDBBoundExpr::RWDBBoundExpr ( RWDBDuration valuePtr,
RWDBNullIndicator nullIndicator = NULL,
size_t  entries = 1 
)

Creates an RWDBBoundExpr from the given value, and an optional pointer to a null indicator. Sets entries to 1, where entries is the number of entries that valuePtr and nullIndicator point to, and 1 is the only currently supported value.

When the asString() method expands in the context of a dynamic SQL statement, the RWDBBoundExpr becomes a placeholder, with syntax that varies among Access Modules. The application's value and the dynamic SQL statement are then considered bound. If the optional pointer to a null indicator is passed, the bound value is treated as NULL when the value pointed at by nullIndicator is nonzero.

RWDBBoundExpr::RWDBBoundExpr ( RWDBBlob valuePtr,
RWDBNullIndicator nullIndicator = NULL,
size_t  entries = 1 
)

Creates an RWDBBoundExpr from the given value, and an optional pointer to a null indicator. Sets entries to 1, where entries is the number of entries that valuePtr and nullIndicator point to, and 1 is the only currently supported value.

When the asString() method expands in the context of a dynamic SQL statement, the RWDBBoundExpr becomes a placeholder, with syntax that varies among Access Modules. The application's value and the dynamic SQL statement are then considered bound. If the optional pointer to a null indicator is passed, the bound value is treated as NULL when the value pointed at by nullIndicator is nonzero.

RWDBBoundExpr::RWDBBoundExpr ( RWDBMBString valuePtr,
RWDBNullIndicator nullIndicator = NULL,
size_t  entries = 1 
)

Creates an RWDBBoundExpr from the given value, and an optional pointer to a null indicator. Sets entries to 1, where entries is the number of entries that valuePtr and nullIndicator point to, and 1 is the only currently supported value.

When the asString() method expands in the context of a dynamic SQL statement, the RWDBBoundExpr becomes a placeholder, with syntax that varies among Access Modules. The application's value and the dynamic SQL statement are then considered bound. If the optional pointer to a null indicator is passed, the bound value is treated as NULL when the value pointed at by nullIndicator is nonzero.

RWDBBoundExpr::RWDBBoundExpr ( RWBasicUString valuePtr,
RWDBNullIndicator nullIndicator = NULL,
size_t  entries = 1 
)

Creates an RWDBBoundExpr from the given value, and an optional pointer to a null indicator. Sets entries to 1, where entries is the number of entries that valuePtr and nullIndicator point to, and 1 is the only currently supported value.

When the asString() method expands in the context of a dynamic SQL statement, the RWDBBoundExpr becomes a placeholder, with syntax that varies among Access Modules. The application's value and the dynamic SQL statement are then considered bound. If the optional pointer to a null indicator is passed, the bound value is treated as NULL when the value pointed at by nullIndicator is nonzero.

RWDBBoundExpr::RWDBBoundExpr ( RWWString valuePtr,
RWDBNullIndicator nullIndicator = NULL,
size_t  entries = 1 
)

Creates an RWDBBoundExpr from the given value, and an optional pointer to a null indicator. Sets entries to 1, where entries is the number of entries that valuePtr and nullIndicator point to, and 1 is the only currently supported value.

When the asString() method expands in the context of a dynamic SQL statement, the RWDBBoundExpr becomes a placeholder, with syntax that varies among Access Modules. The application's value and the dynamic SQL statement are then considered bound. If the optional pointer to a null indicator is passed, the bound value is treated as NULL when the value pointed at by nullIndicator is nonzero.

 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.