Lock that prevents SELECT
The situation is as follows:
An ERP application (Totvs) with several tables All these tables use as primary key a default field R_E_C_N_O_
The application (I believe) creates a new record common select max (R_E_C_N_O_) + 1
But I need a package plsql create records in some of these tables but when competing with the ERP errors occur of ORA-00001: exclusive restriction
My question is: Is there any syntax in which it is possible "lock" the max (R_E_C_N_O_) in case of a specific table?
The idea is to have a "wait" and not allow that the ERP application and the package have the same R_E_C_N_O_ future.
I can not remember how to change the ERP Everything should be in the PLSQL package
Of course minimizing the possibility by DEADLOCKs