Solved

What is the fastest way to copy values from asociated array to array

Posted on 2008-10-28
4
348 Views
Last Modified: 2013-12-19
Hi experts,

I have SQL type:

CREATE OR REPLACE TYPE l_obj
  AS OBJECT (Tschedule_did VARCHAR2(40),
             ReturnAmount  NUMBER,
             ReturnDt      DATE);

CREATE OR REPLACE TYPE l_coll AS TABLE OF l_obj;


I also have PL/SQL table:

rec is rescord (id number, dd date)
tbl is table of rec index by binary_integer;
pltbl tbl;

Is it possible in pl/sql to copy all rows from PL/SQL table to SQL type array
without looping through pl/sql table?
0
Comment
Question by:sky_lt
  • 2
4 Comments
 
LVL 27

Expert Comment

by:sujith80
Comment Utility
Why do you want to do that?
You can use the vairable of type l_coll itself to do the processing.
0
 
LVL 27

Accepted Solution

by:
sujith80 earned 50 total points
Comment Utility
However, if both types are identical you may try to do this to bulk collect the data in to the local variable.

 select * bulk collect into <pltbl>
 from table(<variable of type l_coll >);
0
 

Author Comment

by:sky_lt
Comment Utility
i need to copy data from asociated array in example pltbl  to array l_coll
currently i use such synttax

for i in pltbl.firs..pltbl.last loop
        l_coll.EXTEND;
        l_coll(l_coll.COUNT) := prib_leasing_obj('AAA''
                                                                 pltbl(i).id,
                                                                 pltbl(i).dd);
end loop;
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: http://www.e-e.com/A_8429.html Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many‚Ķ
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now