@@ -760,6 +760,7 @@ def test_2337(self):
760760 ("INTVALUE" , oracledb .DB_TYPE_NUMBER , 38 , 0 , None ),
761761 ("SMALLINTVALUE" , oracledb .DB_TYPE_NUMBER , 38 , 0 , None ),
762762 ("REALVALUE" , oracledb .DB_TYPE_NUMBER , 63 , - 127 , None ),
763+ ("DECIMALVALUE" , oracledb .DB_TYPE_NUMBER , 20 , 6 , None ),
763764 ("DOUBLEPRECISIONVALUE" , oracledb .DB_TYPE_NUMBER , 126 , - 127 , None ),
764765 ("FLOATVALUE" , oracledb .DB_TYPE_NUMBER , 126 , - 127 , None ),
765766 (
@@ -863,6 +864,81 @@ def test_2342(self):
863864 self .assertIsNone (obj .INNER2 .ATTR1 )
864865 self .assertEqual (obj .INNER2 .ATTR2 , value2 )
865866
867+ def test_2343 (self ):
868+ "2343 - test varray of numbers"
869+ obj_type = self .conn .gettype ("UDT_VARRAYOFNUMBER" )
870+ obj = self .cursor .callfunc (
871+ "pkg_NestedTable.GetVarrayOfNumber" , obj_type
872+ )
873+ self .assertEqual (obj .aslist (), [10 , 20 , 30 ])
874+
875+ def test_2344 (self ):
876+ "2344 - test table of numbers"
877+ obj_type = self .conn .gettype ("UDT_TABLEOFNUMBER" )
878+ obj = self .cursor .callfunc (
879+ "pkg_NestedTable.GetTableOfNumber" , obj_type
880+ )
881+ self .assertEqual (obj .aslist (), [15 , 25 , 35 , 45 ])
882+
883+ def test_2345 (self ):
884+ "2345 - test table of varray of numbers"
885+ obj_type = self .conn .gettype ("UDT_TABLEOFVARRAYOFNUMBER" )
886+ obj = self .cursor .callfunc (
887+ "pkg_NestedTable.GetTableOfVarrayOfNumber" , obj_type
888+ )
889+ plain_obj = self .get_db_object_as_plain_object (obj )
890+ self .assertEqual (plain_obj , [[10 , 20 ], [30 , 40 ]])
891+
892+ def test_2346 (self ):
893+ "2346 - test nested table of nested tables"
894+ num_tab_type = self .conn .gettype ("UDT_TABLEOFNUMBER" )
895+ tab_num_tab_type = self .conn .gettype ("UDT_TABLEOFTABLEOFNUMBER" )
896+
897+ num_tab_1 = num_tab_type .newobject ([1 , 2 ])
898+ num_tab_2 = num_tab_type .newobject ([3 , 4 , 5 ])
899+ num_tab_3 = num_tab_type .newobject ([6 , 7 , 8 , 9 , 10 ])
900+ tab_num_tab = tab_num_tab_type .newobject (
901+ [num_tab_1 , None , num_tab_2 , None , num_tab_3 ]
902+ )
903+
904+ self .cursor .execute (
905+ """
906+ insert into NestedCollectionTests (Id, TableCol)
907+ values (:1, :2)
908+ """ ,
909+ [1 , tab_num_tab ],
910+ )
911+ self .cursor .execute ("select TableCol from NestedCollectionTests" )
912+ (obj ,) = self .cursor .fetchone ()
913+ plain_obj = self .get_db_object_as_plain_object (obj )
914+ expected_data = [[1 , 2 ], None , [3 , 4 , 5 ], None , [6 , 7 , 8 , 9 , 10 ]]
915+ self .assertEqual (plain_obj , expected_data )
916+
917+ def test_2347 (self ):
918+ "2347 - test nested table of varrays"
919+ num_tab_type = self .conn .gettype ("UDT_TABLEOFNUMBER" )
920+ arr_num_tab_type = self .conn .gettype ("UDT_VARRAYOFTABLEOFNUMBER" )
921+
922+ num_tab_1 = num_tab_type .newobject ([4 , 8 ])
923+ num_tab_2 = num_tab_type .newobject ([1 , 3 , 5 ])
924+ num_tab_3 = num_tab_type .newobject ([2 , 6 , 10 , 7 , 9 ])
925+ tab_num_tab = arr_num_tab_type .newobject (
926+ [num_tab_1 , None , num_tab_2 , None , num_tab_3 ]
927+ )
928+
929+ self .cursor .execute (
930+ """
931+ insert into NestedCollectionTests (Id, VarrayCol)
932+ values (:1, :2)
933+ """ ,
934+ [1 , tab_num_tab ],
935+ )
936+ self .cursor .execute ("select VarrayCol from NestedCollectionTests" )
937+ (obj ,) = self .cursor .fetchone ()
938+ plain_obj = self .get_db_object_as_plain_object (obj )
939+ expected_data = [[4 , 8 ], None , [1 , 3 , 5 ], None , [2 , 6 , 10 , 7 , 9 ]]
940+ self .assertEqual (plain_obj , expected_data )
941+
866942
867943if __name__ == "__main__" :
868944 test_env .run_test_cases ()
0 commit comments