How to extract data from json field in h2 db

834 views
Skip to first unread message

VARTIKA VARSHNEY

unread,
May 18, 2020, 8:44:03 AM5/18/20
to H2 Database
hi 
I have h2 Db install for junit testing in my project but I am unable to extract the data from the json type of field.
I have a query like Select JSON_EXTRACT(drvd.derived_data, '$.postProcessorFiles.ecg')  AS ecg_url from derived_data drvd which is written in Mysql db.
While testing the above query in h2 db I am getting an error of Function "JSON_EXTRACT" not found. I have searched for it but didn't any solution.
Can anyone help me on this how to excute the above query in h2 DB?
Thanks in advance

Evgenij Ryazanov

unread,
May 18, 2020, 9:59:35 AM5/18/20
to H2 Database
Hello.

H2 doesn't have any built-in JSON decomposition functions yet, you can only write an own user-defined function for such purpose that can use some third-party JSON library.
Reply all
Reply to author
Forward
0 new messages