I am trying to create a simple anonymous function. I am getting an error with the put_line that I can't find a solution to that is close to my problem.
for Sal in salPtr
loop
if Sal.ESalary <= Threshold then
Tax:=0;
newSal:=0;
Tax := Sal.ESalary * Rates.Rate1;
newSal := Sal.ESalary - Tax;
dbms_output.put_line(Sal.Eid||': ' || Sal.ESalary ||' '|| Tax || ' '||newSal);
Taxtotal := Taxtotal + tax;
end if;
I have salPtr as a cursor and all the other variables are all set to zero in the declare statement. I need to print all the variables on the same line as it is set right now.
ORA-06550: line 42, column 23:
PLS-00382: expression is of wrong type
ORA-06550: line 42, column 13:
PL/SQL: Statement ignored
ORA-06550: line 43, column 34:
PLS-00306: wrong number or types of arguments in call to '||'
ORA-06550: line 43, column 13:
PL/SQL: Statement ignored
Any help would be greatly appreciated. I have the same error in another part for the else case, but trying to understand what I am doing here would really help.
I was able to execute below block without any issues. Please check your DBMS statements.