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
redcajina95 opened this Issue Aug 9, 2018 · 6 comments

Comments

Projects
None yet
3 participants
@redcajina95
Copy link

redcajina95 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

This comment has been minimized.

Copy link
Member

anthony-tuininga commented Aug 9, 2018

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

@redcajina95

This comment has been minimized.

Copy link
Author

redcajina95 commented Aug 9, 2018

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

@anthony-tuininga

This comment has been minimized.

Copy link
Member

anthony-tuininga commented Aug 13, 2018

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

This comment has been minimized.

Copy link
Member

anthony-tuininga commented Aug 16, 2018

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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Member

anthony-tuininga commented Oct 4, 2018

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