# `FUN_JSON_CHAR` (function)

> 请求后处理


- **Type:** FUNCTION
- **Returns:** `longtext`
- **Deterministic:** NO
- **SQL data access:** CONTAINS SQL

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `sParam` | `longtext` |
| 2 | IN | `sKey` | `varchar(200)` |

## Body

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

## Narrative

**Business context:** Tiny JSON-string accessor. Intended to support the `sp_btn_action` button-event dispatcher in reading textual fields out of `sButtonParam` / change-value JSON payloads.

**What it does:** Validates `sParam` is JSON; returns `JSON_UNQUOTE(JSON_EXTRACT(sParam, sKey))` or `''` if missing/invalid. Two-line helper.

**Invocation:** Orphan-via-dead-chain. Only two routine callers (`sp_btn_action`, `sp_btn_action_updatequoquotationslave`) — both themselves orphans (no form, no module hook, no Java reference). One customer override script in `xly-src/script/客户/万昌/计件工资/sp_btn_WorkOrderAssessmentPassRate.sql` references it, but that proc is not deployed in the live DB. Candidate for maintainer audit.
