InterSystems IRIS Data Platform 2019.2  /  InterSystems SQL Reference  /  SQL Functions

InterSystems SQL Reference
Previous section           Next section
InterSystems: The power behind what matters   

A format-transformation function that returns an expression in ODBC format.

%ODBCOUT expression
expression The expression to be converted. A field name, an expression containing a field name, or a function that returns a value in a convertible data type, such as DATE or %List. Cannot be a stream field.
%ODBCOUT returns expression in the ODBC format after passing the value through the field or data type’s LogicalToOdbc method. The ODBC format is the format in which data can be presented via ODBC. This format is used when data is exposed to ODBC/SQL. The available formats correspond to those defined by ODBC.
%ODBCOUT is commonly used on a SELECT list select-item. It can be used in a WHERE clause, but this use is discouraged because using %ODBCOUT prevents the use of indexes on the specified field.
Applying %ODBCOUT changes the column header name to a value such as “Expression_1”; it is therefore usually desirable to specify a column name alias, as shown in the examples below.
Whether %ODBCOUT converts a date depends on the data type returned by the date field or function. %ODBCOUT converts CURDATE, CURRENT_DATE, CURTIME, and CURRENT_TIME values. It does not convert CURRENT_TIMESTAMP, GETDATE, GETUTCDATE, NOW, and $HOROLOG values.
%ODBCOUT is an InterSystems SQL extension.
For further details on display format options, refer to “Data Display Options” in the “InterSystems IRIS SQL Basics” chapter of Using InterSystems SQL.
The following example shows the default display format, the %ODBCIN, and the %ODBCOUT formats for the same field.
SELECT FavoriteColors,%ODBCIN(FavoriteColors) AS InVal,
%ODBCOUT(FavoriteColors) AS OutVal
FROM Sample.Person
See Also

Previous section           Next section
Send us comments on this page
View this book as PDF   |  Download all PDFs
Copyright © 1997-2019 InterSystems Corporation, Cambridge, MA
Content Date/Time: 2019-10-18 05:16:51