Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of intercepting the content of JSON string by Oracle

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Oracle intercepts the contents of JSON string, as shown in the following code:

CREATE OR REPLACE FUNCTION PLATFROM.parsejsonstr (p_jsonstr varchar2,startkey varchar2,endkey varchar2) RETURN VARCHAR2 IS rtnVal VARCHAR2 (1000); FindIdxS NUMBER (2); FindIdxE NUMBER (2); BEGIN if endkey='} 'then rtnVal:=substr (p_jsonstr, (instr (pairjsonstr.startkey) + length (startkey) + 2), (instr (pairjsonstrendkey) instr)-instr (pairjsonstre)-length (startkey)-2)) Else rtnVal:=substr (p_jsonstr, (instr (pairjsonstrGraft startkey) + length (startkey) + 2), (instr (pawnjsonstrary Endkey Endkey instr (pawnjsonstringer startkey))-instr (pairjsonstrand startkey)-length (startkey)-4)); end if; RETURN rtnVal; END parsejsonstr; /

Parameter description:

P_jsonstr: target JSON string

Startkey: the key value of JSON content to be intercepted

Endkey: the next key of the target key

Example: select parsejsonstr (INFO,'AGE', 'HEIGHT') from TTTT

The figure shows the contents of the TTTT table, with an example of intercepting AGE information in INFO.

Summary

The above is the method of intercepting the content of JSON string by Oracle introduced by the editor. I hope it will be helpful to you. If you have any questions, you are welcome to leave a message. The editor will reply you in time!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report