InterSystems SQL Reference
A format-transformation function that returns an expression in ODBC format.
||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.
%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
Content Date/Time: 2019-10-18 05:16:51