Goal :- json_extract does not exist error.
I do have message body like this.
< message type = "chat"
to = "[email protected]"
from = "[email protected]/9fs4kgn090" > < body > {
"opponent_xmpp_id": "[email protected]",
"latest_message_id": "6233"
} < /body><active>http:/ / jabber.org / protocol / chatstates < /active></message >
I am trying to extract opponent_xmpp_id and latest_message_id.
for that i have written a query like below.
SELECT LEFT(ExtractValue( stanza, "//@from" ),LOCATE("@",ExtractValue( stanza, "//@from" )) - 1),
LEFT(ExtractValue( stanza, "//@to" ),LOCATE("@",ExtractValue( stanza, "//@to" )) - 1),
ExtractValue(stanza, "//body"),
ExtractValue(stanza, "//@chattype"),
TRIM(BOTH '"' FROM json_extract(ExtractValue(stanza, "//body"), '$.opponent_xmpp_id')) AS opponent_xmpp_id,
json_extract(ExtractValue(stanza,"//body"),'$.latest_message_id') AS latest_message_id
FROM
ofOffline
causes error
1305 - FUNCTION databaseName.json_extract does not exist
As per i searched its supporting in > MYsql 5.7 version only.
So is there any function which do the simmilar job as json_extract in MySQL client version: 5.5.52 ?