Hitachi

Hitachi Advanced Database Application Development Guide


15.1.5 Access to tables that define array-type columns

When accessing an array-type column using the ODBC driver, you must specify an array element reference with an unsigned integer literal as the array index. An example follows. Assume that column C1 of table T1 is an array-type column.

Example:
  • Example of an executable SQL statement

    SELECT "C1"[1],"C1"[2] FROM "T1"
    SELECT "C1"[1] FROM "T1" WHERE "C1"[2]=?

    The above SQL statement can be executed because it specifies an array element reference with an unsigned integer literal as the array index.

  • Example of a non-executable SQL statement

    SELECT "C1" FROM "T1"
    SELECT "C1[1]" FROM T1 WHERE "C1"=?

    The above SQL statement cannot be executed because it does not specify the array element reference in a form that uses an unsigned integer literal as the array index.

For array indexes and array element references, refer to the Array Element Reference in the manual HADB SQL Reference.