Rogue Wave banner
Previous fileTop of DocumentContentsIndexNext file

2.4 Expressions

Although all DBTools.h++ access libraries are implemented through the same interface, there are still differences in the parameters that must be passed to certain expressions. The following section outlines the differences in the Informix Access Library.

2.4.1 Global Functions

DBTools.h++ provides a predefined set of global functions, which allow an application to build portable SQL expressions.

Whenever possible, the Informix Access Library implements each global function through an escape sequence provided by the Informix ODBC Driver. If the Informix ODBC Driver API does not supply an escape sequence analogous to the DBTools.h++ global function, default syntax from the core library is used.

Table 4 lists the ODBC escape sequences or the DBTools.h++ default syntax.

Table 4 -- Restrictions on the use of global functions with RWDBExpr

 
FunctionRestrictions
rwdbAvg(const RWDBExpr&)
None. Corresponds to: AVG(expr)
rwdbCast(const RWDBExpr&,
const RWDBValue&)

Not supported.
rwdbCast(const RWDBExpr&,
const RWDBValue&,
const RWDBExpr&)

Not supported.
rwdbCast(const RWBDExpr&,
const RWDBValue&,
const RWDBExpr&,
const RWDBExpr&)

Not supported.
rwdbCharLength(const RWDBExpr&)
None. Corresponds to: {fn LENGTH(expr)}
rwdbCount(*)
None. Corresponds to: COUNT(*)
rwdbCount(const RWDBExpr&)
None. Corresponds to: COUNT(expr)
rwdbCountDistinct(const RWDBExpr&)
None. Corresponds to:
COUNT(DISTINCT expr)
rwdbCurrentUser()
None. Corresponds to: {fn USER ()}
rwdbExists(const RWDBSelectorBase&)
None. Corresponds to: EXISTS sel
rwdbLower(const RWDBExpr&)
None. Corresponds to: {fn LCASE(expr)}
rwdbMax(const RWDBExpr&)
None. Corresponds to: MAX(expr)
rwdbMin(const RWDBExpr&)
None. Corresponds to: MIN(expr)
rwdbName(const RWCString&,
const RWDBExpr&)

None. Corresponds to: expr AS string
rwdbPosition(const RWDBExpr&,
const RWDBExpr&)

None. Corresponds to:
{fn LOCATE(expr, expr)}
rwdbSessionUser()
None. Corresponds to: {fn USER() }
rwdbSubString(const RWDBExpr&,
const RWDBExpr&)

None. Corresponds to:
{fn SUBSTRING
(expr0, expr1, fn LENGTH(expr0))}

rwdbSubString(const RWDBExpr&,
const RWDBExpr&,
const RWDBExpr&)

None. Corresponds to:
{fn SUBSTRING(expr0, expr1, expr2)}
rwdbSum(const RWDBExpr&)
None. Corresponds to: SUM(expr)
rwdbSystemDateTime()
None. Corresponds to: { fn NOW() }
rwdbSystemUser()
None. Corresponds to: { fn USER() }
rwdbTrimLeading(const RWDBExpr&,
const RWDBExpr&)

None. Default from the core library:
TRIM(LEADING expr FROM expr)
rwdbTrimTrailing(const RWDBExpr&,
const RWDBExpr&)

None. Default from the core library:
TRIM(TRAILING expr FROM expr)

rwdbTrimBoth(const RWDBExpr&,
const RWDBExpr&)

None. Default from the core library:
TRIM(BOTH expr FROM expr)
rwdbUpper(const RWDBExpr&)
None. Corresponds to: {fn UCASE(expr)}

2.4.2 Set Intersection and Difference

Informix does not support the SQL INTERSECTION and DIFFERENCE operators. Hence, use of the * and - operators to combine RWDBSelectors is not supported. However, the SQL UNION operator is supported through the method RWDBCompoundSelector::union_().

To emulate the behavior of INTERSECTION, specify the keywords EXISTS and IN within your WHERE clause.

To emulate the behavior of DIFFERENCE, specify the keywords NOT EXISTS and NOT IN within your WHERE clause.

2.4.3 Matches

Informix uses MATCHES instead of MATCH UNIQUE. Hence, the use of the RWDBColumn::matchUnique() method generates:


Previous fileTop of DocumentContentsIndexNext file

©Copyright 2000, Rogue Wave Software, Inc.
Contact Rogue Wave about documentation or support issues.