How to check null value in if condition in pl sql with one example?
i want check the null value through if condition in procedure how to check the which column have the null value??
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Sukesh MarlaRank #461 · 5.4K reputationPosted Aug 10, 2012, 9:59 PM EDT
Select (case when Color=1 then 'RED' when Color='2' Then 'Blue' else 'NO Color' end) as Color From MYTable
You cant use if directly in between any query, For that we have 'case'
Pradip PandeyRank #452 · 5.6K reputationPosted Aug 11, 2012, 2:34 AM EDT
Select ISNULL(CountryName,'No Data') As CountryName, ISNULL(StateName,'No Data') As StateName From EmployeeTable
Akkiraju IvaturiRank #473 · 5.3K reputationPosted Aug 11, 2012, 12:33 PM EDT
In PLSQL to check if a value is null, you must use the "IS NULL" syntax.
For example,
If Lvalue contains a null value, the "IF" expression will evaluate to TRUE.
You can also use "IS NULL" in an SQL statement. For example:
This will return all records from the suppliers table where the supplier_name contains a null value.
Shankar MRank #874 · 2.5K reputationPosted Nov 26, 2012, 11:43 PM EST
You can use the NVL function in Oracle SQL to check the existance of NULL values.
Query:
SELECT empno, NVL (LASTNAME, '-')
FROM EMP;
Thanks,
Shankar