---
title: "SQL-033: Update a user favorite"
summary: Update a user favorite
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-08-17
library: SAIF.Business.Menu
reference_type: package
---

# SQL-033: Update a user favorite

This statement is the `UpdateSQL` implementation of `clsMenuFavorite.Criteria`, executed from `BeforeUpdate` against `MENU_FAVORITE`. Update a user favorite.

## Classification

| Field | Value |
| --- | --- |
| **SQL ID** | SQL-033 |
| **Operation type** | Update |
| **Execution method** | Inline SQL |
| **Database** | Oracle |
| **Schema** | `[unqualified]`** |
| **Command type** | Text |
| **Business object** | `clsMenuFavorite` |
| **Criteria property** | `UpdateSQL` |
| **Lifecycle method** | `BeforeUpdate` |

## Parameters

| Parameter | Direction | Type | Max length | Description |
| --- | --- | --- | --- | --- |
| `:MenuFavoriteSeqNum` | Input | Decimal | N/A | Bound twice — once from the instance property, once from `MyCriteria`; also assigned to itself in the SET list* |
| `:UserID` | Input | String | 30 | Owning menu user |
| `:UserEmplID` | Input | String | 11 | Owning user's employee ID |
| `:MenuItemSeqNum` | Input | Decimal | N/A | Favorited menu item |
| `:MenuOrder` | Input | Decimal | N/A | Display order among the user's favorites |
| `:ItemInactiveDate` | Input | Date | N/A | Soft-deactivation date; `NULL` while the favorite is active |

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [MENU_FAVORITE](../database-tables.md#menu_favorite) | UPDATE | MENU_FAVORITE_SEQ_NUM, MENU_USER, MENU_USER_EMPLID, MENU_ITEM_SEQ_NUM, MENU_ORDER_NUM, ITEM_INACTIVE_DATE (SET); MENU_FAVORITE_SEQ_NUM (WHERE) |

## Sample SQL

```sql
-- Update a user favorite
Update
  MENU_FAVORITE
Set
  MENU_FAVORITE_SEQ_NUM = :MenuFavoriteSeqNum,
  MENU_USER = :UserID,
  MENU_USER_EMPLID = :UserEmplID,
  MENU_ITEM_SEQ_NUM = :MenuItemSeqNum,
  MENU_ORDER_NUM = :MenuOrder,
  ITEM_INACTIVE_DATE = :ItemInactiveDate
Where
  MENU_FAVORITE.MENU_FAVORITE_SEQ_NUM = :MenuFavoriteSeqNum
```

## Operations and processes

- [Update or delete a maintained object](../operations/op-menu-07-update-delete-maintained-object.md)

## Business rules

- [BR-MENU-020](../business-rules.md#br-menu-020-single-row-write-verification): Single-row write verification

> **Note:** Statements marked with `*` were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts. Statements marked with `**` could not be confirmed; treat as unknown until verified.

## Sources
- SAIF.Business.Menu/clsMenuFavorite.vb
