Fun_RemoveJsonKey.md 1.05 KB

Fun_RemoveJsonKey (function)

  • Type: FUNCTION
  • Returns: longtext
  • Deterministic: NO
  • SQL data access: CONTAINS SQL

Parameters

# Mode Name Type
1 IN sJson longtext
2 IN skey varchar(50)
3 IN sValue varchar(50)

Body

Body is not pre-cached. To inspect: mysql --defaults-file=~/.my.cnf -e 'SHOW CREATE FUNCTIONFunRemoveJsonKey'._

Narrative

Business context: Generic JSON-array element remover used by the production-scheduling tree/Gantt builders to drop a single record matching skey = sValue.

What it does: Iterates the JSON array; the first element whose $.<skey> equals sValue is removed (JSON_REMOVE) and the modified array returned immediately.

Invocation: Called from sp_manufacture_productionplaninfotrace, sp_manufacture_productionplaninfotrace1, Sp_Manufacture_ProductionPlanInfoTree_Base, and Sp_Manufacture_ProductionPlanInfoTree_Base_TC — the production-plan info-tree builders that power the scheduling-board UI.