Re: Range function

  • From: Yechiel Adar <adar666@xxxxxxxxxxxx>
  • Date: Mon, 20 Mar 2006 11:02:16 +0200

Thanks for the input.

1) This function is used by programmers only so no great need for error handling.
2) You are right.
3) The function keeps in memory the last 2 range strings.
Only if the new string does not match then it do the parse and save the new string.
I suppose that if you have many concurrent users you might want to save more then the last 2 strings.


Adar Yechiel
Rechovot, Israel



Mindaugas Navickas wrote:

Hi Adar,

Few suggestions regarding the program
1. I would suggest to enhance error handling - e.g. when list contains not
valid characters, etc.
2. A working example (corresponding to your code) would be (note underscore
instead of dash):
select range.ranges('0_100,101_200,201_300',balance) from account;
3. the function will parse a string (list of ranges) for every row in account
table. Unfortunatly string operations in PL/SQL are slow and also Oracle will
suffer from SQL/PL-SQL context switches. If performance is important in this
case, I would populate some temporary or in-memory table (parsing just once)
and then would use it joining it with account table.

Let me know if those suggestions makes sense to you.

Regards
Mindaugas Navickas
OCP DBA





--
//www.freelists.org/webpage/oracle-l


Other related posts: