Using collection in object type

78 views
Skip to first unread message

VinhBuu To

unread,
Apr 10, 2015, 1:37:20 AM4/10/15
to oracle...@googlegroups.com
Hi all,

I am currently develop and application using object type.

Previously, when we use package type, I can define a collection type "index by ..." so that I can access the member of the collection quickly using index key.
However, when I try to convert these package to object, I unable to achieves such "easy to access" feature. Instead, I have to declare an object with key and value. Then I can declare a object as an array of the previous object. But to be able to access the specific member of the array, I have to loop thru it which is a pain.

Does any one have the same problem before and have a solution? Any help is appreciated.

Sample:

create or replace type param_type as object
(
    param_name Varchar2(50),
    param_value vc_arr
)
/

create or replace type params_arrtype is table of param_type;
/

create or replace type request as object(
     params params_arrtype ,
     member procedure .....
)
/

--
VinhBuu To

ddf

unread,
Apr 10, 2015, 12:53:37 PM4/10/15
to oracle...@googlegroups.com

Michael Moore

unread,
Apr 10, 2015, 1:55:31 PM4/10/15
to oracle-plsql
Why do you want to use Objects in PL/SQL? I am curious because I've never found a justification for using them.
Regards,
Mike


--
--
You received this message because you are subscribed to the Google
Groups "Oracle PL/SQL" group.
To post to this group, send email to Oracle...@googlegroups.com
To unsubscribe from this group, send email to
Oracle-PLSQL...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/Oracle-PLSQL?hl=en

---
You received this message because you are subscribed to the Google Groups "Oracle PL/SQL" group.
To unsubscribe from this group and stop receiving emails from it, send an email to oracle-plsql...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages