CACHE

setter

This procedure(or function) can make user defined collection as temporary.

Usage

setter(user-define-class-name,keydata,valdata).

						     EXEC h.setter('TESTCLASS','key1','aaaa'); 
EXEC h.setter('TESTCLASS','key2','bbbb');
Or
select h.setter('TESTCLASS','key1','aaaa') from dual
select h.setter('TESTCLASS','key2','bbbb') from dual

count

This function return total count of collection with user defined class name.

select h.count('TESTCLASS') from  dual
H$CACHE.COUNT('TESTCLASS')
-------------
2

getter

This function return data of collection with user defined class name.

select keydata1,valdata1 from  table(h.getter('TESTCLASS'))  dual
KEYDATA VALDATA1 ------------ key1 aaaa key2 bbbb

remove

This function remove value using user defined key name.

EXEC h.remove('TESTCLASS','key1');
select keydata1,valdata1 from  table(h.getter('TESTCLASS'))  dual
KEYDATA VALDATA1 ------------ key2 bbbb

Usage example

The valdata parameter of limited count is 10

In case of keydata type is string.

							EXEC h.setter('CLASS1','key1','1','2','3','4','5','6','7','8','9');
EXEC h.setter('CLASS1','key2','a','b','c','d','e','f','g','h');
EXEC h.setter('CLASS1','key3','10');
EXEC h.setter('CLASS1','key4','4','2','3','4','5','6','7');
EXEC h.setter('CLASS1','key5','5','2','3','4','5','6');
EXEC h.setter('CLASS1','key6','j','k','l','m','n');
EXEC h.setter('CLASS1','key7','cc','dd','ee','ff');
EXEC h.setter('CLASS1','key8','aa','bb','zz');
EXEC h.setter('CLASS1','key9','11','22');
select keydata1,valdata1,valdata2,valdata3,valdata4,valdata5,valdata6,valdata7,valdata8,valdata9 
from table(h.getter('CLASS1')) dual
KEYDATA VALDATA1 VALDATA2 VALDATA3 VALDATA4 VALDATA5 VALDATA6 VALDATA7 VALDATA8 VALDATA9 ---------------------------------------------------------------------------------------- key1 1 2 3 4 5 6 7 8 9 key2 a b c d e f g h key3 10 key4 4 2 3 4 5 6 7 key5 5 2 3 4 5 6 key6 j k l m n key7 cc dd ee ff key8 aa bb zz key9 11 22
						    
EXEC h.remove('CLASS1','key2');
select keydata1,valdata1,valdata2,valdata3,valdata4,valdata5,valdata6,valdata7,valdata8,valdata9 
from table(h.getter('CLASS1')) dual
KEYDATA VALDATA1 VALDATA2 VALDATA3 VALDATA4 VALDATA5 VALDATA6 VALDATA7 VALDATA8 VALDATA9 ---------------------------------------------------------------------------------------- key1 1 2 3 4 5 6 7 8 9 key3 10 key4 4 2 3 4 5 6 7 key5 5 2 3 4 5 6 key6 j k l m n key7 cc dd ee ff key8 aa bb zz key9 11 22
						    
EXEC h.remove('CLASS1');
select keydata1,valdata1,valdata2,valdata3,valdata4,valdata5,valdata6,valdata7,valdata8,valdata9 
from table(h.getter('CLASS1')) dual
KEYDATA VALDATA1 VALDATA2 VALDATA3 VALDATA4 VALDATA5 VALDATA6 VALDATA7 VALDATA8 VALDATA9 ----------------------------------------------------------------------------------------

Usage example

In case of keydata type is number

							EXEC h.setter('CLASS2',1,'1','2','3','4','5','6','7','8','9');
EXEC h.setter('CLASS2',2,'a','b','c','d','e','f','g','h');
EXEC h.setter('CLASS2',3,'10');
EXEC h.setter('CLASS2',4,'4','2','3','4','5','6','7');
EXEC h.setter('CLASS2',5,'5','2','3','4','5','6');
EXEC h.setter('CLASS2',6,'j','k','l','m','n');
EXEC h.setter('CLASS2',7,'cc','dd','ee','ff');
EXEC h.setter('CLASS2',8,'aa','bb','zz');
EXEC h.setter('CLASS2',9,'11','22');
select keydata1,valdata1,valdata2,valdata3,valdata4,valdata5,valdata6,valdata7,valdata8,valdata9 
from table(h.getter('CLASS2')) dual
KEYDATA VALDATA1 VALDATA2 VALDATA3 VALDATA4 VALDATA5 VALDATA6 VALDATA7 VALDATA8 VALDATA9 ---------------------------------------------------------------------------------------- 1 1 2 3 4 5 6 7 8 9 2 a b c d e f g h 3 10 4 4 2 3 4 5 6 7 5 5 2 3 4 5 6 6 j k l m n 7 cc dd ee ff 8 aa bb zz 9 11 22
						    
EXEC h.remove('CLASS2',3);
select keydata1,valdata1,valdata2,valdata3,valdata4,valdata5,valdata6,valdata7,valdata8,valdata9 
from table(h.getter('CLASS2')) dual
KEYDATA VALDATA1 VALDATA2 VALDATA3 VALDATA4 VALDATA5 VALDATA6 VALDATA7 VALDATA8 VALDATA9 ---------------------------------------------------------------------------------------- 1 1 2 3 4 5 6 7 8 9 2 a b c d e f g h 3 4 2 3 4 5 6 7 4 5 2 3 4 5 6 5 j k l m n 6 cc dd ee ff 7 aa bb zz 8 11 22
						    
EXEC h.remove('CLASS2');
select keydata1,valdata1,valdata2,valdata3,valdata4,valdata5,valdata6,valdata7,valdata8,valdata9 
from table(h.getter('CLASS2')) dual
KEYDATA VALDATA1 VALDATA2 VALDATA3 VALDATA4 VALDATA5 VALDATA6 VALDATA7 VALDATA8 VALDATA9 ----------------------------------------------------------------------------------------

Usage example

In case of keydata is not defined, valdata allow only one parameter.

							EXEC h.setter('CLASS3','a');
EXEC h.setter('CLASS3','b');
EXEC h.setter('CLASS3','c');
EXEC h.setter('CLASS3','d');
EXEC h.setter('CLASS3','e');
EXEC h.setter('CLASS3','f');
EXEC h.setter('CLASS3','g');
EXEC h.setter('CLASS3','h');
EXEC h.setter('CLASS3','i');
select keydata1,valdata1,valdata2,valdata3,valdata4,valdata5,valdata6,valdata7,valdata8,valdata9 
from table(h.getter('CLASS3')) dual
KEYDATA VALDATA1 VALDATA2 VALDATA3 VALDATA4 VALDATA5 VALDATA6 VALDATA7 VALDATA8 VALDATA9 ---------------------------------------------------------------------------------------- 1 a 2 b 3 c 4 d 5 e 6 f 7 g 8 h 9 i

bsetter

This procedure(or function) is bulk collection with user defined SQL statement.