ODBC Server Reference Manual

CORE SQL Language
HP NonStop ODBC Server Reference Manual429151-002
3-11
Escape Clauses
DATETIME data can be converted to DATE, TIME, or TIMESTAMP, depending on the
range of the qualifier. For example, DATETIME YEAR TO MONTH is converted to
DATE; DATETIME HOUR TO HOUR is converted to TIME; DATETIME DAY TO
SECOND is converted to TIMESTAMP. Any missing fields are zero-filled; for example,
DATETIME “1922-03” YEAR TO MONTH is returned as DATE data type with the value
“1922-03-00.”
INTERVAL data type is displayed as a character type, in ANSI format.
Any characters not in the ISO 8859.1 character set (Kanji and the like) are converted to
CHAR or VARCHAR. It is the application’s responsibility to translate them.
Escape Clauses
ODBC defines the following entities as extensions to SQL:
Date, time, and timestamp data
Scalar functions such as numeric, string, and type conversion functions
Outer joins
Stored procedures
To be able to include one of these extensions in a CORE SQL statement, you must
enclose it in an escape clause. An escape clause has the following syntax:
vendor-name
is the name of the company that makes the product that offers the extension.
product-name
is the name of the product that provides the extension.
Because in CORE SQL the vendor’s name is always “Microsoft,” and the product name
is always “ODBC,” you can use a shorthand form of escape-clause syntax that omits
those specifications, as follows:
TIMESTAMP TIMESTAMP
VARCHAR VARCHAR
Others CHAR or VARCHAR, as appropriate
--*( VENDOR(vendor-name), PRODUCT(product-name) extension )*-
-
{ extension }
Table 3-4. Conversion of NonStop SQL/MP Data Types to CORE SQL Data
Types (page 2 of 2)
NonStop SQL/MP Data Type Corresponding CORE SQL Data Type