title: Validating a given date if it falls on a weekend
body: <p>Is there any better approach than the function code below </p>
  
  <pre><code>// checks whether the IN data falls on a weekend 
  CREATE OR REPLACE FUNCTION business_days(start_date IN DATE)
     RETURN NUMBER IS
  busdays NUMBER := 0;
  stDate DATE;
  
  BEGIN
  
  stDate := TRUNC(start_date);
  
    /* Adjust for ending date on a saturday */
    IF  TO_CHAR(enDate,'D') = '7'    THEN
      busdays := busdays - 1;
    END IF;
  
    /* Adjust for starting date on a sunday */
    IF TO_CHAR(stDate,'D') = '1' THEN
      busdays := busdays - 1;
    END IF;
  else
     busdays := 0;
  END IF;
  
    RETURN(busdays);
  END;
  /
  </code></pre>