Merged 9i specific setup into standard setup since Oracle 8i support is no
longer required; change tabs to spaces; add test for fixed char data types.
This commit is contained in:
parent
16d796d70e
commit
96f7decdce
|
@ -30,9 +30,9 @@ class TestObjectVar(BaseTestCase):
|
|||
[ ('INTCOL', cx_Oracle.NUMBER, 10, 22, 9, 0, 0),
|
||||
('OBJECTCOL', cx_Oracle.OBJECT, -1, 2000, 0, 0, 1),
|
||||
('ARRAYCOL', cx_Oracle.OBJECT, -1, 2000, 0, 0, 1) ])
|
||||
self.__TestData(1, (1, 'First row',
|
||||
self.__TestData(1, (1, 'First row', 'First ',
|
||||
cx_Oracle.Timestamp(2007, 3, 6, 0, 0, 0)), [5, 10, None, 20])
|
||||
self.__TestData(2, None, [3, None, 9, 12, 15])
|
||||
self.__TestData(3, (3, 'Third row',
|
||||
self.__TestData(3, (3, 'Third row', 'Third ',
|
||||
cx_Oracle.Timestamp(2007, 6, 21, 0, 0, 0)), None)
|
||||
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
* and packages necessary for performing the test suite.
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
whenever sqlerror exit failure
|
||||
|
||||
alter session set nls_date_format = 'YYYY-MM-DD HH24:MI:SS';
|
||||
alter session set nls_numeric_characters='.,';
|
||||
|
||||
|
@ -22,6 +24,7 @@ to cx_Oracle;
|
|||
create type cx_Oracle.udt_Object as object (
|
||||
NumberValue number,
|
||||
StringValue varchar2(60),
|
||||
FixedCharValue char(10),
|
||||
DateValue date
|
||||
);
|
||||
/
|
||||
|
@ -82,6 +85,12 @@ create table cx_Oracle.TestObjects (
|
|||
ArrayCol cx_Oracle.udt_Array
|
||||
);
|
||||
|
||||
create table cx_Oracle.TestTimestamps (
|
||||
IntCol number(9) not null,
|
||||
TimestampCol timestamp not null,
|
||||
NullableCol timestamp
|
||||
) tablespace users;
|
||||
|
||||
alter table cx_Oracle.testexecutemany
|
||||
add constraint testexecutemany_pk
|
||||
primary key (
|
||||
|
@ -144,8 +153,22 @@ begin
|
|||
end;
|
||||
/
|
||||
|
||||
begin
|
||||
for i in 1..10 loop
|
||||
insert into cx_Oracle.TestTimestamps
|
||||
values (i, to_timestamp('20021209', 'YYYYMMDD') +
|
||||
to_dsinterval(to_char(i) || ' 00:00:' || to_char(i * 2) || '.' ||
|
||||
to_char(i * 50)),
|
||||
decode(mod(i, 2), 0, to_timestamp(null, 'YYYYMMDD'),
|
||||
to_timestamp('20021209', 'YYYYMMDD') +
|
||||
to_dsinterval(to_char(i + 1) || ' 00:00:' ||
|
||||
to_char(i * 3) || '.' || to_char(i * 125))));
|
||||
end loop;
|
||||
end;
|
||||
/
|
||||
|
||||
insert into cx_Oracle.TestObjects values (1,
|
||||
cx_Oracle.udt_Object(1, 'First row',
|
||||
cx_Oracle.udt_Object(1, 'First row', 'First',
|
||||
to_date(20070306, 'YYYYMMDD')),
|
||||
cx_Oracle.udt_Array(5, 10, null, 20));
|
||||
|
||||
|
@ -153,7 +176,7 @@ insert into cx_Oracle.TestObjects values (2, null,
|
|||
cx_Oracle.udt_Array(3, null, 9, 12, 15));
|
||||
|
||||
insert into cx_Oracle.TestObjects values (3,
|
||||
cx_Oracle.udt_Object(3, 'Third row',
|
||||
cx_Oracle.udt_Object(3, 'Third row', 'Third',
|
||||
to_date(20070621, 'YYYYMMDD')), null);
|
||||
|
||||
commit;
|
||||
|
@ -409,3 +432,5 @@ create or replace package body cx_Oracle.pkg_TestOutCursors as
|
|||
end;
|
||||
/
|
||||
|
||||
exit
|
||||
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
/*-----------------------------------------------------------------------------
|
||||
* SetupTest_9i.sql
|
||||
* Additional setup for Oracle 9i databases only.
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
alter session set nls_date_format = 'YYYY-MM-DD HH24:MI:SS';
|
||||
alter session set nls_numeric_characters='.,';
|
||||
|
||||
create table cx_Oracle.TestTimestamps (
|
||||
IntCol number(9) not null,
|
||||
TimestampCol timestamp not null,
|
||||
NullableCol timestamp
|
||||
) tablespace users;
|
||||
|
||||
begin
|
||||
for i in 1..10 loop
|
||||
insert into cx_Oracle.TestTimestamps
|
||||
values (i, to_timestamp('20021209', 'YYYYMMDD') +
|
||||
to_dsinterval(to_char(i) || ' 00:00:' || to_char(i * 2) || '.' ||
|
||||
to_char(i * 50)),
|
||||
decode(mod(i, 2), 0, to_timestamp(null, 'YYYYMMDD'),
|
||||
to_timestamp('20021209', 'YYYYMMDD') +
|
||||
to_dsinterval(to_char(i + 1) || ' 00:00:' ||
|
||||
to_char(i * 3) || '.' || to_char(i * 125))));
|
||||
end loop;
|
||||
end;
|
||||
/
|
||||
|
||||
commit;
|
||||
|
Loading…
Reference in New Issue