Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2005
    Posts
    220

    Unanswered: Query help needed

    I have a table that has a location number and 7 more fields that I use to indicate if a particular text files is supposed to be generated on a given day of the week.

    I need help with a query that will tell me if the file should be created based on the current day of the week. So, return a YES (or some other value) if we should create the file or NO if not.

    I think it will end up as a large DECODE statement but I'm not certain. I would use CASE but we are running Oracle 8.0.6.3.0.

    Code:
    LOC   MON_SW  TUE_SW  WED_SW  THU_SW  FRI_SW  SAT_SW  SUN_SW
    20025   1       0       1       1       1       1       1

  2. #2
    Join Date
    Jul 2003
    Posts
    2,296
    I don't think this forum supports questions on Oracle 8.0.6.3 :P
    - The_Duck
    you can lead someone to something but they will never learn anything ...

  3. #3
    Join Date
    Sep 2005
    Posts
    220
    Is there a more appropriate forum to post this then?

  4. #4
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    He was joking, use the following

    where decode(to_char(sysdate,'D'),'1',sun_sw,'2',mon_sw, '3',tue_sw,'4',wed_sw,'5',thu_sw,'6',fri_sw,'7',sa t_sw) = 1
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

  5. #5
    Join Date
    Sep 2005
    Posts
    220
    Perfect! Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •