OpenPetra
Free Administration Software for Non-Profits
|
A list of parameters which should be expanded into an ‘IN (?)’ context. More...
Public Member Functions | |
TDbListParameterValue (String name, OdbcType type, IEnumerable value) | |
Create a list parameter, such as is used for 'column IN (?)' in SQL queries, from any IEnumerable object. More... | |
IEnumerator | GetEnumerator () |
Get the generic IEnumerator over the sub-OdbcParameters. More... | |
override String | ToString () |
Represent this list of parameters as a string, using each value's ToString() method. More... | |
Static Public Member Functions | |
static OdbcParameter | OdbcListParameterValue (String name, OdbcType type, IEnumerable value) |
Convenience method for creating an OdbcParameter with an appropriate TDbListParameterValue as a value. More... | |
Public Attributes | |
OdbcParameter | OdbcParam |
The OdbcParameter from which sub-parameters are Clone()d. More... | |
A list of parameters which should be expanded into an ‘IN (?)’ context.
Simply use the following style in your .sql file:
Then, to test if column
is the string "First"
, "Second"
, or "Third"
, set the OdbcParameter.Value
property to a TDbListParameterValue
instance. You can use the TDbListParameterValue.OdbcListParameterValue()
function to produce an OdbcParameter
with an appropriate Value
property.
|
inline |
Create a list parameter, such as is used for 'column IN (?)' in SQL queries, from any IEnumerable object.
name | The ParameterName to use when creating OdbcParameters. |
type | The OdbcType of the produced OdbcParameters. |
value | An enumerable collection of objects. If there are no objects in the enumeration, then the resulting query will look like column IN (NULL) because column IN () is invalid. To avoid the case where the query should not match any rows and column may be NULL, use an expression like (? AND column IN (?) . Set the first parameter to FALSE if the list is empty and TRUE otherwise so that the prepared statement remains both syntactically and semantically valid. |
|
inline |
Get the generic IEnumerator over the sub-OdbcParameters.
|
inlinestatic |
Convenience method for creating an OdbcParameter with an appropriate TDbListParameterValue
as a value.
|
inline |
Represent this list of parameters as a string, using each value's ToString()
method.
OdbcParameter Ict.Common.DB.TDbListParameterValue.OdbcParam |
The OdbcParameter from which sub-parameters are Clone()d.