IBM Books

Call Level Interface Guide and Reference

ODBC Outer Join Syntax

The ODBC escape clause for outer join is:

    {oj outer-join}
where outer join is
      table-name  {LEFT | RIGHT | FULL} OUTER JOIN
                  {table-name | outer-join}
                  ON search-condition

For example, DB2 CLI will translate the following statement:

    SELECT * FROM {oj T1 LEFT OUTER JOIN T2 ON T1.C1=T2.C3}
        WHERE T1.C2>20

to IBM's format, which corresponds to the SQL92 outer join syntax.

    SELECT * FROM T1 LEFT OUTER JOIN T2 ON T1.C1=T2.C3 WHERE T1.C2>20
Note:Not all DB2 servers support outer join. To determine if the current server supports outer joins, call SQLGetInfo() with the SQL_SQL92_RELATIONAL_JOIN_OPERATORS and SQL_OJ_CAPABILITIES options.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]