Sorry,
Oracle does not agree.
Please find here enclosed the sample they provide me.
Their answer :
Here's the analysis on bug filed from our sample code, cdemodsc.c
Please have your developers review the solution suggested and review the revised code, bde.c
a) User P_USER
- owns collection type TP_TAB_VARCHAR2
- owns package PKL_TEST referencing this type as a return from a
function and parameter to a procedure
b) User C_USER
- has execute granted on type TP_TAB_VARCHAR2
- has execute granted on package PKL_TEST
- owns synonym TP_TAB_VARCHAR2 for P_USER.TP_TAB_VARCHAR2
- owns synonym PKL_TEST for P_USER.PKL_TEST
In cdemodsc.c it calls OCIDescribeAny with type OCI_PTYPE_TYPE - ie type.So
it wouldn't be expected to find it as a synonym which is type OCI_PTYPE_SYN.
If you want it to allow for any type of object you must pass the type as
OCI_PTYPE_UNK then write code to switch on the OCI_ATTR_PTYPE attribute
returned accordingly in order to decide how to proceed.In the case of a
synonym that would be to access OCI_ATTR_SCHEMA_NAME, OCI_ATTR_NAME,
OCI_ATTR_LINK then call OCIDescribeAny again passing those values.
If I run:
cdemodsc C_USER C_USER P_USER.TP_TAB_VARCHAR2
I get the type attributes whereas:
cdemodsc C_USER C_USER TP_TAB_VARCHAR2(--> synonym)
and:
cdemodsc C_USER C_USER P_USER.PKL_TEST(--> package)
both fail as neither can be found as a type.
Uploaded bde.c which is cdemodsc.c but allows you to pass either a type or
synonym to a type by calling OCIDescribeAny with OCI_PTYPE_UNK.If it gets
back a type it proceeds as before.If it gets back a synonym then it
extracts the details and calls OCIDescribeAny again with OCI_PTYPE_TYPE and
those details.
I will post you this file bde.c.
Thank you
Catherine