Problem is solved.

I have given grants.

grant select on S_ERPC_REP_TABLE to public;


My problem is solved but not able to understand if query runs fine at one terminal and not on another. After giving privilege problem is solved.