Solved

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

Posted on 2008-10-28
4
354 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Suggested Courses

615 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