mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 20:49:49 +02:00
fcl-db: dbtestframework, Oracle:
* ftLargeint requires NUMBER(19,0) instead of NUMBER(18,0)/NUMERIC(18,0) in order to cater for entire largeint range: see http://docs.oracle.com/cd/B19306_01/server.102/b14232/apb.htm * Oracle ftdate/ftdatetime/ftTime require date/timestamp literals: e.g. DATE '2000-01-01', TIMESTAMP '0001-01-01 10:45:12.000', See SQL Reference 10g Release 2 http://docs.oracle.com/cd/B19306_01/server.102/b14200/sql_elements003.htm#BABGIGCJ git-svn-id: trunk@26900 -
This commit is contained in:
parent
54f0f58f63
commit
2d8ea638b3
@ -28,7 +28,7 @@ const
|
||||
SQLConnTypesNames : Array [TSQLConnType] of String[19] =
|
||||
('MYSQL40','MYSQL41','MYSQL50','MYSQL51','MYSQL55','MYSQL56','POSTGRESQL','INTERBASE','ODBC','ORACLE','SQLITE3','MSSQL','SYBASE');
|
||||
|
||||
STestNotApplicable = 'This test does not apply to this sqldb-connection type';
|
||||
STestNotApplicable = 'This test does not apply to this sqldb connection type';
|
||||
|
||||
|
||||
type
|
||||
@ -244,8 +244,8 @@ begin
|
||||
ssOracle:
|
||||
begin
|
||||
FieldtypeDefinitions[ftBoolean] := '';
|
||||
//At least Oracle 10, 11 do not support a BIGINT field:
|
||||
FieldtypeDefinitions[ftLargeInt] := 'NUMERIC(18,0)';
|
||||
// At least Oracle 10, 11 do not support a BIGINT field:
|
||||
FieldtypeDefinitions[ftLargeInt] := 'NUMBER(19,0)';
|
||||
FieldtypeDefinitions[ftTime] := 'TIMESTAMP';
|
||||
FieldtypeDefinitions[ftMemo] := 'CLOB';
|
||||
end;
|
||||
@ -409,10 +409,39 @@ begin
|
||||
begin
|
||||
sql := sql + ',F' + Fieldtypenames[FType];
|
||||
if testValues[FType,CountID] <> '' then
|
||||
if FType in [ftCurrency] then
|
||||
sql1 := sql1 + ',' + testValues[FType,CountID]
|
||||
else
|
||||
sql1 := sql1 + ',' + QuotedStr(testValues[FType,CountID])
|
||||
case FType of
|
||||
ftCurrency:
|
||||
sql1 := sql1 + ',' + testValues[FType,CountID];
|
||||
ftDate:
|
||||
// Oracle requires date conversion; otherwise
|
||||
// ORA-01861: literal does not match format string
|
||||
if SQLServerType in [ssOracle] then
|
||||
// ANSI/ISO date literal:
|
||||
sql1 := sql1 + ', DATE ' + QuotedStr(testValues[FType,CountID])
|
||||
else
|
||||
sql1 := sql1 + ',' + QuotedStr(testValues[FType,CountID]);
|
||||
ftDateTime:
|
||||
// similar to ftDate handling
|
||||
if SQLServerType in [ssOracle] then
|
||||
begin
|
||||
// Could be a real date+time or only date. Does not consider only time.
|
||||
if pos(' ',testValues[FType,CountID])>0 then
|
||||
sql1 := sql1 + ', TIMESTAMP ' + QuotedStr(testValues[FType,CountID])
|
||||
else
|
||||
sql1 := sql1 + ', DATE ' + QuotedStr(testValues[FType,CountID]);
|
||||
end
|
||||
else
|
||||
sql1 := sql1 + ',' + QuotedStr(testValues[FType,CountID]);
|
||||
ftTime:
|
||||
// similar to ftDate handling
|
||||
if SQLServerType in [ssOracle] then
|
||||
// More or less arbitrary default time; there is no time-only data type in Oracle.
|
||||
sql1 := sql1 + ', TIMESTAMP ' + QuotedStr('0001-01-01 '+testValues[FType,CountID])
|
||||
else
|
||||
sql1 := sql1 + ',' + QuotedStr(testValues[FType,CountID]);
|
||||
else
|
||||
sql1 := sql1 + ',' + QuotedStr(testValues[FType,CountID])
|
||||
end
|
||||
else
|
||||
sql1 := sql1 + ',NULL';
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user