Search code examples
sqloracle-databasecommitstored-functions

Should I COMMIT after creating a function?


If I create a function, is it best practice to COMMIT after its creation?

CREATE OR REPLACE FUNCTION myFunction (somevar varchar2)
   ...
   END

It executes and adds the function to the database, but should I add a COMMIT to the bottom of the file? Perhaps also wrap with BEGIN and END?


Solution

  • Creating a function is a DDL operation. You don't need to commit after creating it.

    As committing there is just pointless, the best practice would be not not commit after creating a function.