FUNCTION/TRIGGER AND COMMIT
Hello friends ,
When I relate of as to why we cannot use ddl/(dml with commit), inside a function then the below points came to my mind.
1) Since often functions are like black box to the invoker ,so if one uses a function call right in the middle of his transaction ,then the DDl/(DML with commit) can prove to be very wrong since functions can be called from within a sql statements ,which can commit a part of the transaction without the invoker knowing of it . so the alternative comes to make it an autonomous transaction and I fully agree to this .
2)But why isnt this check valid for a procedure .What i mean to say is that a procedure can be called from within some other plsql block .So why cant the above points be valid for procedures as well. I know it is not like that , but why ??
Thanks in advance and I really appreciate everyone for their reply :)