I have the below code in test.sql file. When there is a record in test_summary table everything works fine. But when there is no record inside the table it fails. I want it to continue to print the dbms_output message and process when there is no record. How can I do that?
declare
total_var number(20,2) := 0.0;
nl_var number(20,2) := 0.0;
begin
select col1,col2
into total_var,nl_var
from testsch.test_summary;
dbms_output.put_LINE('');
dbms_output.put_LINE('testing1' || total_var);
dbms_output.put_LINE('testing2' || nl_var);
end;