Print Thread
Page 2 of 2 1 2
Re: TOracleObject and synonym
csteinme #39455 02/07/11 10:35 AM
Joined: Aug 1999
Posts: 22,221
Member
Offline
Member
Joined: Aug 1999
Posts: 22,221
I'm not sure I understand the question, but Direct Oracle Access directly talks to the Oracle Client Interface library (oci.dll).


Marco Kalter
Allround Automations
Re: TOracleObject and synonym
Marco Kalter #39562 02/24/11 10:21 AM
Joined: Feb 2011
Posts: 8
C
Member
Offline
Member
C
Joined: Feb 2011
Posts: 8
When using the method TOracleObject, are you calling self written oci code or you're just calling an oracle oci method ?

We are hitten the bug when we try to instantiate an objet type called T_TAB_VARCHAR2 wich is a synonym of a type declared in oracle like this :
create or replace type T_TAB_VARCHAR2 is table of VARCHAR2(1000)
/

TOracleObject *l_obj2 = new TOracleObject(l_ses,"T_TAB_VARCHAR2","");

I can send you the entire testcase if you want.
Thank you
Catherine



Re: TOracleObject and synonym
csteinme #39563 02/24/11 01:07 PM
Joined: Aug 1999
Posts: 22,221
Member
Offline
Member
Joined: Aug 1999
Posts: 22,221
Direct Oracle Access always uses OCI to access Oracle. In this case OCIObjectNew() is called for the given type name.


Marco Kalter
Allround Automations
Re: TOracleObject and synonym
Marco Kalter #39570 02/25/11 07:36 AM
Joined: Feb 2011
Posts: 8
C
Member
Offline
Member
C
Joined: Feb 2011
Posts: 8
I'm sorry but i'm really not familiar with OCI, but that means that you do not write your own OCI code, here you just make a call to the OCIobjectnew() method delivered by oci.dll ?

Thank you Marko.

Re: TOracleObject and synonym
csteinme #39575 02/25/11 10:05 AM
Joined: Aug 1999
Posts: 22,221
Member
Offline
Member
Joined: Aug 1999
Posts: 22,221
Yes, that is correct.


Marco Kalter
Allround Automations
Re: TOracleObject and synonym
Marco Kalter #39579 02/25/11 11:36 AM
Joined: Feb 2011
Posts: 8
C
Member
Offline
Member
C
Joined: Feb 2011
Posts: 8
OK ! That's exactly what i will say to Oracle.
The pb is in oci.dll
Thank you very much for your quick answer !
Catherine

Re: TOracleObject and synonym
csteinme #39582 02/25/11 03:55 PM
Joined: Feb 2011
Posts: 8
C
Member
Offline
Member
C
Joined: Feb 2011
Posts: 8
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

Re: TOracleObject and synonym
csteinme #39587 02/28/11 11:56 AM
Joined: Feb 2011
Posts: 8
C
Member
Offline
Member
C
Joined: Feb 2011
Posts: 8
Do you think it's possible to send the piece of your code calling OCIObjectNew() ?
Thank you
Catherine STEINMETZ

Re: TOracleObject and synonym
csteinme #39591 03/01/11 10:17 AM
Joined: Aug 1999
Posts: 22,221
Member
Offline
Member
Joined: Aug 1999
Posts: 22,221
If you can send an e-mail to support@allroundautomations.com we can arrange this.


Marco Kalter
Allround Automations
Re: TOracleObject and synonym
Marco Kalter #46835 04/15/13 10:20 AM
Joined: Apr 2013
Posts: 1
P
Member
Offline
Member
P
Joined: Apr 2013
Posts: 1
Is there an update on this problem ? If I understand the problem is in the DOA code, not in the Oracle's OCI code and so Oracle won't fix ? Is there a fix from allroundautomations then?

We can workaround the issue by prefixing all TYPE with the owner schema, but of course if there is a fix it would be better

Thanks and regards

Pierre

Page 2 of 2 1 2

Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.030s Queries: 14 (0.009s) Memory: 2.5650 MB (Peak: 3.0429 MB) Data Comp: Off Server Time: 2024-05-20 14:30:19 UTC
Valid HTML 5 and Valid CSS