I'm trying to compare a date from an Oracle database (10g R1) to sysdate but is not working.
DECLARE
v_exit_date DATE; --Let's assume exit_date from the database is today's date '15-APR-10'
BEGIN
SELECT
exit_date
INTO
v_exit_date
FROM TABLE_1 WHERE student_id = 3020;
IF v_exit_date = sysdate THEN
dbms_output.putline ('Dates are equal');
ELSE
dbms_output.putline ('Dates are not equal');
END;
END;
The equal (=) expression is not evaluated. I'm always getting "Dates are not equal" when expecting "Dates are equal". What's wrong with my PL/SQL?
Thanks
Edited by: Northstar on Apr 15, 2010 11:32 AM