Can I perform a DML operation in PL/SQL Functions

Tags:
PL/SQL
SQL
How can I perform a DML operation in PL/SQL Functions

Answer Wiki

Thanks. We'll let you know when a new response is added.

If you are only going to call the function from PL/SQL code, then you can without any restrictions.

If you are going to call it from SQL, you can if you really need to, regardless of the type of DML operation you want to perform. To do it you have to make the function an autonomous transaction. This is not something you should usually do, so, make sure you have a good reason to do it.

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • Subhendu Sen
    What DML operation did you want to operate? There are various DML operations (insert, update/delete). Assuming that you are in a learning process or try to complete some database related course. You must read your study materials where you can find the answers easily. Also please link here for more help: https://docs.oracle.com/cd/B13789_01/appdev.101/b10807/06_ora.htm

    96,960 pointsBadges:
    report
  • ToddN2000
    What are you trying to do? Post your code and we can help you fix it so it works. With out any details or example it could be any number of commands.
    92,960 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: