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 expressionstrueandfalse
- 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 theDATE,TIME, andTIMESTAMPkeywords without ambiguity.
Conventions of data types in a query
You must use the following conventions:
- Whole numbers are of theInt32type
- Decimal numbers are of theDoubletype
- Thetrueandfalseliterals 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