Live ORACLE

if you are Oracle Developer ,than this Blog most likely will make you happy.

About my Blog

This Blog particularized for Oracle Developers ... you will see interesting Codes for SQL , PL/SQL as well as new ideas for Developer Suite and Client Tools that will help you in your professional life ... and I hope I reach for your satisfaction.

About Me

I'm Hany Freedom , 25 years old , I live in EL-Minia City in Egypt , I'm Moderator at ArabOUG.org the best Arabic Forum for ORACLE on the Net. if you interested to know more about me .... just Click Here.

Using the DELETE Method on a Collection


DECLARE

TYPE NUMLIST IS TABLE OF NUMBER;

N NUMLIST := NUMLIST(10,20,30,40,50,60,70,80,90,100);

TYPE NICKLIST IS TABLE OF VARCHAR2(64) INDEX BY
VARCHAR2(32);

NICKNAMES NICKLIST;

BEGIN

N.DELETE(2); -- deletes element 2



N.DELETE(3,6); -- deletes elements 3 through 6



N.DELETE(7,7); -- deletes element 7



N.DELETE(6,3); -- does nothing since 6 > 3



N.DELETE; -- deletes all elements



NICKNAMES('Bob') := 'Robert';



NICKNAMES('Buffy') := 'Esmerelda';



NICKNAMES('Chip') := 'Charles';



NICKNAMES('Dan') := 'Daniel';



NICKNAMES('Fluffy') := 'Ernestina';



NICKNAMES('Rob') := 'Robert';



-- following deletes element denoted by this key

NICKNAMES.DELETE('Chip');



-- following deletes elements with keys in this alphabetic range

NICKNAMES.DELETE('Buffy','Fluffy');

END;

/



Share/Save/Bookmark

0 comments:

Post a Comment



Newer Posts Older Posts Home Page
 
http://www.dpriver.com/images/sqlpp-banner-2.png

Thanks for reading my Blog ... you Visitor Number :-