Code Monkey home page Code Monkey logo

Comments (9)

anthony-tuininga avatar anthony-tuininga commented on July 27, 2024

I'll take a look and will implement this suggestion if there aren't any difficulties in doing so!

from odpi.

kubo avatar kubo commented on July 27, 2024

Thank you! I'm looking forward to it.

from odpi.

anthony-tuininga avatar anthony-tuininga commented on July 27, 2024

I just checked. This information is already available! For timestamps, the value is found in the "scale" attribute. For intervals, the first value is found in the "precision" attribute and the second value is found in the "scale" attribute. I'll update the documentation accordingly.

from odpi.

anthony-tuininga avatar anthony-tuininga commented on July 27, 2024

On the other hand, that behavior of OCI is confusing and looking at the other metadata, those fields are separated....so I'll likely separate them here, too!

from odpi.

kubo avatar kubo commented on July 27, 2024

I had checked scale and precision attributes values for timestamp, interval year to month and interval day to second.

  • scale values are same with fsprec values for timestamp.
  • precision values are same with lfprec values for interval year to month.

These results are same with yours.

However, for interval day to second:
See: https://github.com/kubo/ruby-oci8/blob/ruby-oci8-2.2.4/test/test_metadata.rb#L2393-L2405

  • precision and scale values are same with lfprec and fsprec values respectively when the metadata are retrieved from select statements.
  • precision and scale values are same with fsprec and lfprec values respectively when the metadata are retrieved from OCIDescribeAny().

ODPI-C currently exposes precision and scale values only from select statements. But if ODPI-C retrieves metadata from OCIDescribeAny() in future, precision and scale values are exchanged.

from odpi.

anthony-tuininga avatar anthony-tuininga commented on July 27, 2024

I added the dpiDataTypeInfo structure suggested in #23. In that structure I have a column called fsPrecision which is used for fractional seconds precision on timestamps and interval day to second values. From what I can tell the precision values are accurate but I'd appreciate it if you took a look and confirmed that for me! Thanks.

from odpi.

kubo avatar kubo commented on July 27, 2024

Sorry, what I wrote in #22 (comment) is the result of my tests just for interest.
lfprec and fsprec should be got by OCI_ATTR_LFPRECISION and OCI_ATTR_FSPRECISION respectively as documented in type attribute attributes. These are available for columns but not documented in column attributes. IMO, it is a documentation bug.

from odpi.

anthony-tuininga avatar anthony-tuininga commented on July 27, 2024

Thanks, Kubo. I am not using those particular attributes but the standard precision and scale attributes. I'll find out internally which attributes are the right ones to use and modify accordingly. But in the meantime the code appears to work just fine!

from odpi.

kubo avatar kubo commented on July 27, 2024

Okay, thanks!
It woks fine.

from odpi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.