473,385 Members | 2,013 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Re: PL/SQL Collections

Paul Rowe wrote:
I have questions regarding PL/SQL Collections:

1. Is there an easy way to concatenate two like-typed collections
together? I have to use a FOR LOOP which may not be efficient.
It is very efficient as it takes place entirely in memory. You'll see
almost no performance hit doing it.
>
2. Is there an anyway to put a collection into an IN clause? For
instance, if I have a collection of varchar2 objects, and I want to
execute a query like SELECT * from aTable where identifier IN
<collectionIs there an efficient way to do this?

sincerely,

pa**@paulrowe.com
There is and it was posted here on the usenet within the last 60 days or
so. Likely also you will find it at asktom.oracle.com.

--
Daniel Morgan
http://www.outreach.washington.edu/e...ad/oad_crs.asp
da******@x.washington.edu
(replace 'x' with a 'u' to reply)
Jun 27 '08 #1
2 2079
Hi Daniel;

Thanks for your help.. appreciate it... but I have one more request.
My expertise is in Java, not Oracle PL/SQL ... so I am a bit dense
when it comes to Oracle. I searched around usenet and asktom a bit
and I could not find an exact match to what I am looking for. Could
you provide a couple of links ? Thanks in advance.

Sincerely,

Pa**@paulrowe.com
Daniel Morgan <da******@exxesolutions.comwrote in message news:<3F***************@exxesolutions.com>...
Paul Rowe wrote:
I have questions regarding PL/SQL Collections:

1. Is there an easy way to concatenate two like-typed collections
together? I have to use a FOR LOOP which may not be efficient.

It is very efficient as it takes place entirely in memory. You'll see
almost no performance hit doing it.

2. Is there an anyway to put a collection into an IN clause? For
instance, if I have a collection of varchar2 objects, and I want to
execute a query like SELECT * from aTable where identifier IN
<collectionIs there an efficient way to do this?

sincerely,

pa**@paulrowe.com

There is and it was posted here on the usenet within the last 60 days or
so. Likely also you will find it at asktom.oracle.com.
Jun 27 '08 #2
Paul Rowe wrote:
Hi Daniel;

Thanks for your help.. appreciate it... but I have one more request.
My expertise is in Java, not Oracle PL/SQL ... so I am a bit dense
when it comes to Oracle. I searched around usenet and asktom a bit
and I could not find an exact match to what I am looking for. Could
you provide a couple of links ? Thanks in advance.

Sincerely,

Pa**@paulrowe.com

Daniel Morgan <da******@exxesolutions.comwrote in message news:<3F***************@exxesolutions.com>...
Paul Rowe wrote:
I have questions regarding PL/SQL Collections:
>
1. Is there an easy way to concatenate two like-typed collections
together? I have to use a FOR LOOP which may not be efficient.
It is very efficient as it takes place entirely in memory. You'll see
almost no performance hit doing it.
>
2. Is there an anyway to put a collection into an IN clause? For
instance, if I have a collection of varchar2 objects, and I want to
execute a query like SELECT * from aTable where identifier IN
<collectionIs there an efficient way to do this?
>
sincerely,
>
pa**@paulrowe.com
There is and it was posted here on the usenet within the last 60 days or
so. Likely also you will find it at asktom.oracle.com.
Just modify this sample to concatenate rather than compare:

DECLARE

TYPE Clientele IS TABLE OF VARCHAR2(64);
group1 Clientele := Clientele('Customer 1', 'Customer2');
group2 Clientele := Clientele('Customer 1', 'Customer3');

BEGIN
-- Equality test causes compilation error.
FOR i IN 1..2
LOOP
IF group1(i) = group2(i) THEN
dbms_output.put_line('It Is Equal');
ELSE
-- dbms_output.put_line('It Not Is Equal');
dbms_output.put_line(group1(i) ||
' Is Not The Same As ' || group2(i));
END IF;
END LOOP;
END;
/

--
Daniel Morgan
http://www.outreach.washington.edu/e...ad/oad_crs.asp
da******@x.washington.edu
(replace 'x' with a 'u' to reply)
Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: njp | last post by:
BlankHi, How do I create a tightly coupled Object 1 such that when I update it in one collection, it is simultaneously and automatically updated in other collections? The collections are defined...
1
by: Tim T. | last post by:
I'm currently working on a report to forecast production for finished goods. The user can select one or more items to forecast. In addition, they may select one or more warehouses to view...
5
by: Simon | last post by:
Hi all, I am writing a windows application using vb.net on the 1.1 framework. We have in the application, some strongly typed collections that have been written as classes that do not inherit...
4
by: nhmark64 | last post by:
Hi, Does System.Collections.Generic.Queue not have a Synchronized method because it is already in effect synchronized, or is the Synchronized functionality missing from...
4
by: Adam Clauss | last post by:
I ran into a problem a while back when attempting to convert existing .NET 1.1 based code to .NET 2.0 using Generic collections rather than Hashtable, ArrayList, etc. I ran into an issue because...
5
by: WebSnozz | last post by:
Some collections are such that efficient search algorithms work on them such as binary search if the collection is a type which is sorted. I'm wondering how LINQ searches these collections and if...
2
by: Fred Heida | last post by:
Hi, i'm trying to (using managed C++) implment the IEnumerable<Tinterface on my class.. but have a problem with the 2 GetEnumerator method required.... what i have done is... ...
4
by: Sid Price | last post by:
Hello, I have a class of objects (Device) that are managed by another object (Devices) with a collection class (DeviceCollection) inherited from Collections.Hashtable. Each of the Device objects...
5
by: Michi Henning | last post by:
I can pass a generic collection as ICollection<Tjust fine: static void flatCollection(ICollection<intc) {} // ... List<intl = new List<int>(); flatCollection(l); // Works fine Now I...
3
by: Marco Shaw | last post by:
I've got some C# code to create a custom PowerShell cmdlet with these statements: .... using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; .... ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.