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 object subtype support #25

Open
kubo opened this issue Aug 12, 2017 · 4 comments
Open

Oracle object subtype support #25

kubo opened this issue Aug 12, 2017 · 4 comments

Comments

@kubo
Copy link

kubo commented Aug 12, 2017

ODPI-C doesn't seem to support Oracle object subtype properly.

Consider the table created by the following statements.

create type test_inheritance_base as object (
   name varchar2(30)
) not final
/
create type test_inheritance_sub under test_inheritance_base (
   surname varchar2(30)
)
/
create table test_inheritance (id integer, name test_inheritance_base);
insert into test_inheritance values (1, test_inheritance_base('John'));
insert into test_inheritance values (2, test_inheritance_sub('John', 'Smith'));
commit;

When the name column where id = 1 is fetched, its type is same with the type information retrieved by dpiStmt_getQueryInfo.
But when the name column where id = 2 is fetched, there is no way to know its actual type.

IMO, the problem will be fixed if dpiObject_getObjectType(), which internally uses OCIObjectGetTypeRef and OCIDescribeAny with OCI_OTYPE_REF, is added.

It may be better to add isFinalType member to dpiObjectTypeInfo to check whether the type is a final type. When a column in a query is a final type, there is no need to call dpiObject_getObjectType() for each fetched value. When it isn't a final type, dpiObject_getObjectType() must be called for each value.

@anthony-tuininga
Copy link
Member

ODPI-C currently doesn't support REFs of objects so I've marked this as an enhancement. Thanks for the example!

@kubo
Copy link
Author

kubo commented Aug 13, 2017

Thanks! I'm looking forward to supporting it in future.

@fuson
Copy link

fuson commented Jun 21, 2021

Any chance to fix this?

@cjbj
Copy link
Member

cjbj commented Jun 22, 2021

Ummm. :)

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

4 participants