You could determine "weekend" using a date format:

SQL> select to_char(sysdate, 'DAY') from dual;

TO_CHAR(S
---------
FRIDAY

This could be used in SQL (CASE or DECODE statement) or a simple function.

Determining a "holiday" is much more ambiguous since the definition varies from
one nation to another and from one company to another (is Valentine's day a
holiday? What about the day after Thanksgiving? ...).  For example, in the US,
there are 9 stock market holidays, 12 federal holidays (I think), but most
companies recognize only 6.  What is typically done is to create some
context-specific HOLIDAY table, populated it manually, and write code.
Context-specific holiday determination could be automated only in code, but the
logic would be rather complex and hardly worth the time.  Besides, which would
you rather routinely update, even if infrequently - data or code?

-Don Granaman
[OraSaurus - Honk if you remember UFI!]

----- Original Message -----
To: "Multiple recipients of list ORACLE-L" <[EMAIL PROTECTED]>
Sent: Friday, October 05, 2001 10:45 AM


> Hi list,
> Is there a function in Oracle that will determine if particular calendar day
> is weekend or a US holiday.  I need to write a function that will check the
> data integrity of my db.  It will check data entered into the system and
> notice any gaps.  I have to go by days(i.e. every day there should be an
> entry/ies unless it is a weekend or holiday.)
> Thank you in advance,
>
> Lyuda Hoska
>
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author:
>   INET: [EMAIL PROTECTED]
>
> Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
> San Diego, California        -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from).  You may
> also send the HELP command for other information (like subscribing).

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Don Granaman
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Reply via email to