tconbeer / harlequin-odbc

An ODBC adapter for Harlequin
MIT License
1 stars 0 forks source link

Catalog Error. ODBC. Oracle. ora-22003 #9

Open halfenif opened 3 months ago

halfenif commented 3 months ago

Before Proceeding, please acknowledge:

Describe the bug 2024-06-13-01-02

Catalog Error. ora-22003

Could not update data catalog [Oracle][ODBC]Numeric value of range. \x000, decode(data_type), 'CHAR', data_length,' (0) (SQLGetData)

To Reproduce https://github.com/halfenif/toy_docker_db_oracle_xe_harlequin

  1. Write Dockerfile(Oracle Express)
  2. Install Oracle instant client 19.23 (basic, odbc)
  3. Install Python3.9, unixODBC.x86_64
  4. Install harlequin-odbc (pip)
  5. Config ODBC (odbcinst.ini)
  6. build Docker Image & run docker-compose
  7. run> init.sql
  8. run> harlequin -a odbc 'DRIVER=oracle;DBQ=localhost:1521/XE;UID=userdb;PWD=userdb'

Expected behavior display catalog

Actual behavior ora-22003 occured

Contributing Are you interested in contributing a fix?

Additional context Please provide as much as you can, but don't waste your time if it's definitely not relevant or you don't know.

What is the output of harlequin --version? Harlequin could not load the installed plug-in named sqlite.

No module named '_sqlite3' harlequin, version 1.20.0

Installed Adapters:

What database adapter are you using with Harlequin? (Default is duckdb) odbc

What other options are you using when invoking Harlequin? (If you are using a profile, please add relevant items from your profile here). harlequin -a odbc 'DRIVER=oracle;DBQ=localhost:1521/XE;UID=userdb;PWD=userdb'

Can you tell us more about your system?

[!TIP] For example, for my system, these are:

  • Bash
  • Windows Terminal
  • Ubuntu 22.04 / WSL2
  • Windows 11
  • en_US/UTF-8

How did you install Harlequin?

tconbeer commented 3 months ago

This seems like an encoding or decoding issue with the ODBC driver for your database. The library we use, pyodbc, does support setting an encoding, but we don't currently offer that as an option, since it's not supported by all databases and it's finicky to set in pyodbc. Do you know what encoding/decoding your Oracle database uses? (e.g., utf-8, etc.)

See pyodbc docs: https://github.com/mkleehammer/pyodbc/wiki/Connection#setencoding

halfenif commented 3 months ago

AL32UTF8

Oracle default. ORACLE_CHARACTERSET