- 1 CREATE OR REPLACE FUNCTION PLATFROM.parsejsonstr(p_jsonstr varchar2,startkey varchar2,endkey varchar2) RETURN VARCHAR2
- 2 IS
- 3 rtnVal VARCHAR2(1000);
- 4 FindIdxS NUMBER(2);
- 5 FindIdxE NUMBER(2);
- 6 BEGIN
- 7 if endkey='}' then
- 8 rtnVal:=substr(p_jsonstr,(instr(p_jsonstr,startkey)+length(startkey) +2)
- 9 ,(instr(p_jsonstr,endkey,instr(p_jsonstr,startkey))-instr(p_jsonstr,startkey)-length(startkey)-2));
- 10 else
- 11 rtnVal:=substr(p_jsonstr,(instr(p_jsonstr,startkey)+length(startkey) +2)
- 12 ,(instr(p_jsonstr,endkey,instr(p_jsonstr,startkey))-instr(p_jsonstr,startkey)-length(startkey)-4));
- 13 end if;
- 14 RETURN rtnVal;
- 15 END parsejsonstr;
- 16 /