asp.net - Data is not getting fetched when status is Pending in PLSQL -


i want download excel report based on state , status. , getting data calling sp query below

select * ubr_structure_details (state = p_state) , (ne_status = p_status); 

there lot's of data query not getting single record.

state -> maharashtra

status -> pending.

note if status pending value in ubr_structure_details status column ''

update

procedure get_data_with_status_exl  (    p_state nvarchar2,    p_status varchar2,    tbl_state_rep out sys_refcursor  )    begin   open tbl_state_rep         select * ubr_structure_details (state = p_state) , (ne_status = p_status);     null; end  get_data_with_status_exl; 

can try this:

procedure get_data_with_status_exl  (    p_state nvarchar2,    p_status varchar2,    tbl_state_rep out sys_refcursor  )    begin        open tbl_state_rep         select * ubr_structure_details         (state = p_state) , (ne_status = p_status or p_status = 'pending' , ne_status null);     null; end  get_data_with_status_exl; 

simulation xing, had doubts:

create table t_r (id number(5,0), ne_status varchar(20)); insert t_r values (1,'pending'); insert t_r values (2,'not pending'); insert t_r values (3,null); insert t_r values (4,''); 

extract pending

select * t_r ne_status = 'pending' or 'pending' = 'pending' , ne_status null; 

output:

1   pending 3   (null) 4   (null) 

extract others

select * t_r ne_status = 'not pending' or 'not_pending' = 'pending' , ne_status null; 

output:

2   not pending 

Comments

Popular posts from this blog

Sort a complex associative array in PHP -

vb.net - How to ignore if a cell is empty nothing -

recursion - Can every recursive algorithm be improved with dynamic programming? -