SourcePro® API Reference Guide

 
List of all members | Public Member Functions
RWDBBoundExpr Class Reference

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

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)
 
- Public Member Functions inherited from RWDBExpr
 RWDBExpr ()
 
 RWDBExpr (const RWDBExpr &expr)
 
 RWDBExpr (char value)
 
 RWDBExpr (unsigned char value)
 
 RWDBExpr (short value)
 
 RWDBExpr (unsigned short value)
 
 RWDBExpr (int value)
 
 RWDBExpr (unsigned int value)
 
 RWDBExpr (long int value)
 
 RWDBExpr (unsigned long int value)
 
 RWDBExpr (long long value)
 
 RWDBExpr (unsigned long long value)
 
 RWDBExpr (float value)
 
 RWDBExpr (double value)
 
 RWDBExpr (long double value)
 
 RWDBExpr (const char *value)
 
 RWDBExpr (const wchar_t *value)
 
 RWDBExpr (const RWCString &value)
 
 RWDBExpr (const RWDecimalPortable &value)
 
 RWDBExpr (const RWDateTime &value)
 
 RWDBExpr (const RWDBDateTime &value)
 
 RWDBExpr (const RWDBDuration &value)
 
 RWDBExpr (const RWDate &value)
 
 RWDBExpr (const RWTime &value)
 
 RWDBExpr (const RWDBBlob &value)
 
 RWDBExpr (const RWBasicUString &value)
 
 RWDBExpr (const RWDBMBString &value)
 
 RWDBExpr (const RWWString &value)
 
 RWDBExpr (const RWDBValue &value, bool usePhraseBook=true)
 
 RWDBExpr (const RWDBColumn &column)
 
 RWDBExpr (const RWDBSelectorBase &subSelect)
 
 RWDBExpr (RWDBValueManip manip)
 
 RWDBExpr (const RWCollection &collection)
 
 RWDBExpr (const RWDBTable &)
 
 RWDBExpr (const RWDBColumn &left, const RWDBExpr &right)
 
 RWDBExpr (const RWDBColumn &left, const RWDBValue &right)
 
RWCString asString (const RWDBPhraseBook &phraseBook, AsStringControlFlag control=normal) const
 
RWDBCriterion between (const RWDBExpr &expression1, const RWDBExpr &expression2) const
 
RWDBCriterion in (const RWDBExpr &expression1) const
 
RWDBCriterion isNull (void) const
 
bool isValid (void) const
 
RWDBCriterion leftOuterJoin (const RWDBExpr &expression) const
 
RWDBCriterion like (const RWDBExpr &expression1) const
 
RWDBCriterion matchUnique (const RWDBExpr &expression1) const
 
RWDBExproperator= (const RWDBExpr &expr)
 
RWDBCriterion rightOuterJoin (const RWDBExpr &expression) const
 

Additional Inherited Members

- Public Types inherited from RWDBExpr
enum  AsStringControlFlag { normal, suppressTagsOnColumns, noPlaceHolder, placeHolderNotRecommended }
 

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>
See also

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.

Example

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 
)
Deprecated:
As of SourcePro 12.5, use RWDBBoundExpr(RWDateTime*, RWDBNullIndicator*, size_t) instead.

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.

Copyright © 2022 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.