Skip to content

SQL-006: Delete preference row

This DELETE removes a preference row for a given application/user combination, optionally scoped to a specific page name. It backs PreferenceData.DeletePref, invoked from SavePreferences when the supplied preference text is empty or whitespace-only.

Classification

Field Value
SQL ID SQL-006
Operation type Delete
Execution method Inline SQL (SqlHelper.ScalarQuery<int>.Execute)
Database Oracle
Schema [unqualified]**
Command type Text
Business object PreferenceData
Criteria property n/a (no IBusinessCriteria)
Lifecycle method DeletePref

Parameters

Parameter Direction Type Max length Description
:userid Input string (SqlHelper.NewParm) 40 Lower-cased user ID; row-selection predicate for delete.
:appname Input string (SqlHelper.NewParm) 40 Application name; row-selection predicate for delete.
:pagename Input string (SqlHelper.NewParm) 40 Optional page name; only bound when pageName is non-empty.

Tables

Table Access Columns used
USER_PREFERENCE DELETE USER_ID, APP_NAME, PAGE_NAME

Sample SQL

-- Default form (no page name supplied)
Delete from USER_PREFERENCE
where USER_ID = :userid
  and APP_NAME = :appname
  and PAGE_NAME is NULL
-- When pageName is supplied, the final predicate is replaced with:
Delete from USER_PREFERENCE
where USER_ID = :userid
  and APP_NAME = :appname
  and PAGE_NAME = :pagename

Operations and processes

Business rules

Sources

  • SAIF.Framework.Preferences\PreferenceData.cs