@@ -70,7 +70,7 @@ class TestCase(test_env.BaseTestCase):
7070 ]
7171
7272 def __bind_scalar_as_json (self , data ):
73- self .cursor .execute ("truncate table TestJson" )
73+ self .cursor .execute ("delete from TestJson" )
7474 out_var = self .cursor .var (oracledb .DB_TYPE_JSON , arraysize = len (data ))
7575 self .cursor .setinputsizes (None , oracledb .DB_TYPE_JSON , out_var )
7676 bind_data = list (enumerate (data ))
@@ -86,7 +86,7 @@ def __bind_scalar_as_json(self, data):
8686
8787 def test_3500_insert_and_fetch_single_json (self ):
8888 "3500 - insert and fetch single row with JSON"
89- self .cursor .execute ("truncate table TestJson" )
89+ self .cursor .execute ("delete from TestJson" )
9090 self .cursor .setinputsizes (None , oracledb .DB_TYPE_JSON )
9191 self .cursor .execute (
9292 "insert into TestJson values (:1, :2)" , [1 , self .json_data ]
@@ -98,7 +98,7 @@ def test_3500_insert_and_fetch_single_json(self):
9898 def test_3501_execute_with_dml_returning (self ):
9999 "3501 - inserting single rows with JSON and DML returning"
100100 json_val = self .json_data [11 ]
101- self .cursor .execute ("truncate table TestJson" )
101+ self .cursor .execute ("delete from TestJson" )
102102 json_out = self .cursor .var (oracledb .DB_TYPE_JSON )
103103 self .cursor .setinputsizes (None , oracledb .DB_TYPE_JSON , json_out )
104104 self .cursor .execute (
@@ -113,7 +113,7 @@ def test_3501_execute_with_dml_returning(self):
113113
114114 def test_3502_insert_and_fetch_multiple_json (self ):
115115 "3502 - insert and fetch multiple rows with JSON"
116- self .cursor .execute ("truncate table TestJson" )
116+ self .cursor .execute ("delete from TestJson" )
117117 self .cursor .setinputsizes (None , oracledb .DB_TYPE_JSON )
118118 data = list (enumerate (self .json_data ))
119119 self .cursor .executemany ("insert into TestJson values(:1, :2)" , data )
@@ -122,7 +122,7 @@ def test_3502_insert_and_fetch_multiple_json(self):
122122
123123 def test_3503_executemany_with_dml_returning (self ):
124124 "3503 - inserting multiple rows with JSON and DML returning"
125- self .cursor .execute ("truncate table TestJson" )
125+ self .cursor .execute ("delete from TestJson" )
126126 int_values = [i for i in range (len (self .json_data ))]
127127 out_int_var = self .cursor .var (int , arraysize = len (int_values ))
128128 out_json_var = self .cursor .var (
@@ -189,7 +189,7 @@ def test_3507_bind_number(self):
189189
190190 def test_3508_unsupported_python_type_bind (self ):
191191 "3508 - test binding unsupported python type with JSON"
192- self .cursor .execute ("truncate table TestJson" )
192+ self .cursor .execute ("delete from TestJson" )
193193 self .cursor .setinputsizes (None , oracledb .DB_TYPE_JSON )
194194 insert_sql = "insert into TestJson values (:1, :2)"
195195 self .assertRaisesRegex (
@@ -268,7 +268,7 @@ def test_3510_fetch_all_supported_types(self):
268268
269269 def test_3511_update_json (self ):
270270 "3511 - test inserting and updating JSON"
271- self .cursor .execute ("truncate table TestJSON" )
271+ self .cursor .execute ("delete from TestJSON" )
272272 self .cursor .setinputsizes (None , oracledb .DB_TYPE_JSON )
273273 self .cursor .executemany (
274274 "insert into TestJSON values (:1, :2)" ,
@@ -287,7 +287,7 @@ def test_3511_update_json(self):
287287
288288 def test_3512_json_query (self ):
289289 "3512 - test fetching json with json_query"
290- self .cursor .execute ("truncate table TestJson" )
290+ self .cursor .execute ("delete from TestJson" )
291291 self .cursor .setinputsizes (None , oracledb .DB_TYPE_JSON )
292292 self .cursor .executemany (
293293 "insert into TestJSON values (:1, :2)" ,
@@ -307,7 +307,7 @@ def test_3512_json_query(self):
307307
308308 def test_3513_json_exists (self ):
309309 "3513 - test fetching json with json_exists"
310- self .cursor .execute ("truncate table TestJson" )
310+ self .cursor .execute ("delete from TestJson" )
311311 self .cursor .setinputsizes (None , oracledb .DB_TYPE_JSON )
312312 self .cursor .executemany (
313313 "insert into TestJSON values (:1, :2)" ,
@@ -327,7 +327,7 @@ def test_3513_json_exists(self):
327327
328328 def test_3514_select_json (self ):
329329 "3514 - test selecting json data"
330- self .cursor .execute ("truncate table TestJson" )
330+ self .cursor .execute ("delete from TestJson" )
331331 self .cursor .setinputsizes (None , oracledb .DB_TYPE_JSON )
332332 self .cursor .executemany (
333333 "insert into TestJSON values (:1, :2)" ,
@@ -350,7 +350,7 @@ def test_3514_select_json(self):
350350
351351 def test_3515_json_serialize (self ):
352352 "3515 - test fetching json with json_serialize"
353- self .cursor .execute ("truncate table TestJson" )
353+ self .cursor .execute ("delete from TestJson" )
354354 data = [{"a" : 12.5 }, {"b" : True }, {"c" : None }]
355355 expected_data = ['{"a":12.5}' , '{"b":true}' , '{"c":null}' ]
356356 self .cursor .setinputsizes (None , oracledb .DB_TYPE_JSON )
0 commit comments