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

Popular posts from this blog

Email notification in google apps script -

c++ - Difference between pre and post decrement in recursive function argument -

javascript - IE11 incompatibility with jQuery's 'readonly'? -