Error with public object SUBtype when describing object parameters of stored procedures

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
zzin32
Posts: 11
Joined: Fri 21 Oct 2005 13:12

Error with public object SUBtype when describing object parameters of stored procedures

Post by zzin32 » Mon 11 Dec 2006 17:44

For CoreLab team. Next problem.

After installation last version 5.80.0.38
:(
By execute SQL.CreateProcCall of TOraSession code produces error, if object type parameter contains object type as public synonym from other location.

Example:

1. connect as system user and execute:
CREATE USER TEST_GLB IDENTIFIED BY P1234;
GRANT CONNECT TO TEST_GLB;
GRANT CREATE TYPE TO TEST_GLB;
GRANT CREATE PUBLIC SYNONYM TO TEST_GLB;
CREATE USER TEST_INK IDENTIFIED BY P1234;
GRANT CONNECT TO TEST_INK;
GRANT CREATE PROCEDURE TO TEST_INK;
GRANT CREATE TYPE TO TEST_INK;

2. Connect as TEST_GLB and execute

CREATE OR REPLACE TYPE TEST_GLB_ID AS OBJECT
(
sid varchar2(64),
id number(10)
);
CREATE OR REPLACE PUBLIC SYNONYM TEST_GLB_ID FOR TEST_GLB_ID;
GRANT EXECUTE ON TEST_GLB_ID TO TEST_INK;

2. connect as TEST_INK and execute:
CREATE OR REPLACE TYPE TEST_T1 AS OBJECT
(
sid varchar2(64),
id number(10),
siddat TEST_GLB_ID -- Type from TEST_GLB
);
CREATE OR REPLACE PACKAGE TEST_PACK1 AS
PROCEDURE SET_DATA(PI_DATI TEST_T1);
END TEST_PACK1;
/
CREATE OR REPLACE PACKAGE BODY TEST_PACK1 AS
PROCEDURE SET_DATA(PI_DATI TEST_T1)
IS
BEGIN
NULL;
END SET_DATA;
END TEST_PACK1;
/
3. If from delphi execute (as user TEST_INK on TOraSession component)
OraSession1.SQL.CreateProcCall('TEST_PACK1.SET_DATA');
then receive error:
ORA-04043: object "TEST_INK"."TEST_GLB_ID" does not exists

Why "TEST_INK"."TEST_GLB_ID" ???
Object TEST_GLB_ID is defined on user TEST_GLB!!!


Oracle Database 10g Enterprise Edition Release 10.2.0.2.0
Delphi 6
ODAC 5.80.0.38 source code

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Wed 13 Dec 2006 10:11

The problem is that OCI returns incorrect schema name for type of the TEST_T1.siddat attribute. So object types with attributes of object type from another schema cannot be used in ODAC.

Post Reply