sort/order a pl/sql table ?

From: Adam Hapworth <hap_at_mikomi.org>
Date: 28 Nov 2001 08:21:15 -0800
Message-ID: <a6cb04db.0111280821.45dd4317_at_posting.google.com>


I am wondering if there is any way to easily sort the values in a pl/sql table. I am building a function that takes a table of holidays which I have set up to like so.

 Name Null? Type

  • -------- ---- HOL_NAME NOT NULL VARCHAR2(30) HOL_MONTH NUMBER(2) STATIC_DAY NUMBER(2) WEEKDAY VARCHAR2(20) WEEK NUMBER(1) IGNORE_START_OF_MON NUMBER(1)
if it is a static date like newyears 1/1 (hol_month = 1 static_day = 1)then I don't have a problem geting the next holiday (function I am working on). But if I use the dynamic holiday like thanksgiving (weekday = thursday week = 4 hol_month = 11). once I generate all of the dates for the month I put them into a table of date. When I build the cursor I sort them by week and weekday so I get the earlier weeks first in order of day. But the issue is when say I have a holiday on the 4th mon and one on the 4th tue and the month starts on a tuesday then the 4th tuesday is before the 4th monday screwing my next holiday test all up. If I could sort a pl/sql table this would be solved.

Thanks for your time
Adam Received on Wed Nov 28 2001 - 17:21:15 CET

Original text of this message