# `Sp_elematerials_UpdateStyle` (procedure)

> 物料信息保存过程


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

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `sGuid` | `varchar(2000)` |
| 2 | IN | `sData` | `longtext` |
| 3 | IN | `sAllData` | `longtext` |
| 4 | IN | `sFormGuid` | `varchar(100)` |
| 5 | IN | `sLoginId` | `varchar(100)` |
| 6 | IN | `sBrId` | `varchar(100)` |
| 7 | IN | `sSuId` | `varchar(100)` |
| 8 | OUT | `sCode` | `int` |
| 9 | OUT | `sReturn` | `varchar(4000)` |

## Body

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

## Narrative

**Business context:** "卷筒料只能输入材料宽" guard. For reel-stock materials (`elematerials.bReel=1`), the safety-stock rows on `elematerialssafe` must not carry a length spec (`sLength1`) — only width is meaningful for a reel. Same body as the trailing block of `Sp_elematerials_AfterUpdate`, factored into a standalone proc.

**What it does:** Two `COUNT(*)` probes against `elematerialssafe JOIN elematerials` on `bReel=1 AND sLength1<>''`: one keyed by exact `sId=sGuid`, one by `LOCATE(A.sId, sGuId)>0` (multi-id selection). If either count is positive, aborts with `sCode=-1` and `sReturn = Fun_Sis_GetConstNew('', 'sJtMaterialOnlyInputWidth', '', sBrId, sSuId)`.

**Invocation:** Status: appears orphaned. No gdsmodule hook, no form-master, no other routine `CALL`s it, no xly-src reference. The "_UpdateStyle" suffix is non-standard for xly's dispatcher slots; appears to be a refactor extract of the reel-stock check from `Sp_elematerials_AfterUpdate` that was never wired. Candidate for maintainer audit.
