TOracleDirectPathLoader ORA-01009 with LONG Fieldtypes

TOracleDirectPathLoader generally works fine, but when loading fields with type LONG then the Oracle error "ORA-01009 missing mandatory parameter" occurs.

Delphi 7 and DOA 4.0.6.2 trial were used.

Source code from the sample:

Loader.Session := OracleSession1;
Loader.TableName := tabname;
Loader.GetDefaultColumns(true);
Loader.Prepare;
>

A reply to an other topic says, that there should be no difference between VARCHAR2 and LONG. But this seems not to be ok.
 
Here it is.

You only need to create a new application with a BitBtn and a TOracleSession.

QUESTION: Is it ok when I click on the "Default Columns" button in the TOracleDirectPath-Columns-Dialog that the fields are not sorted correctly? The LONG fields come after all others!


Code:
(*

CREATE TABLE TEST (
  NR NUMBER(10, 0) NOT NULL,
  HINWEIS VARCHAR2(10),          <<<<< this works, but changed to LONG it fails !!!
  MANDANT NUMBER(10, 0)
)

*)

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Oracle, StdCtrls, Buttons;

type
  TForm1 = class(TForm)
    BitBtn1: TBitBtn;
    OracleSession1: TOracleSession;
    procedure BitBtn1Click(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.BitBtn1Click(Sender: TObject);
var Loader: TOracleDirectPathLoader;
const d1 : shortstring = '1';
      d2 : shortstring = '2';
      d3 : shortstring = '3';
begin
  // Create a Loader at run time
  Loader := TOracleDirectPathLoader.Create(nil);
  try
    OracleSession1.Connected := true;
    Loader.Session           := OracleSession1;
    Loader.TableName         := 'TEST';
    Loader.LogMode           := lmNoLogging;
    Loader.DateFormat        := 'DD.MM.YYYY HH24:MI:SS';
    Loader.GetDefaultColumns(true);
    Loader.Prepare;
    // SetData
    Loader.Columns[0].SetData(0, @d1[1], Length(d1));
    Loader.Columns[1].SetData(0, @d2[1], Length(d2));
    Loader.Columns[2].SetData(0, @d3[1], Length(d3));
    // The array is filled, or we have processed all records:
    // load this batch of records
    try
       Loader.Load(1);
    except
           // In case of an error: show where things went wrong
           // and abort the load operation
           on E:EOracleError do
              begin
                   ShowMessage(E.Message + #13#10 +
                           'Row = ' + IntToStr(Loader.LastRow) + #13#10 +
                           'Col = ' + IntToStr(Loader.LastColumn));
                   Loader.Abort;
                   raise;
              end;
    end;
    Loader.Finish;
  finally
    Loader.Free;
  end;
end;

end.
 
Back
Top