SQL query

The
Embedded database
and
ODBC database
objects support the ANSI SQL-92 standard for related database queries.
TIP: You can run a
DELETE
query to delete a record. You can perform all other operations by using the OPC UA methods exposed by the same objects. For more information on the SQL statements and clauses, see the SQL standard.

Supported statements

  • SELECT
  • DELETE
  • UPDATE

Literal values allowed in a query

You can use these literal values.
  • Boolean expressions
    true
    and
    false
  • Whole numbers, decimals (the decimal separator is
    .
    ), and decimals in scientific notation (for example,
    -1.034E3
    )
  • Text strings delimited by single quotes (for example,
    'string'
    )
    NOTE: You can insert a single quote (
    '
    ) in a text string by doubling (or escaping) it. For example, to write
    'string'
    , you must use two single quotes
    ''string''
    .
  • Date and time in ISO 8601 notation delimited by double quotes (for example,
    "2004-05-23T14:25:10.487"
    ).
    NOTE: The date and time notation is non-standard ANSI SQL and makes it possible to avoid the
    DATE
    ,
    TIME
    , and
    TIMESTAMP
    keywords without ambiguity.

Conventions of data types in a query

You must use the following conventions:
  • Whole numbers are of the
    Int32
    type
  • Decimal numbers are of the
    Double
    type
  • The
    true
    and
    false
    literals are interpreted as s Boolean data type

Identifiers

You can use the following identifiers:
Regular
  • Do not contain spaces
  • Start with an uppercase or lowercase letter
  • Can contain numeric digits, letters, and the underscore character
    _
Delimited
  • Delimited with double quotes (
    "
    )
  • Can contain any character (except for the
    "
    character)
  • Any spaces at the end are ignored
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.