LobLocator.LoadFromFile problem

Roeland

Member³
Hi,

When using the TLobLocator.LoadFromFile to load textfiles, the file has to be UNICODE.

Example:

1) Drop a OracleSession, Button and Memo component on a Form.
Make sure that the OracleSession is connected to a database.
2) Copy the Button1Click event

Code:
unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    OracleSession1: TOracleSession;
    Button1: TButton;
    Memo1: TMemo;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
  mLobLocator: TLOBLocator;
begin
  mLobLocator := TLOBLocator.CreateTemporary(OracleSession1, otClob, True);
  try
    mLobLocator.LoadFromFile('C:\Temp\LobLocator_Test.txt');

    Memo1.Lines.Add(mLobLocator.AsString);

  finally
    mLobLocator.Free;
  end;
end;

end.

3) Open NotePad and write "Hello World"
4) Save this file as "ANSI" (FileName has to match that of the event, in this case 'C:\Temp\LobLocator_Test.txt')
5) Run the program and press the button =>

Code:
"ORA-24801: Ongeldige parameterwaarde in OCI-LOB-functie."

6) Open the file in NotePad again, but save it now as "UTF8".
7) Run the program and press the button =>

Code:
Some sort of Chinese

8) Open the file in NotePad again, but save it now as "Unicode".
9) Run the program and press the button =>

Code:
Hello World

Could this be fixed plz?

Roeland
 
Last edited:
What is the character set of the database and the client?
It's the same for database and client:
AL32UTF8

I have also send you the "All pages info" from PL/SQL Developer.

Roeland
 
Hello,

I am having the same issue.

The TXT file has to be UNICODE otherwise I'm getting ORA-24801 while calling:

LOB := TLOBLocator.CreateTemporary(OracleSession1, otCLOB, True);
LOB.LoadFromFile(filenames);

DOA 4.1.2.

DB Server: Win7 x64 11.2.0.3 (AL32UTF8)
DB Client: Win7 x32 11.2.0.3 NLS_LANG = SLOVAK_SLOVAKIA.UTF8

Am I doing something wrong?

Thanks.
Daniel.
 
Back
Top