Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
DB Access Module for PostgreSQL User's Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

2.4 Expressions

Although all DB Access Modules 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 DB Access Module for PostgreSQL.

2.4.1 Global Functions

The DB Interface Module provides a predefined set of global functions, which allow an application to build portable SQL expressions.

Table 4 lists restrictions on the global functions associated with RWDBExpr.

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

Function Restriction
rwdbAvg(const RWDBExpr&) None. Corresponds to: AVG(expr)
rwdbCast(const RWDBExpr&,
         const RWDBValue&)
None. Corresponds to:CAST(expr AS type)
rwdbCast(const RWDBExpr&,
         const RWDBValue&,
         const RWDBExpr&)
Same as the two-expression form, as PostgreSQL does not support this form.
rwdbCast(const RWBDExpr&,
         const RWDBValue&, 
         const RWDBExpr&,
         const RWDBExpr&)
Same as the two-expression form, as PostgreSQL does not support this form.
rwdbCharLength(const RWDBExpr&) None. Corresponds to: CHAR_LENGTH(string)
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: CURRENT_USER
rwdbExists(const RWDBSelectorBase&) None. Corresponds to: EXISTS(sel)
rwdbLower(const RWDBExpr&) None. Corresponds to: LOWER(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 str
rwdbPosition(const RWDBExpr&,
             const RWDBExpr&)
None. Corresponds to:POSITION(expr0 IN expr1)
rwdbSessionUser() None. Corresponds to: SESSION_USER
rwdbSubString(const RWDBExpr&,
              const RWDBExpr&)
None. Corresponds to:SUBSTR(expr0,expr1)
rwdbSubString(const RWDBExpr&,
              const RWDBExpr&,
              const RWDBExpr&)
None. Corresponds to:SUBSTR(expr0, expr1, expr2)
rwdbSum(const RWDBExpr&) None. Corresponds to: SUM(expr)
rwdbSystemDateTime() None. Corresponds to: NOW()
rwdbSystemUser() None. Corresponds to: CURRENT_USER
rwdbTrimLeading(const RWDBExpr&,
                const RWDBExpr&)
None. Corresponds to: TRIM(LEADING expr0 FROM expr1)
rwdbTrimTrailing(const RWDBExpr&,
                 const RWDBExpr&)
None. Corresponds to: TRIM(TRAILING expr0 FROM expr1)
rwdbTrimBoth(const RWDBExpr&, 
             const RWDBExpr&)
None. Corresponds to: TRIM(BOTH expr0 FROM expr1)
rwdbUpper(const RWDBExpr&) None. Corresponds to: UPPER(expr)

2.4.2 Outer Joins

PostgreSQL supports the ANSI SQL 92 syntax, so outer joins for PostgreSQL should be written in the FROM clause. See the examples on constructing outer joins in Section 5.3.3.1, "Outer Join Constructs In the FROM Clause (ANSI-Compliant)," in the DB Interface Module User's Guide.

The following example shows an outer join program for PostgreSQL. You can assume that myDbase is a valid instance of RWDBDatabase.

Example 3: An outer join for PostgreSQL using ANSI-compliant syntax



Previous fileTop of DocumentContentsNo linkNext file

Copyright © Rogue Wave Software, Inc. All Rights Reserved.

The Rogue Wave name and logo, and SourcePro, are registered trademarks of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.