Print Thread
Problem with Directpathloader
#44185 07/04/12 10:28 AM
Joined: Mar 2010
Posts: 5
Germany
T
Member
OP Offline
Member
T
Joined: Mar 2010
Posts: 5
Germany
I have a problem with DirectPathloader

when executing following code I will get a

ORA-01841 (year < -4713 or zero or >+9999)
Row =0, Column = 1


error in the sourcecode line of 'Ldr.Load(Row);'

Code
/Fill the array 
    for i := 0 to .... do         
    begin
      resarray[i].dts:=formatdatetime('dd.mm.yyyy hh:nn:ss',dt); //String
...
    end;
...
    ldr.DateFormat:='DD.MM.YYYY HH24:MI:SS';
    ldr.Column[1].DataSize:=21;
    ldr.Column[1].DateFormat:='DD.MM.YYYY HH24:MI:SS';


  for i := 0 to length(Resarray) - 1 do
  begin
...
    ldr.Column[1].SetData(Row, @Resarray[i].dts[1], length(Resarray[i].dts));
...

    Inc(Row);
    // We have filled the array, or we are at the end of the file: load it
    if (Row = Ldr.MaxRows) or (i = length(Resarray) - 1) then
    begin
      try
        Ldr.Load(Row);
      except
        on E:EOracleError do
        begin
          showmessage(E.Message + #13#10#13#10 +
...
The date format of the loader is set correct and also the dateformat in the field. The resarray[i].dts contains strings like '01.07.2012 00:00:00'. There are no constraints in the table.

What could be the problem?

Re: Problem with Directpathloader
ThomasW69 #44189 07/05/12 08:51 AM
Joined: Mar 2010
Posts: 5
Germany
T
Member
OP Offline
Member
T
Joined: Mar 2010
Posts: 5
Germany
And this is the tabe to be filled with data.
Code
create table HD_TIMESERIES_VALUES
(
  TS_ID   NUMBER(20) not null,
  VTIME   DATE not null,
  VALUE   NUMBER(10,3) default 0 not null,
  STATUS1 VARCHAR2(1),
  STATUS2 VARCHAR2(1),
  VDATUM  DATE,
  constraint PK_TIMESERIES_VAL primary key (TS_ID, VTIME)
)
organization index;

Re: Problem with Directpathloader
ThomasW69 #44191 07/05/12 09:06 AM
Joined: Aug 1999
Posts: 22,214
Member
Offline
Member
Joined: Aug 1999
Posts: 22,214
Can you let me know your Delphi version and the declaration of the resarray element type?


Marco Kalter
Allround Automations
Re: Problem with Directpathloader
Marco Kalter #44193 07/05/12 09:24 AM
Joined: Mar 2010
Posts: 5
Germany
T
Member
OP Offline
Member
T
Joined: Mar 2010
Posts: 5
Germany
It is Delphi 2009 Enterprise.

Code

Type
   TDateValue= record
      dt: TDatetime;
      dts:string;
      value: double;
    end;


var resarray:Array of TDateValue;

The "dts" was inserted into TDatevalue for the loader to handle the datetime "dt" field VTIME in the table as string. So the datatype in the loader for "VTIME" is dpString and the size is 21 char.

Code
var dt:TDatetime;
...
resarray[i].dt :=dt; //TDatetime
resarray[i].dts:=formatdatetime('dd.mm.yyyy hh:nn:ss',dt); //String
...


Re: Problem with Directpathloader
ThomasW69 #44199 07/06/12 08:57 AM
Joined: Mar 2010
Posts: 5
Germany
T
Member
OP Offline
Member
T
Joined: Mar 2010
Posts: 5
Germany
I solved the probem by replacing
Code
TDateValue= record
      dt: TDatetime;
      dts:string;
      value: double;
    end;
with
Code
TDateValue= record
      dt:    TDatetime;
      dts:   ansistring;  //<-!!
      value: double;
    end;

Since Delphi 2009 unicode strings are supported so that the string-type consists of 2 bytes per character. It looks like the TDirectoraclePathloader can not handle unicode strings in my DOA Version.


Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.021s Queries: 14 (0.005s) Memory: 2.5166 MB (Peak: 3.0393 MB) Data Comp: Off Server Time: 2024-05-09 14:44:18 UTC
Valid HTML 5 and Valid CSS