plsql - How to compare a negative number in pl/sql if statement -
here complete function
function getstatus_tectrac( inquiry_id in number ) return varchar2 status varchar2(12); deptid number; enddate date; begin select dept_id, end_date deptid , enddate ( select dept_id, end_date tb_project_tracking_duration tp tp.inquiry_id = inquiry_id order start_date desc ) rownum = 1; if (deptid = -61 , enddate not null) status := 'closed'; else status := 'open'; end if; return status; end; it returns status "closed" on each inquiry_id whatever value of deptid , enddate is. me solve this.
thanks in advance. farhan
works me. how did test?
sql> declare deptid number := 44; enddate date := sysdate; status varchar2(10); begin if (deptid = -61 , enddate not null) status := 'closed'; else status := 'open'; end if; dbms_output.put_line(status); end; / open pl/sql procedure completed.
Comments
Post a Comment