When your crew_comptrain_refresh
procedure is run and picks up NULL
values, it usually means:
The source tables already contain NULL
s.
Your queries inside the procedure don't filter them out.
How to resolve:
Add IS NOT NULL
filters to your SELECT
statements.
Use NVL(column, 'default')
or COALESCE(column, 'default')
to replace NULL
s if needed.
Ensure INNER JOIN
is used instead of LEFT JOIN
if you expect mandatory matches.
Add DBMS_OUTPUT.PUT_LINE
statements to debug and find which variable/column is returning NULL
.
To find the problematic columns:
SELECT * FROM table WHERE column IS NULL;
to locate missing data.