The SQL Grammar

[This is preliminary documentation and subject to change.]

The adapter supports a subset of the ODBC Minimum SQL Grammar. It does not support Data Definition Language (DDL) constructs and writeable Data Manipulation Language (DML) constructs. If the data provider supports queries, the adapter decomposes the ODBC Minimum SQL into a series of WBEM Level 1 queries, and then passes them to the data provider. Thus, queries can be optimized for specific data providers.

ODBC Minimum SQL Grammar

select-statement::= SELECT [ALL|DISTINCT] select-list

FROM table-reference-list

[WHERE search-condition]

[order-by-clause]

select-list::= * | select-sublist[,select-sublist]
select-sublist::= expression
expression::= term|expression {+|-} term
term::= factor | term {*|/} factor
factor::= [+|-] primary
primary:: column-name |

dynamic-parameter |

literal |

(expression)

dynamic-parameter:= ?
literal::= character-string-literal
character-string-literal::= '{character}...'
character::= our character set
column-name::= [table-name.]column-identifier
column-identifier::= user-defined-name
user-defined-name::= letter[digit|letter|_]...
table-reference-list::= table-reference[table-reference]..
table-reference::= table-name
table-name::= table-identifier
table-identifier::= user-defined-name
search-condition::= boolean-term [OR search-condition]
boolean-term::= boolean-factor [AND boolean-term]
boolean-factor::= [NOT]boolean-primary
boolean-primary::= predicate | (search-condition)
predicate::= comparison-predicate |

like-predicate |

null-predicate

comparison-predicate::= expression comparison-operator expression
comparison-operator::= <|>|<=|>=|=|<>
like-predicate::= expression [NOT] LIKE
pattern-value::= character-string-literal | dynamic-parameter
null-predicate::= column-name IS [NOT] NULL
order-by-clause::= ORDER BY sort-specification[,sort-specification]
sort-specification::= {unsigned-integer | column} [ASC |DESC]

In Level 1 provider SQL grammar, all operations are on a single table, and dynamic parameters are not supported. This grammar can be converted into postfix notation, which means the functions are preceded by all their operands, to facilitate the implementation of a simpler stack-based SQL parser in the data provider.

Level 1 Provider SQL Grammar

select-statement::= SELECT [ALL|DISTINCT] select-list

FROM table-reference

[WHERE search-condition]

[order-by-clause]

select-list::= * | select-sublist[,select-sublist]
select-sublist::= expression
expression::= term|expression {+|-} term
term::= factor | term {*|/} factor
factor::= [+|-] primary
primary:: column-name |

literal |

(expression)

literal::= character-string-literal
character-string-literal::= '{character}...'
character::= our character set
column-name::= [table-name.]column-identifier
column-identifier::= user-defined-name
user-defined-name::= letter[digit|letter|_]...
table-reference::= table-name
table-name::= table-identifier
table-identifier::= user-defined-name
search-condition::= boolean-term [OR search-condition]
boolean-term::= boolean-factor [AND boolean-term]
boolean-factor::= [NOT]boolean-primary
boolean-primary::= predicate | (search-condition)
predicate::= comparison-predicate |

like-predicate |

null-predicate

comparison-predicate::= expression comparison-operator expression
comparison-operator::= <|>|<=|>=|=|<>
like-predicate::= expression [NOT] LIKE
pattern-value::= character-string-literal | dynamic-parameter
null-predicate::= column-name IS [NOT] NULL
order-by-clause::= ORDER BY sort-specification[,sort-specification]
sort-specification::= {unsigned-integer | column} [ASC |DESC]