Post
by Moehre » Thu 09 Jan 2014 11:58
I can reproduce the error building a simple test app on an Oracle Database Version 11.1.0.7.0:
1. Build Table TEST
CREATE TABLE TEST (
NLS_ID NUMBER(5) NOT NULL,
SKZ VARCHAR2(3) NOT NULL,
CONSTRAINT PK_TEST
PRIMARY KEY (NLS_ID,SKZ),
NLSTEXT VARCHAR2(255) NOT NULL);
2. Insert test data
insert into test values (10100,'D','Test1');
insert into test values (10110,'D','Test2');
insert into test values (10120,'D','Test3');
3. Create new Delphi XE5 VCL project:
Put following on the form: TOraSession, TOraQuery, TMemo, TButton
Set TOraSession.LoginPrompt to "True"
Add "OdacVCL" to the uses clause
Put following code to the TButton1.Click event:
procedure Form1.TButton1Click(Sender: TObject);
var
i: integer;
begin
OraSession1.Connected := true;
OraQuery1.CLose;
OraQuery1.SQL.Text := 'SELECT NLSTEXT FROM TEST';
OraQuery1.SQL.Add('WHERE SKZ = :skz');
OraQuery1.SQL.Add('AND NLS_ID = :nlsid');
try
OraQuery1.Prepare;
except
ShowMessage('ERROR during PREPARE');
exit;
end;
for i := 10100 to 10199 do
begin
OraQuery1.Close;
OraQuery1.Params[0].AsWideString := 'D';
OraQuery1.Params[1].AsInteger := i;
try
OraQuery1.Open;
except
ShowMessage('ERROR during SELECT');
exit;
end;
Memo1.Lines.Add(IntToStr(i) + ': ' + OraQuery1.Fields[0].AsWideString);
end;
Start the program, enter the connection data und push the Button.
The 1st time I started the app it runs without errors but all string data was empty, the 2nd and further attempts I get the error "ORA-01480" (even if I restart XE5 ?!)
The error occurs in line 13547 of Data.DB unit:
Result := (GetRecord(GetBuffer(FRecordCount), GetMode, True) = grOK);
Hope this helps ...