
In addition, the range of Oracle numbers exceeds that ofįloating point numbers. Oracle Database uses decimal numbersĪnd these cannot be converted seamlessly to binary number representations like Is not lost when fetching certain numbers. One reason for using an output type handler is to ensure that numeric precision Also see samples such as samples/type_handlers.py Fetched Number Precision ¶ The value None indicates that the default typeĮxamples of output handlers are shown in Fetched Number Precision,įetching LOBs as Strings and Bytes and Fetching Raw Data. Variable object (generally by a call to Cursor.var()) The function is called once for each column that is The parameters are the same information as the query column metadata found inĬscription. Handler ( cursor, name, defaultType, size, precision, scale ) The output type handler is expected to be a function with the following If specified on the connection, allĬursors created by that connection will have their fetch type handling changed. If specified on the cursor, fetch type handling is Output type handlers can be specified on the connection or on the cursor. Output type handlers do not affect values returned from In such cases, an output type handler can be specified for Must be changed in order to prevent data loss or to fit the purposes of the Sometimes the default conversion from an Oracle Database type to a Python type

Changing Fetched Data Types with Output Type Handlers ¶ If it is a scalar value, then that particular If the JSON is an object, then a dict is returned. These include all user-defined types such as VARRAY, NESTED TABLE, etc. The timestamps returned are naive timestamps without any time zone Scale specified), the value will be returned as a float or an intĭepending on whether the value itself is an integer. If the column is unconstrained (no precision and That the value can be expressed as an integer, the value will be If the precision and scale obtained from query column metadata indicate Python object that is returned by default. The middle column gives the type that is returned in the

The following table provides a list of all of the data types that cx_Oracle
