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
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 =>
6) Open the file in NotePad again, but save it now as "UTF8".
7) Run the program and press the button =>
8) Open the file in NotePad again, but save it now as "Unicode".
9) Run the program and press the button =>
Could this be fixed plz?
Roeland
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: