<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	>

<channel>
	<title>SQL, perl und Unix/Linux Schulungen in und um Wien &#187; PLSQL</title>
	<atom:link href="http://www.trust-box.at/category/plsql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.trust-box.at</link>
	<description>SQL, perl und Unix/Linux Schulungen in und um Wien</description>
	<pubDate>Tue, 22 Feb 2011 10:24:16 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>New Feature for collections in Oracle 11</title>
		<link>http://www.trust-box.at/2009/11/08/new-feature-for-collections-in-oracle-11/</link>
		<comments>http://www.trust-box.at/2009/11/08/new-feature-for-collections-in-oracle-11/#comments</comments>
		<pubDate>Sun, 08 Nov 2009 10:12:12 +0000</pubDate>
		<dc:creator>schulung</dc:creator>
		
		<category><![CDATA[Oracle]]></category>

		<category><![CDATA[PLSQL]]></category>

		<category><![CDATA[SQL Beispiele]]></category>

		<guid isPermaLink="false">http://www.trust-box.at/?p=72</guid>
		<description><![CDATA[Starting with Oracle 11 it is now possible to use set operators on &#8220;some&#8221; collection types (ie varrays and nested tables, NOT index by Tables).
A simple example:

PROCEDURE COLL_SET_OP
   IS
   cursor c_emp(c_p_salary number) is
   select first_name, last_name, salary from employees
   where salary > c_p_salary;
  type t_emp is [...]]]></description>
			<content:encoded><![CDATA[<p>Starting with Oracle 11 it is now possible to use set operators on &#8220;some&#8221; collection types (ie varrays and nested tables, NOT index by Tables).</p>
<p>A simple example:<br />
<code><br />
PROCEDURE COLL_SET_OP<br />
   IS<br />
   cursor c_emp(c_p_salary number) is<br />
   select first_name, last_name, salary from employees<br />
   where salary > c_p_salary;</p>
<p>  type t_emp is table of varchar2(50); </p>
<p>   a1_emp t_emp := t_emp();<br />
   a2_emp t_emp := t_emp();</p>
<p>   a_emp_op t_emp := t_emp();<br />
   i number := 0;<br />
BEGIN<br />
   for r in c_emp(5000) loop<br />
     i := i+1;<br />
     a1_emp.extend;<br />
     a1_emp(i) := r.last_name;<br />
   end loop;</p>
<p>   i:=0;<br />
   for r in c_emp(10000) loop<br />
     i := i+1;<br />
     a2_emp.extend;<br />
     a2_emp(i) := r.last_name;<br />
   end loop;</p>
<p>   dbms_output.put_line(cardinality(a1_emp));<br />
   dbms_output.put_line(cardinality(a2_emp));</p>
<p>   a_emp_op := a1_emp multiset except a2_emp;<br />
   i:=a_emp_op.first;<br />
   while (i is not null) loop<br />
   dbms_output.put_line(i ||' '||<br />
                       a_emp_op(i));</p>
<p>   i:=a_emp_op.next(i);<br />
   end loop;<br />
END;<br />
</code></p>
<p>there are operators to mimic all SQL-set operators (union, minus, intersect). Its not exaclty a feature in PLSQL I&#8217;ve been anxiously waiting for, but there may be some uses for it. Please keep in mind that it won&#8217;t work for &#8220;index by varchar2&#8243; tables which would make it a lot more usefull.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.trust-box.at/2009/11/08/new-feature-for-collections-in-oracle-11/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>

