Execute Different SQL Statements Based On Day of Week
808774Oct 27 2010 — edited Oct 27 2010I need to execute different sql statements based on the day of the week in Oracle 8i. In SQL Server, it's pretty simple. SELECT
CASE DATEPART(dw,GETDATE())
WHEN 4 THEN (SELECT COUNT(*) FROM ADR_VLDN )
END
In Oracle it should be something like this
IF to_char(SYSDATE, 'D') = 2 THEN
SELECT * FROM RSVP_FILE_PRCS WHERE ROWNUM = 1;
ELSEIF to_char(SYSDATE, 'D') = 3 THEN
SELECT * FROM RSVP_FILE_PRCS WHERE ROWNUM = 2;
END IF;
But this doesn't work. Does anyone have any ideas about how to do this in Oracle?