5

I have a string stored as json in a mysql table. I need to parse the string and return the value within a stored procedure.

Does Mysql 5.5 support this?

I came across this UDF: https://github.com/ChrisCinelli/mysql_json

Unfortunately, I cannot install this UDF on my mysql server due to operational issues.

How to parse json in mysql?

Note: We use percona version of MySQL

ssk
  • 9,045
  • 26
  • 96
  • 169
  • It's worth noting that Postgres has fantastic JSON support. If you're stuck with MySQL and can't install an extension, you're going to be in for a hard time. – tadman Mar 09 '16 at 19:38

1 Answers1

4

I ended up using common_schema: https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/common-schema/common_schema-2.2.sql

It has json parsing function: https://common-schema.googlecode.com/svn/trunk/common_schema/doc/html/extract_json_value.html

ssk
  • 9,045
  • 26
  • 96
  • 169
  • Here is link on HTML file, i believe it's the same as the one thats missing: https://github.com/rpbouman/common-schema/blob/master/common_schema/doc/html/extract_json_value.html – Hrvoje Jul 05 '18 at 08:08