Skip to content

Commit

Permalink
#413: Improved documentation on ORACLE_CAST_NUMBER_TO_DECIMAL_WITH_PR…
Browse files Browse the repository at this point in the history
…ECISION_AND_SCALE (#417)

* #413: Improved documentation on ORACLE_CAST_NUMBER_TO_DECIMAL_WITH_PRECISION_AND_SCALE
  • Loading branch information
jakobbraun authored Nov 30, 2020
1 parent a9f299d commit fc3b5df
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
1 change: 1 addition & 0 deletions doc/changes/changes_4.0.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
## Documentation

* #408: Removed PostgreSQL dialect documentation as it has been migrated to https://github.com/exasol/postgresql-virtual-schema.
* #413: Improved documentation on `ORACLE_CAST_NUMBER_TO_DECIMAL_WITH_PRECISION_AND_SCALE`

## Refactoring

Expand Down
21 changes: 18 additions & 3 deletions doc/dialects/oracle.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,24 @@ The Oracle dialect does not support all capabilities. A complete list can be fou

`NUMBER`, `NUMBER with precision > 36` and `LONG` are casted to `VARCHAR` to prevent a loss of precision.

If you want to return a DECIMAL type for these types you can set the property ORACLE_CAST_NUMBER_TO_DECIMAL_WITH_PRECISION_AND_SCALE:
This will cast NUMBER with precision > 36, NUMBER without precision and LONG to DECIMAL(36,20).
Keep in mind that this will yield errors if the data in the Oracle database does not fit into the specified DECIMAL type.
If you want to return a DECIMAL type for these types you can set the property `ORACLE_CAST_NUMBER_TO_DECIMAL_WITH_PRECISION_AND_SCALE` to `<scale>,<precision>`.
This will cast values of such types to `DECIMAL(<scale>,<precision>)`.

For example:

```java
CREATE VIRTUAL SCHEMA <virtual schema name>
USING ADAPTER.JDBC_ADAPTER
WITH
SQL_DIALECT = 'ORACLE'
CONNECTION_NAME = 'ORACLE_JDBC_CONNECTION'
SCHEMA_NAME = '<schema name>'
IMPORT_FROM_ORA = 'true'
ORACLE_CAST_NUMBER_TO_DECIMAL_WITH_PRECISION_AND_SCALE = '2,18'
ORA_CONNECTION_NAME = 'ORA_CONNECTION';
```

Keep in mind that this will yield errors if the data in the Oracle database does not fit into the specified DECIMAL type.

## Testing information

Expand Down

0 comments on commit fc3b5df

Please sign in to comment.