I am trying to get this project to work with oracle 9i. I almost have it working but for some reason its messing up on parsing the second object inside of array’s.. Can anyone help me fix this last error ?
I had to replace the regex like function and add a blob to clob function.. I also had to change the regex parts to use the function and move to a bool return using anther function…I also had to move to using a different set of escape characters because 9i does not support the grouping function.
create or replace FUNCTION regexp_like (source_char IN VARCHAR2
, pattern IN VARCHAR2
, match_parameter IN VARCHAR2 DEFAULT NULL)
RETURN INTEGER
AS
/**********
* Program : regexp_like
* Version : 1.0
* Author : Philip Moore
* Date : 20-JUN-2009 Anno Domini
* Purpopse : This provides a pseudo "REGEXP_LIKE" operator for Oracle 9iR2
* Warnings : Do NOT compile in an Oracle 10GR2 database (or above)! **********/
-- Variables
l_return INTEGER;
BEGIN
IF owa_pattern.match (line => source_char
, pat => pattern
, flags => match_parameter) THEN
l_return := 1;
ELSE
l_return := 0;
END IF;
RETURN l_return;
END regexp_like;
create or replace FUNCTION regexp_tf(input_num number ) RETURN BOOLEAN
AS
/**********
* Purpopse : This Converts 1 and 0 to be true false like regex returns normally
* Warnings : Do NOT compile in an Oracle 10GR2 database (or above)! **********/
BEGIN
IF input_num = 1 THEN
return true;
ELSE
return false;
END IF;
END regexp_tf;
create or replace procedure blob_to_clob(
c IN BLOB,
dest_lob IN OUT NOCOPY CLOB CHARACTER SET ANY_CS,
amount IN INTEGER,
dest_offset IN OUT INTEGER,
src_offset IN OUT INTEGER,
blob_csid IN NUMBER,
lang_context IN OUT INTEGER,
warning OUT INTEGER )
-- typecasts CLOB to BLOB (binary conversion)
IS
pos PLS_INTEGER := 1;
buffer RAW( 32767 );
lob_len PLS_INTEGER := DBMS_LOB.getLength( c );
BEGIN
DBMS_LOB.createTemporary( dest_lob, TRUE );
DBMS_LOB.OPEN( dest_lob, DBMS_LOB.LOB_ReadWrite );
LOOP
buffer := UTL_RAW.cast_to_raw( DBMS_LOB.SUBSTR( c, 16000, pos ) );
IF UTL_RAW.LENGTH( buffer ) > 0 THEN
DBMS_LOB.writeAppend( dest_lob, UTL_RAW.LENGTH( buffer ), buffer );
END IF;
pos := pos + 16000;
EXIT WHEN pos > lob_len;
END LOOP;
--RETURN dest_lob; -- dest_lob is OPEN here
END blob_to_clob;
Path for json_parser.sql
227c227
< while(REGEXP_LIKE(buf, '^[[:alnum:]_]$', 'i')) loop
return
'<?xml version="1.0" encoding="UTF-8"?>
79c80
< Redistribution and use in source and binary forms, with or without modification,
Redistribution and use in source and binary forms, with or without modification,
82,85c83,86
< Redistributions of source code must retain the above copyright notice, this
< list of conditions and the following disclaimer. Redistributions in binary
< form must reproduce the above copyright notice, this list of conditions and the
< following disclaimer in the documentation and/or other materials provided with
Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer. Redistributions in binary
form must reproduce the above copyright notice, this list of conditions and the
following disclaimer in the documentation and/or other materials provided with
88,96c89,97
< THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
< ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
< WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
< IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
< INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
< BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
< DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
< LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
< OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
114,115c115,116
<
<
196,200c197,201
< <xsl:template match="text()[not(string(number())='NaN' or
< (starts-with(.,'0' ) and . != '0' and
< not(starts-with(.,'0.' ))) or
< (starts-with(.,'-0' ) and . != '-0' and
< not(starts-with(.,'-0.' )))
I am trying to get this project to work with oracle 9i. I almost have it working but for some reason its messing up on parsing the second object inside of array’s.. Can anyone help me fix this last error ?
I had to replace the regex like function and add a blob to clob function.. I also had to change the regex parts to use the function and move to a bool return using anther function…I also had to move to using a different set of escape characters because 9i does not support the grouping function.
create or replace FUNCTION regexp_like (source_char IN VARCHAR2
, pattern IN VARCHAR2
, match_parameter IN VARCHAR2 DEFAULT NULL)
RETURN INTEGER
AS
/**********
* Program : regexp_like
* Version : 1.0
* Author : Philip Moore
* Date : 20-JUN-2009 Anno Domini
* Purpopse : This provides a pseudo "REGEXP_LIKE" operator for Oracle 9iR2
* Warnings : Do NOT compile in an Oracle 10GR2 database (or above)!
**********/
-- Variables
l_return INTEGER;
BEGIN
IF owa_pattern.match (line => source_char
, pat => pattern
, flags => match_parameter) THEN
l_return := 1;
ELSE
l_return := 0;
END IF;
RETURN l_return;
END regexp_like;
create or replace FUNCTION regexp_tf(input_num number ) RETURN BOOLEAN
AS
/**********
* Purpopse : This Converts 1 and 0 to be true false like regex returns normally
* Warnings : Do NOT compile in an Oracle 10GR2 database (or above)!
**********/
BEGIN
IF input_num = 1 THEN
return true;
ELSE
return false;
END IF;
END regexp_tf;
create or replace procedure blob_to_clob(
c IN BLOB,
dest_lob IN OUT NOCOPY CLOB CHARACTER SET ANY_CS,
amount IN INTEGER,
dest_offset IN OUT INTEGER,
src_offset IN OUT INTEGER,
blob_csid IN NUMBER,
lang_context IN OUT INTEGER,
warning OUT INTEGER )
-- typecasts CLOB to BLOB (binary conversion)
IS
pos PLS_INTEGER := 1;
buffer RAW( 32767 );
lob_len PLS_INTEGER := DBMS_LOB.getLength( c );
BEGIN
DBMS_LOB.createTemporary( dest_lob, TRUE );
DBMS_LOB.OPEN( dest_lob, DBMS_LOB.LOB_ReadWrite );
LOOP
buffer := UTL_RAW.cast_to_raw( DBMS_LOB.SUBSTR( c, 16000, pos ) );
IF UTL_RAW.LENGTH( buffer ) > 0 THEN
DBMS_LOB.writeAppend( dest_lob, UTL_RAW.LENGTH( buffer ), buffer );
END IF;
pos := pos + 16000;
EXIT WHEN pos > lob_len;
END LOOP;
--RETURN dest_lob; -- dest_lob is OPEN here
END blob_to_clob;
Path for json_parser.sql
227c227
< while(REGEXP_LIKE(buf, '^[[:alnum:]_]$', 'i')) loop
Patch for json_ext.sql
151c151
< if(not regexp_like(buf, '^[[:alnum:]_ ]+', 'c') ) then
Patch for json_util_pkg.sql
43c43
< Remarks: