-
Notifications
You must be signed in to change notification settings - Fork 74
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
OCI-22060: dpiObject_getAttributeValue for PLS_INTEGER #112
Comments
Just to emphasize, this is on a 19c database, and the type live in the package header, only! |
Can you provide a full example? The error appears to be occurring after the value has been acquired from the database and is being converted to an integer -- so probably isn't something you are doing wrong directly (but see below). I see that I don't have a sample for manipulating records, but there are test cases that you can examine -- if that will help! One possibility: if you create a record you must set all of the attributes or you may end up with unusual behaviour or even segfaults (due to a bug in the Oracle Client libraries). If the record was acquired from the database it should be fine, though. I'll see if there is some way to do this automatically when needed -- and avoid doing it when it is not needed. |
A concrete (go) example is https://github.com/go-goracle/goracle/blob/master/z_plsql_types_test.go#L708 I've sprinkled it with Object.ResetAttributes (which sets each attribute with NULL), without help. The strange thing is that the first object (which is populated from go code) is there and the set PLS_INTEGER value is there and retreived, too.
error. |
So it turns out that |
Sorry, some side questions regarding objects:
Thanks again for your great work, and if these questions should be asked somewhere else, please advise so! |
Yes. Objects are created and attributes set on the client side only.
Objects are indeed client side but they require a "session" (aka connection) where they are stored in an object cache. The "session" is also used to acquire type information, if necesary. |
It's worth noting that getting object type info is a round trip. In node-oracledb @anthony-tuininga implemented a type info cache, using the FQN as the key. This reduces round trips when user apps don't explicitly keep a reference to the type. To take advantage of the driver cache, users need to be encouraged to use FQNs. |
Just to be clear, the type info cache was only implemented in the node-oracledb driver. No such cache has (yet) been implemented at the ODPI-C level. But in order to take advantage of a (potentially future) implementation that does cache the type information, use the fully qualified names whenever getting type information, or retain the object type directly yourself. |
This was included in ODPI-C 3.2.2. |
I'm calling
for
's "INT" attribute,
with
and get
ORA-22060: OCI-22060: argument [2] is an invalid or uninitialized number INT
debug log:
What am I doing wrong?
The documentation of getAttributeValue says only NUMBER types need a destination buffer, all other types are managed.
This sort-of works (returns nil instead of error) when I replace PLS_INTEGER with INTEGER.
Thanks in advance.
The text was updated successfully, but these errors were encountered: