Solved

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

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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

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 shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
This video shows how to recover a database from a user managed backup

756 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