Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

DML inside a function

TinaFeb 22 2017 — edited Feb 22 2017

I have a scenario, where I have to call a procedure within a function.

Procedure has DML's in it, which at the end inserts into a table.

After procedure is run, based on data changed we select values for function.

As we can't have DML in a function, I tried to add pragma autonomous_transaction in procedure code.

However, I still can't select from that function.

If we use it in a select statement (select function from dual),I get the result as null ,even if it does everything (DML from proc call's).

Is there any way I can still invoke it from a select statement?

Begin

Function

            Procedure

select ....

End

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 22 2017
Added on Feb 22 2017
8 comments
1,898 views