11CREATE OR REPLACE
22PACKAGE BODY json_sql_UT IS
33
4- -- $Id: json_sql_ut.pkb 49652 2016-12-08 18:17:30Z doberkofler $
4+ -- $Id: json_sql_ut.pkb 51368 2017-06-19 13:02:35Z doberkofler $
55
66----------------------------------------------------------
77-- PRIVATE TYPES
3333 ROW_3 CONSTANT VARCHAR2(2000) := '{"ID":3,"NAME":"martin donovan","BIRTHDAY":"'||toJSON(TODAY+2)||'"}';
3434
3535 aSql VARCHAR2(2000);
36- aBinding json_object := json_object ();
36+ aBinding jsonObject := jsonObject ();
3737 aLob CLOB := empty_clob();
3838BEGIN
3939 UT_util.module('UT_object');
4343
4444 -- select all rows
4545 aSql := 'SELECT * FROM temp_json_sql_ut ORDER BY id';
46- json_sql.get(theSqlStatement =>aSql, format=>json_sql.FORMAT_OBJ).to_clob(theLobBuf=>aLob);
46+ json_sql.get(sqlCmd =>aSql, format=>json_sql.FORMAT_OBJ).to_clob(theLobBuf=>aLob);
4747 UT_util.eqLOB( theTitle => aSql,
4848 theComputed => aLob,
4949 theExpected => TO_CLOB('{"rows":['||ROW_1||','||ROW_2||','||ROW_3||']}'),
5252
5353 -- select one row
5454 aSql := 'SELECT * FROM temp_json_sql_ut WHERE id = 2';
55- json_sql.get(theSqlStatement =>aSql, format=>json_sql.FORMAT_OBJ).to_clob(theLobBuf=>aLob);
55+ json_sql.get(sqlCmd =>aSql, format=>json_sql.FORMAT_OBJ).to_clob(theLobBuf=>aLob);
5656 UT_util.eqLOB( theTitle => aSql,
5757 theComputed => aLob,
5858 theExpected => TO_CLOB('{"rows":['||ROW_2||']}'),
6262 -- select one row using bind variables
6363 aSql := 'SELECT * FROM temp_json_sql_ut WHERE id = :id';
6464 aBinding.put('id', 3);
65- json_sql.get(theSqlStatement =>aSql, theBinding =>aBinding, format=>json_sql.FORMAT_OBJ).to_clob(theLobBuf=>aLob);
65+ json_sql.get(sqlCmd =>aSql, sqlBind =>aBinding, format=>json_sql.FORMAT_OBJ).to_clob(theLobBuf=>aLob);
6666 UT_util.eqLOB( theTitle => aSql,
6767 theComputed => aLob,
6868 theExpected => TO_CLOB('{"rows":['||ROW_3||']}'),
7171
7272 -- select no row
7373 aSql := 'SELECT * FROM temp_json_sql_ut WHERE id = 0';
74- json_sql.get(theSqlStatement =>aSql, format=>json_sql.FORMAT_OBJ).to_clob(theLobBuf=>aLob);
74+ json_sql.get(sqlCmd =>aSql, format=>json_sql.FORMAT_OBJ).to_clob(theLobBuf=>aLob);
7575 UT_util.eqLOB( theTitle => aSql,
7676 theComputed => aLob,
7777 theExpected => TO_CLOB('{"rows":[]}'),
9393 ROW_3 CONSTANT VARCHAR2(2000) := '[3,"martin donovan","'||toJSON(TODAY+2)||'"]';
9494
9595 aSql VARCHAR2(2000);
96- aBinding json_object := json_object ();
96+ aBinding jsonObject := jsonObject ();
9797 aLob CLOB := empty_clob();
9898BEGIN
9999 UT_util.module('UT_array');
@@ -103,7 +103,7 @@ BEGIN
103103
104104 -- select all rows
105105 aSql := 'SELECT * FROM temp_json_sql_ut ORDER BY id';
106- json_sql.get(theSqlStatement =>aSql).to_clob(theLobBuf=>aLob);
106+ json_sql.get(sqlCmd =>aSql).to_clob(theLobBuf=>aLob);
107107 UT_util.eqLOB( theTitle => aSql,
108108 theComputed => aLob,
109109 theExpected => TO_CLOB('{'||COLS||',"rows":['||ROW_1||','||ROW_2||','||ROW_3||']}'),
@@ -112,7 +112,7 @@ BEGIN
112112
113113 -- select one row
114114 aSql := 'SELECT * FROM temp_json_sql_ut WHERE id = 2';
115- json_sql.get(theSqlStatement =>aSql).to_clob(theLobBuf=>aLob);
115+ json_sql.get(sqlCmd =>aSql).to_clob(theLobBuf=>aLob);
116116 UT_util.eqLOB( theTitle => aSql,
117117 theComputed => aLob,
118118 theExpected => TO_CLOB('{'||COLS||',"rows":['||ROW_2||']}'),
@@ -122,7 +122,7 @@ BEGIN
122122 -- select one row using bind variables
123123 aSql := 'SELECT * FROM temp_json_sql_ut WHERE id = :id';
124124 aBinding.put('id', 3);
125- json_sql.get(theSqlStatement =>aSql, theBinding =>aBinding).to_clob(theLobBuf=>aLob);
125+ json_sql.get(sqlCmd =>aSql, sqlBind =>aBinding).to_clob(theLobBuf=>aLob);
126126 UT_util.eqLOB( theTitle => aSql,
127127 theComputed => aLob,
128128 theExpected => TO_CLOB('{'||COLS||',"rows":['||ROW_3||']}'),
@@ -131,7 +131,7 @@ BEGIN
131131
132132 -- select no row
133133 aSql := 'SELECT * FROM temp_json_sql_ut WHERE id = 0';
134- json_sql.get(theSqlStatement =>aSql).to_clob(theLobBuf=>aLob);
134+ json_sql.get(sqlCmd =>aSql).to_clob(theLobBuf=>aLob);
135135 UT_util.eqLOB( theTitle => aSql,
136136 theComputed => aLob,
137137 theExpected => TO_CLOB('{'||COLS||',"rows":[]}'),
0 commit comments