select-json.sql 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. drop procedure if exists fnc_curr_reward_bal;
  2. create procedure fnc_curr_reward_bal()
  3. BEGIN
  4. -- setup 변수들 --
  5. Declare _sgroup_id int;
  6. -- see manual int ---- https://dololak.tistory.com/257 Json Data extract
  7. SELECT json_extract(sorder_json, '$.OfcCode') from dbr_sorder where setup_code = 'office-info'
  8. END;
  9. SELECT json_extract(setup_json, '$.REyeLens.LongPd') from dbr_sorder where sorder_nosorder_no = '200928-152292'
  10. SET @json_k = '{
  11. "qqq": "aaa"
  12. }';
  13. SELECT json_extract(@json_k, '$.qqq');
  14. SELECT @json_k = JSON_replace(@json_k, "$.qqq", "kkk");
  15. SELECT @json_k;
  16. SELECT json_extract(@json_k, '$.qqq');
  17. select json_extract(json1, '$.REyeLens.Sph') from dbr_sorder where id =2 ;
  18. select json_replace(json1, '$.REyeLens.Sph', 'hhhh') from dbr_sorder where id =2 ;
  19. SET @json_k = '{
  20. "qqq": "aaa"
  21. }';
  22. update dbr_sorder set json1 = json_replace(@json_k, '$.REyeLens.Sph', 'qqeqrq')where id =2 ;
  23. SET @json_k = '{
  24. "qqq": "aaa"
  25. }';
  26. update dbr_sorder set json1 = json_replace(@json_k, '$.qqq', 'qqeqrq') where id =2 ;