if u want to display the records for all the deptno then just modify your select statement by writing

select * from emp where deptno = nvl(:d,deptno);

this implies that if no deptno is selected it will display the records for all the deptno.

instead of writing

select * from emp where deptno = :d;