Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Oracle Type 0 Not Supported #212

Closed
josh-cajina opened this issue Aug 9, 2018 · 6 comments
Closed

Oracle Type 0 Not Supported #212

josh-cajina opened this issue Aug 9, 2018 · 6 comments

Comments

@josh-cajina
Copy link

josh-cajina commented Aug 9, 2018

I'm currently using Python 3.6.4 with cx_Oracle 6.4 in Windows Server 2012 R2 and i'm getting this error when i'm trying to Access a NUMERIC type attribute of my User Defined type, it Works with the rest of the attributes, but in this particular case i'm getting an "Oracle Type 0 Not Supported".

The rest of the attributes are NUMBER, VARCHAR, etc. But this one is NUMERIC with precision 'NUMERIC(18, 10)'.

con = cx_Oracle.connect(connection_object.User, connection_object.Password, connection_object.Host)
cursor = con.cursor()
my_type = con.gettype("MY_TYPE")
custom_type = my_type.newobject()
params = (custom_type, ) # out param
reader = cursor.callproc("MY_PROCEDURE", params)

__table_type = reader[0].aslist()

for row in __table_type:
      print(row.ACOD) # NUMBER Works
      print(row.ANAME) # VARCHAR Works
      print(row.ALAT) # NUMERIC Raise an Exception

Thanks for your help.

@anthony-tuininga
Copy link
Member

This should (hopefully!) not be too difficult to address. I'll let you know once I've had some time to take a look.

@josh-cajina
Copy link
Author

Please, I need to fix this in the shortest time. Thank you a lot

@anthony-tuininga
Copy link
Member

I took a quick peek and discovered that this is a "packed decimal" type (SQLT_PDN) which is not documented. I will see if I can find out about this type internally, but if you can change the type of the attribute to a regular number type instead -- that is number(18,10) -- that would make life considerably simpler for everyone!

anthony-tuininga added a commit to oracle/odpi that referenced this issue Aug 16, 2018
anthony-tuininga added a commit that referenced this issue Aug 16, 2018
@anthony-tuininga
Copy link
Member

I have just pushed the code changes to correct this for you, I believe. Please give it a try and let me know. Thanks!

@cjbj
Copy link
Member

cjbj commented Aug 17, 2018

@sekando273 to test, you will need to install cx_Oracle from GitHub: https://cx-oracle.readthedocs.io/en/latest/installation.html#install-using-github

@anthony-tuininga
Copy link
Member

This has been implemented in cx_Oracle 7 which is now released publicly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants