SourcePro® API Reference Guide

 
Loading...
Searching...
No Matches
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 (double *valuePtr, RWDBNullIndicator *nullIndicator=NULL, size_t entries=1)
 
 RWDBBoundExpr (float *valuePtr, RWDBNullIndicator *nullIndicator=NULL, size_t entries=1)
 
 RWDBBoundExpr (int *i, RWDBNullIndicator *nullIndicator=NULL, size_t entries=1)
 
 RWDBBoundExpr (long *valuePtr, RWDBNullIndicator *nullIndicator=NULL, size_t entries=1)
 
 RWDBBoundExpr (long double *valuePtr, RWDBNullIndicator *nullIndicator=NULL, size_t entries=1)
 
 RWDBBoundExpr (long long *valuePtr, RWDBNullIndicator *nullIndicator=NULL, size_t entries=1)
 
 RWDBBoundExpr (RWBasicUString *valuePtr, RWDBNullIndicator *nullIndicator=NULL, size_t entries=1)
 
 RWDBBoundExpr (RWCString *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 (RWDBBlob *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 (RWDBMBString *valuePtr, RWDBNullIndicator *nullIndicator=NULL, size_t entries=1)
 
 RWDBBoundExpr (RWDecimalPortable *valuePtr, RWDBNullIndicator *nullIndicator=NULL, size_t entries=1)
 
 RWDBBoundExpr (RWWString *valuePtr, RWDBNullIndicator *nullIndicator=NULL, size_t entries=1)
 
 RWDBBoundExpr (short *valuePtr, RWDBNullIndicator *nullIndicator=NULL, size_t entries=1)
 
 RWDBBoundExpr (unsigned int *valuePtr, RWDBNullIndicator *nullIndicator=NULL, size_t entries=1)
 
 RWDBBoundExpr (unsigned long *valuePtr, RWDBNullIndicator *nullIndicator=NULL, size_t entries=1)
 
 RWDBBoundExpr (unsigned long long *valuePtr, RWDBNullIndicator *nullIndicator=NULL, size_t entries=1)
 
 RWDBBoundExpr (unsigned short *valuePtr, RWDBNullIndicator *nullIndicator=NULL, size_t entries=1)
 
- Public Member Functions inherited from RWDBExpr
 RWDBExpr ()
 
 RWDBExpr (char value)
 
 RWDBExpr (const char *value)
 
 RWDBExpr (const RWBasicUString &value)
 
 RWDBExpr (const RWCollection &collection)
 
 RWDBExpr (const RWCString &value)
 
 RWDBExpr (const RWDate &value)
 
 RWDBExpr (const RWDateTime &value)
 
 RWDBExpr (const RWDBBlob &value)
 
 RWDBExpr (const RWDBColumn &column)
 
 RWDBExpr (const RWDBColumn &left, const RWDBExpr &right)
 
 RWDBExpr (const RWDBColumn &left, const RWDBValue &right)
 
 RWDBExpr (const RWDBDateTime &value)
 
 RWDBExpr (const RWDBDuration &value)
 
 RWDBExpr (const RWDBExpr &expr)
 
 RWDBExpr (const RWDBMBString &value)
 
 RWDBExpr (const RWDBSelectorBase &subSelect)
 
 RWDBExpr (const RWDBTable &)
 
 RWDBExpr (const RWDBValue &value, bool usePhraseBook=true)
 
 RWDBExpr (const RWDecimalPortable &value)
 
 RWDBExpr (const RWTime &value)
 
 RWDBExpr (const RWWString &value)
 
 RWDBExpr (const wchar_t *value)
 
 RWDBExpr (double value)
 
 RWDBExpr (float value)
 
 RWDBExpr (int value)
 
 RWDBExpr (long double value)
 
 RWDBExpr (long int value)
 
 RWDBExpr (long long value)
 
 RWDBExpr (RWDBValueManip manip)
 
 RWDBExpr (short value)
 
 RWDBExpr (unsigned char value)
 
 RWDBExpr (unsigned int value)
 
 RWDBExpr (unsigned long int value)
 
 RWDBExpr (unsigned long long value)
 
 RWDBExpr (unsigned short value)
 
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
Represents an explicit database connection object that can be used in place of the implicit database ...
Definition connect.h:81
Encapsulates an SQL INSERT statement.
Definition inserter.h:177
RWDBResult execute()
Provides a way to determine whether some given data is NULL.
Definition nullind.h:86
Base class for a family of classes that represent the abstract notion of a database table in a number...
Definition table.h:89
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() [1/22]

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() [2/22]

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() [3/22]

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() [4/22]

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() [5/22]

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() [6/22]

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() [7/22]

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() [8/22]

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() [9/22]

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() [10/22]

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() [11/22]

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() [12/22]

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() [13/22]

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() [14/22]

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() [15/22]

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() [16/22]

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() [17/22]

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() [18/22]

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() [19/22]

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() [20/22]

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() [21/22]

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() [22/22]

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 © 2024 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.