Solved

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

Posted on 2008-10-28
4
350 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
ID: 22829005
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
ID: 22829024
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
ID: 22829243
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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious sideā€¦
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 shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

770 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