Home » Developer & Programmer » Precompilers, OCI & OCCI » How to get a user-define data type by OCI?
icon5.gif  How to get a user-define data type by OCI? [message #188344] Fri, 18 August 2006 02:37 Go to next message
wokiluyar
Messages: 4
Registered: August 2006
Location: China
Junior Member
Hi,
I want to write a program to deal with some stored procedures with parameters of user-defined data type. Such as:

CREATE OR REPLACE GUEST.PACKAGE PKG_R2D2 AS
TYPE NumberTable_t is table of number;
END PKG_BULK_INSERT;
/
CREATE OR REPLACE PROCEDURE GUEST.PROC_DOUBLEARRAY
(PRM1_DOUBLE IN PKG_R2D2.NumberTable_t ,returnType IN OUT
PKG_R2D2.doubleType) IS
l_ix BINARY_INTEGER;
BEGIN
for l_ix in PRM1_DOUBLE.FIRST .. PRM1_DOUBLE.LAST loop
... --some sql execute
end loop;
END PROC_DOUBLEARRAY;
/
Now, I want to call this procedure : PROC_DOUBLEARRAY in my program, but I don't know how to get the parameter : PRM1_DOUBLE type, for its type is a user-defined data type. I want to get the data type : NumberTable information before I prepare to call this procedure. I'm not the procedure creater, so I can not assume the data type is a table.
Re: How to get a user-define data type by OCI? [message #188345 is a reply to message #188344] Fri, 18 August 2006 02:38 Go to previous messageGo to next message
wokiluyar
Messages: 4
Registered: August 2006
Location: China
Junior Member
If you know, please tell me. Thank you very much! To me, it is a big block in work.
Re: How to get a user-define data type by OCI? [message #188492 is a reply to message #188344] Fri, 18 August 2006 14:12 Go to previous messageGo to next message
rampratap
Messages: 50
Registered: November 2004
Location: New Delhi
Member

Hi

I could not fully understand your problem and your code.

I am tring to make u to under stand some features of pl/sql tables.
********** Create a Pckage to Hold only a PLSQL TABLE *******
create or replace package my_pack is
type numberTable_t is table of number index by binary_integer;
end my_pack;

*********** used the PLSQL Table In Parameter *************

create or replace procedure proc_demo( v_table in my_pack.numberTable_t,
v_returntype out my_pack.numberTable_t) is
i number :=1;
begin
for k in v_table.first.. v_table.last loop
v_returntype(i) := k;
i := i + 1;
end loop;
end;
/


**************** Use above Procedure any where ***************

declare
v_table my_pack.numberTable_t ;
v_returntable my_pack.numberTable_t;
begin
for r in 10.. 30 loop
v_table(r) := r;
end loop;
proc_demo(v_table, v_returntable);
for k in v_returntable.first.. v_returntable.last loop
dbms_output.put_line(v_returntable(k));
end loop;
end;
/
icon6.gif  Re: How to get a user-define data type by OCI? [message #188607 is a reply to message #188492] Sun, 20 August 2006 20:25 Go to previous messageGo to next message
wokiluyar
Messages: 4
Registered: August 2006
Location: China
Junior Member
Hi, rampratap,
Thanks.
I means that I'm programming with Oracle Call Interface(C). In my program, I need to call some procedures in oracle. But, I don't know the procedure's details before. This means I need to call some OCI APIs to get the procedures' parameters names and types. I know OCI has provided a API called OCIDescribeAny() to get the description of any object such as table, procedure and package etc. My problem is:
Some procedures have parameters as user-defined types. These types defined in a package (not create as type objects). How can I use OCI API to get these user-defined types' details by OCI Razz ?
Re: How to get a user-define data type by OCI? [message #189294 is a reply to message #188344] Thu, 24 August 2006 01:38 Go to previous message
asolanki
Messages: 7
Registered: August 2006
Location: india
Junior Member
Hi,

Please tell me the solution if anybody got it.

How can I get Object Type in OCI???

Regards.
asolanki
Previous Topic: User defined column name
Next Topic: what is TDO in OCI
Goto Forum:
  


Current Time: Tue Dec 03 06:28:33 CST 2024