This shows you the differences between two versions of the page.
dev:sql:functions:cast [2010/07/27 21:12] els |
dev:sql:functions:cast [2016/06/28 22:38] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | {{page>:top_add&nofooter&noeditbtn}} | ||
- | {{page>:sql_bar&nofooter&noeditbtn}} | ||
- | ====== Omnidex SQL Function: CAST ====== | ||
- | ===== Description ===== | ||
- | The CAST function converts an expression to the requested datatype. | ||
- | This function returns the datatype requested in the function. | ||
- | ===== Syntax ===== | ||
- | |||
- | CAST(expression AS datatype) | ||
- | |||
- | == expression == | ||
- | |||
- | Required. An expression using SQL language that produces a value. A scalar expression is generally equivalent to a select item in the SQL SELECT statement, and can be a character expression, numeric expression or date expression. | ||
- | |||
- | == datatype == | ||
- | Required. One of the datatypes listed below: | ||
- | |||
- | {{page>dev:appendix:reference:datatypes_insert&noheader&nofooter&noeditbtn}} | ||
- | |||
- | Omnidex also provides partial support for National Character Datatypes (sometimes called Unicode datatypes or wide characters). The Omnidex SQL Engine will process these datatypes, but the Omnidex Indexing Engine will only index the lower 8 bits of these datatypes. | ||
- | |||
- | {{page>dev:appendix:reference:natl_datatypes_insert&noheader&nofooter&noeditbtn}} | ||
- | |||
- | ===== Example ===== | ||
- | ==== Example 1: CAST of column ==== | ||
- | |||
- | <code> | ||
- | > select cast(individual as integer) ind from individuals; | ||
- | |||
- | IND | ||
- | ----------- | ||
- | 900011022 | ||
- | 900047761 | ||
- | 900047762 | ||
- | 900067115 | ||
- | 900067114 | ||
- | 900215567 | ||
- | 900240828 | ||
- | </code> | ||
- | |||
- | |||
- | ====== Additional Resources ====== | ||
- | |||
- | See also: | ||
- | {{page>dev:sql:functions:see_also_utility&noheader&nofooter&noeditbtn}} | ||
- | |||
- | |||
- | {{page>:bottom_add&nofooter&noeditbtn}} |