ORA-14551: cannot perform a DML operation inside a query
Hi,
I have the below function it is succesffully exceutes the select command but fails at delete by throwing the error - ORA-14551: cannot perform a DML operation inside a query
create or replace function ap_dml_tbsal_st_00(var_l_session_id in out number,
var_bank_code in varchar2,
var_party_id in varchar2)
return number as
begin
select party_type from abc where party_id = var_party_id;
begin
DELETE FROM xyz WHERE xyz.SESSION_ID = var_l_session_id;
exception
when others then
dbms_output.put_line(SQLERRM);
raise_application_error(-1,
*'failed while deleting TBL_TBSAL_ST_00 ');*
end;
end;
Thanks,
Sarada