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

Could not get object type attribute number as int64 or bytes #35

Closed
kubo opened this Issue Sep 2, 2017 · 4 comments

Comments

Projects
None yet
2 participants
@kubo
Copy link

kubo commented Sep 2, 2017

Object type attribute number could be get as double but not as int64 or bytes.

I made a test program.
https://gist.github.com/kubo/aea497d746d3d1603882c86b450accc0

It printed:

Getting ObjectCol.NumberValue as DPI_NATIVE_TYPE_DOUBLE
  => 1
Getting ObjectCol.NumberValue as DPI_NATIVE_TYPE_INT64
  => ERROR: DPI-1014: conversion between Oracle type 2010 and native type 3000 is not implemented
Getting ObjectCol.NumberValue as DPI_NATIVE_TYPE_BYTES
  => ERROR: DPI-1014: conversion between Oracle type 2010 and native type 3004 is not implemented

What I want is:

Getting ObjectCol.NumberValue as DPI_NATIVE_TYPE_DOUBLE
  => 1
Getting ObjectCol.NumberValue as DPI_NATIVE_TYPE_INT64
  => 1
Getting ObjectCol.NumberValue as DPI_NATIVE_TYPE_BYTES
  => 1
@anthony-tuininga

This comment has been minimized.

Copy link
Member

anthony-tuininga commented Sep 4, 2017

Thanks for the example. I don't see any reason not to implement the additional conversions as requested so will do that at some point!

@anthony-tuininga

This comment has been minimized.

Copy link
Member

anthony-tuininga commented Sep 13, 2017

Conversions added as requested. Note that you must provide the buffer for conversion to text -- unlike with variables where this is done for you. The length of the buffer provided needs to be found in value.asBytes.length and after completion will contain the actual length. I also added support for DPI_NATIVE_TYPE_UINT64.

@kubo

This comment has been minimized.

Copy link
Author

kubo commented Sep 14, 2017

Thank you!
Could you fix document about dpiObjectType_getAttributes also?

@anthony-tuininga

This comment has been minimized.

Copy link
Member

anthony-tuininga commented Sep 14, 2017

I have adjusted the documentation as suggested. Thanks.

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