Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

fetch all the records of a table

ora_learner36Jun 4 2021

Hi All,
Hope all are doing good.
I need your help in writing a SQL query, my requirement is to fetch all the records of a table when a null value is given to its parameter (&empno) and fetch the specific record when a specific value is given to the same parameter(&empno).
eg:- select * from emp where emp='&empno'; ---if value of &empno is null fetch all the records of the table.
eg:- select * from emp where emp='&empno'; ---if value of &empno is '1234' query should fetch the record of empno '1234' the table.

Thanks in advance.
Regards.

This post has been answered by Frank Kulash on Jun 4 2021
Jump to Answer
Comments
Post Details
Added on Jun 4 2021
8 comments
3,379 views