To answer your question of why it's inserting nulls, that is because you aren't providing any values to the procedure parameters when you execute it.
Based on what you stated in the question and your comment above, it seems you are missing some fundamental skills in working with Oracle. The code you wrote is a procedure, not a function, so you can't call it in a SELECT
statement. A procedure is called inside of a plsql block. Your procedure as written takes two arguments, which you must pass to the procedure call via the calling code. The procedure code you wrote does not look for data from the XML_HOURS_LOAD
table.
We've all been the new person learning Oracle. You'll want to look at some tutorials to get you started on the fundamentals of pl/sql coding to help clear up the differences between functions and stored procedures and how to use parameter arguments.
From what you wrote in your question, I believe this is the code you want:
DECLARE
p_code IS XML_HOURS_LOAD.code%TYPE,
p_product IS XML_HOURS_LOAD.product%TYPE;
CURSOR cXmlHoursLoadCursor IS (SELECT code, product FROM xml_hours_load);
BEGIN
FOR v IN cXmlHoursLoadCursor LOOP
Cascade_Load(v.code, v.product);
COMMIT;
END LOOP;
END;