Solved

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

Posted on 2008-10-28
4
353 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

Industry Leaders: 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

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ā€¦
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

710 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