// i want the code in procedure only//
how to replace the null value with charecter value('no data") and how to identify which column having the null value this code write in procedure
i have one table conntryname, statename in both column i inserted values through procedure but i want identify which column having the null value and that value is replace by 'no data'
Blocked AccountPosted Nov 27, 2012, 5:54 AM
You can also do that by using this query
Select COALESCE(CountryName,'No Data') As CountryName, COALESCE(StateName,'No Data') As StateName From EmployeeTable
Shankar MPosted Nov 27, 2012, 4:48 AM
Hi User,
You can use the NVL function in Oracle SQL to check the existance of NULL values.
But i want Identify which column having the null value:
SELECT *
FROM TABLENAME
WHERE columname IS NULL;
To replace the Null data using NVL function:
Example Query:
SELECT empno, NVL (LASTNAME, 'No Data')
FROM EMP;
Thanks,
Shankar
Pradip PandeyPosted Aug 11, 2012, 6:25 AM
You can check this by 2 ways and they are either
Select ISNULL(CountryName,'No Data') As CountryName, ISNULL(StateName,'No Data') As StateName From EmployeeTable
OR
Select CASE WHEN CountryName IS NULL THEN 'No Data' Else CountryName END AS CountryName, CASE WHEN StateName IS NULL THEN 'No Data' Else StateName End AS StateName From EmployeeTable