skip to main content
Using the Driver : Parameter Metadata Support : Select Statements
  

Try DataDirect Drivers Now

Select Statements

The driver supports returning parameter metadata for Select statements that contain parameters in ANSI SQL-92 entry-level predicates, for example, such as COMPARISON, BETWEEN, IN, LIKE, and EXISTS predicate constructs. Refer to the ANSI SQL reference for detailed syntax.
Parameter metadata can be returned for a Select statement if the statement contains a predicate value expression that can be targeted against the source tables in the associated FROM clause. For example:

SELECT * FROM foo WHERE bar > ?
In this case, the value expression "bar" can be targeted against the table "foo" to determine the appropriate metadata for the parameter.
The following Select statements show further examples for which parameter metadata can be returned:

SELECT col1, col2 FROM foo WHERE col1 = ? AND col2 > ?
SELECT ... WHERE colname LIKE ?
SELECT ... WHERE colname BETWEEN ? AND ?
SELECT ... WHERE colname IN (?, ?, ?)
Subqueries are supported, but they can only exist in the From clause. In the following example, the second Select statement is a subquery:

SELECT * FROM (SELECT * FROM T1 UNION ALL SELECT * FROM T2) sq
ANSI SQL-92 entry-level predicates in a WHERE clause containing GROUP BY, HAVING, or ORDER BY statements are supported. For example:

SELECT * FROM t1 WHERE col = ? ORDER BY 1
Joins are supported. For example:

SELECT * FROM t1,t2 WHERE t1.col1 = ?
Fully qualified names and aliases are supported. For example:

SELECT A.a, B.b, FROM T1 AS A, T2 AS B WHERE A.a = ? AND B.b = ?"