Home » SQL & PL/SQL » SQL & PL/SQL » Help w/ DECODE
Help w/ DECODE [message #227577] Wed, 28 March 2007 12:37 Go to next message
sasrs99
Messages: 3
Registered: March 2007
Junior Member
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.

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

Using this example, since today is Wednesday and the WED_SW = 1 then return some value.

I can do this using PL/SQL if that would make it easier.

[Updated on: Wed, 28 March 2007 12:38]

Report message to a moderator

Re: Help w/ DECODE [message #227595 is a reply to message #227577] Wed, 28 March 2007 14:02 Go to previous message
BlackSwan
Messages: 25046
Registered: January 2009
Location: SoCal
Senior Member
See response in other forum.
http://www.dbforums.com/showthread.php?t=1616625
Previous Topic: VARRAY in PLSQL
Next Topic: wild card search
Goto Forum:
  


Current Time: Thu Dec 08 08:42:13 CST 2016

Total time taken to generate the page: 0.10137 seconds