TOracleDirectPathLoader with Date and Time

Using Delphi 7 and DOA 4.0.6.2 and Oracle 8.1.7

Cannot load date and time into one field. Only date is ok.

Tried to alter nls_date_format with many different notations - but nothing helped.

Source code:

OracleQuery1.SQL.Text := 'alter session set nls_date_format = ''DD.MM.YYYY HH24:MI:SS''';
OracleQuery1.Execute;
// Set the session and table name
Loader.Session := OracleSession1;
Loader.TableName := tabname;
// Get the default columns for the record_data table
Loader.GetDefaultColumns(true);
// Prepare the loader
Loader.Prepare;
// Process all data in batches of records
Row := 0;
:
:
myList.Append('16.08.2005 08:02:44');
Loader.Columns.SetData(Row, @myList.strings[myList.count-1][1], Length(myList.strings[myList.count-1]))
inc(Row);
:
:
Loader.Load(Row);
>

- or other error message depending on format and data.
 
There could be 2 reasons for this error:

1. The Loader or the Column has a different DateFormat specified than the NLS_DATE_FORMAT.

2. The myList.strings[myList.count-1] property translates to a function that returns a string value, in which case the memory location myList.strings[myList.count-1][1] may no longer hold the string data when the Load function is called.
 
It functions if

Loader.DateFormat:= 'DD.MM.YYYY HH24:MI:SS';

is used instead of 'alter session set nls_date_format = ''DD.MM.YYYY HH24:MI:SS''';

Thanks for reply.

:-) Peter
 
Back
Top