Forums | Aggregator | Books | Industry News | Firefox Plugins | Social | Links

Comments

PL/SQL Enhancements in Oracle Database 10g - Get to grips with the Oracle 10g enhancements to PL/SQL using simple cut & paste examples.



Tomasz said...

First example of "Nested Table Enhancements"
is not clear it doesn't show difference between:

multiset intersect and multiset intersect distinct
multiset except and multiset except distict

to really see difference definitions collections can be defined like that
l_col_1 t_colors := t_colors('Red', 'Green', 'Blue', 'Green', 'Blue');
l_col_2 t_colors := t_colors('Red', 'Green', 'Yellow', 'Green');

Tomasz said...

I think following example can extend this article :) it's nice

DECLARE
TYPE t_colors IS TABLE OF VARCHAR2(10);
l_col_1 t_colors := t_colors('Red', 'Blue', 'Green', 'Blue');
BEGIN
DBMS_OUTPUT.PUT_LINE('Show all:');
FOR i IN 1..l_col_1.COUNT
LOOP
DBMS_OUTPUT.PUT_LINE(l_col_1(i));
END LOOP;
DBMS_OUTPUT.PUT_LINE('');
DBMS_OUTPUT.PUT_LINE('Show distinct:');
FOR i IN 1..SET(l_col_1).COUNT
LOOP
DBMS_OUTPUT.PUT_LINE(SET(l_col_1)(i));
END LOOP;
END;

Tomasz said...

Another cool

DECLARE
TYPE t_colors IS TABLE OF VARCHAR2(10);
l_col_1 t_colors := t_colors('Red', 'Blue', 'Green', 'Blue');
BEGIN
DBMS_OUTPUT.PUT_LINE('Cardinality: '||CARDINALITY(l_col_1)||' equals Count: '||l_col_1.COUNT);
DBMS_OUTPUT.PUT_LINE('Set Cardinality: '||CARDINALITY(SET(l_col_1))||' equals Set Count: '||SET(l_col_1).COUNT);
END;

Tim... said...

Hi.

I've included some of your points in the article. Thanks for the pointers.

Remember, this article is tailored more for the "New Features for Administrators" OCP exam. You could write a whole book on nested tables and set operations.

Cheers

Tim...

satish M said...

Thanks to auther.It's very nice and consolidated.

SIVANARAYANA CHEKURI said...

It's very good topic

DO NOT ask technical questions here! They will be deleted!

These comments should relate to the contents of a specific article. Constructive criticism is good. Advertising and offensive comments are bad and will be deleted!

Add your comments here.
Name
Comment
(max 400 chars - plain text)