Stock Counts: Unit & Dollar Counting
No matter how accurate your system is, physical theft and register errors cause inventory drift. Stock Counts (or Stocktakes) bring the system back to reality. Learn how RMS orchestrates annual wall-to-wall counts and daily cycle counts via the STAKE_HEAD architecture.
Inventory data naturally degrades over time. Items are stolen, cashiers scan the wrong barcode, and warehouse workers misplace pallets. To run a profitable retail business, you must periodically count the physical goods and force the system to match reality.
In Oracle RMS, this process is known as a Stock Count (or Stocktake). This guide breaks down the database architecture behind scheduling counts, taking the snapshot, calculating the variance, and posting the financial adjustments.
1. Unit vs. Unit & Dollar Counts
RMS supports two vastly different types of stock counts, dictated by the STOCKTAKE_TYPE in STAKE_HEAD.
Unit Counts (Cycle Counting)
Unit counts are operational. A store manager might decide to count all laptops today because they are high-theft items.
- They update
STOCK_ON_HAND. - Any variance creates a standard
Tran Code 22adjustment. - Stores remain open during the count.
Unit & Dollar Counts (Wall-to-Wall)
Unit & Dollar counts are financial audits. Typically performed once a year, an external auditing firm counts every single item in the store.
- The store is completely locked down (no sales, no receipts, no transfers).
- RMS takes a massive financial snapshot of the expected inventory value.
- The variance permanently calculates the store's annual "Shrinkage" for the corporate balance sheet.
2. The Stock Count Lifecycle
- Scheduling: The count is created in
STAKE_HEADwith a scheduled date. - Snapshot: On the morning of the count, a batch program (
stksched) takes a snapshot ofITEM_LOC_SOHfor all items involved and writes it toSTAKE_SKU_LOC. This freezes the "Expected Quantity". - Counting: Store associates use handheld RF scanners (integrated via SIM) to count physical items.
- Import: The physical count quantities are uploaded to RMS (
STAKE_QTY). - Reconciliation: RMS compares the Snapshot (Expected) against the Physical (Actual). If the variance is within tolerance, it is accepted.
- Update: The
stockupdbatch runs, forcingITEM_LOC_SOHto match the physical count and writingTran Code 22adjustments for the variance.
3. The Snapshot and Variance
The most critical part of a stock count is the Snapshot.
If RMS expects you to have 100 units, it records SNAPSHOT_QTY = 100.
If your store associates count 95 units, the variance is -5.
The Late Sale Problem
If a store stays open during a count, a customer might buy 1 unit after the snapshot is taken but before the associate counts the shelf. The associate counts 94 units. The variance is now -6. RMS has complex late-sale processing logic to adjust the snapshot dynamically to prevent double-counting the missing unit!
4. Core Tables Reference
Stocktake Snapshot (STAKE_SKU_LOC)
| Column | Type | Description |
|---|---|---|
STOCKTAKE_ID | NUMBER(10) | Links to STAKE_HEAD. |
ITEM | VARCHAR2(25) | The item being counted. |
LOCATION | NUMBER(10) | The store or warehouse. |
SNAPSHOT_QTY | NUMBER(12,4) | The expected inventory at the time the count began. |
COUNT_QTY | NUMBER(12,4) | The final approved physical count. |
ADJUSTMENT_QTY | NUMBER(12,4) | The delta (COUNT_QTY - SNAPSHOT_QTY). |
5. SQL Deep Dives
Auditing Stocktake Shrinkage
After a Unit & Dollar count is complete, finance wants to know the total financial shrinkage (loss) for a store.
6. Official Oracle Resources
For further reading, consult the official Oracle documentation:


