# `sp_update_pricecolumn` (procedure)

> 修改表字段单价长度


- **Type:** PROCEDURE
- **Deterministic:** NO
- **SQL data access:** CONTAINS SQL

## Parameters

_No parameters._

## Body

_Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW CREATE PROCEDURE `sp_update_pricecolumn`'`._

## Narrative

**Business context:** DBA-side schema migration helper (修改表字段单价长度) — bulk-widens every `%Price` column in the `xlyweberp` schema to `decimal(24,13)` so price-related numeric precision stops truncating values across the catalog.

**What it does:** Counts then cursor-iterates `information_schema.COLUMNS` for `TABLE_SCHEMA='xlyweberp' AND COLUMN_NAME LIKE '%Price' AND TABLE_NAME NOT LIKE 'viw_%' AND TABLE_NAME NOT LIKE '%_copy%' AND TABLE_NAME NOT LIKE '%backup%'`. For each `(TABLE_NAME, COLUMN_NAME)` pair, builds and executes `ALTER TABLE … MODIFY COLUMN … decimal(24,13) NOT NULL DEFAULT 0`. Excludes views, copies, and backup tables.

**Invocation:** Status: appears orphaned. No caller found in any channel; the only xly-src hit is its own install script `script/标版/刷新字段/sp_update_pricecolumn.sql`. Run manually by a DBA when needed — no form-master or scheduler binding. Note: the schema literal `xlyweberp` is hard-coded; it won't operate on a SaaS schema like `xlyweberp_saas_ai` without edits.
