Writing database code that is fast, safe, and complies with Oracle Retail standards.
Coding Standards in RMS
Writing custom PL/SQL for Oracle RMS is not like writing standard database scripts. RMS is a highly concurrent OLTP (Online Transaction Processing) system. Your custom code must respect the established locking, error handling, and performance paradigms.
Pessimistic Locking
Because hundreds of users and batch processes might be trying to update inventory or prices simultaneously, RMS relies on Pessimistic Locking.
If your custom PL/SQL needs to update an item's custom attributes based on an event, you must lock the parent record in ITEM_MASTER first. This prevents deadlocks.
Error Handling
RMS has a standardized error handling package called RTK_ERRORS. When your custom code encounters a business validation failure, it should use this framework to throw standard translated error messages.
The Standard Pattern:
- Detect the business failure.
- Use
RTK_ERRORS.SET_ERRORto push an error message to the stack. - Return
FALSEfrom your function. (Do not raise raw Oracle exceptions for business logic failures).
Key Takeaways
- Prefix all custom objects (e.g.,
CUST_). - Never
COMMITinside a business logic package. - Use
FOR UPDATE NOWAITto lock base records before modifying linked custom tables. - Use
RTK_ERRORSfor throwing business logic errors instead of raw exceptions.


