Unix Technical Forum

Parsing arrays parameters in DB2

This is a discussion on Parsing arrays parameters in DB2 within the DB2 forums, part of the Database Server Software category; --> Hi, I am working on creating reports for which I want to make a single stored procedure call to ...


Go Back   Unix Technical Forum > Database Server Software > DB2

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-27-2008, 07:53 AM
Jaraba
 
Posts: n/a
Default Parsing arrays parameters in DB2

Hi, I am working on creating reports for which I want to make a single
stored procedure call to the DB. In order to do so, I need to be able
to parse an array of parameters containing elements as follows:

'20-30, 100--200, 400-500'

I would like to create a function that parses this out and inserts the
results into a temp table with a structure similar to the following:

Min Max
20 30
100 200
400 500

That way I can create a SQL joining my table (MYTABLE) with the
temporary table (TEMP) as follows:

select mytable.*
from MYTABLE mt,
TEMP t
where mt.field between t.min and t.max

Please, help

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-27-2008, 07:53 AM
Mehmet Baserdem
 
Posts: n/a
Default Re: Parsing arrays parameters in DB2

Check out

http://www-128.ibm.com/developerwork...03stolze1.html

Credits to Knut Stulze

Regards,

Mehmet Baserdem

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 06:01 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com