Issue with editing table with no pk or unique index

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
MarkF
Posts: 211
Joined: Thu 02 Mar 2006 14:55

Issue with editing table with no pk or unique index

Post by MarkF » Tue 08 Jul 2008 01:47

I'm using ODAC version 6.50.0.35 with Delphi 2007. When I try to edit a record in a table with no primary key or unique index, I get the error:

Project MyTest.exe raised exception class EAssertionFailed with message 'Unknown data type (C:\D7\Added\Odac\Lib\MemDS.pas, line 677)'.

This happens when not using ROWID (i.e. select * from scott.bonus) and it doesn't seem to matter if I update or insert.

Thanks for any help.

-Mark

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Tue 08 Jul 2008 07:31

We could not reproduce the problem with SCOTT.BONUS. Please send to odac*devart*com a complete small sample that demonstrates the problem.

MarkF
Posts: 211
Joined: Thu 02 Mar 2006 14:55

Post by MarkF » Tue 08 Jul 2008 13:09

I've investigated a bit more and it happens when EnableIntegers is False and EnableNumbers is True (although I didn't check all combinations of the settings.)

Here's a simple example. The error also happens when calling .lock on a record (in case that helps somehow.)

Code: Select all

procedure TForm1.TestButtonClick(Sender: TObject);
var
  OSession: TOraSession;
  OQuery: TSmartQuery;
begin
  Memo1.Lines.Clear();
  OSession := TOraSession.Create(nil);
  try
    OQuery := TSmartQuery.Create(nil);
    try
      OSession.Options.EnableIntegers := False;
      OSession.Options.EnableNumbers := True;

      OSession.Username := 'SCOTT';
      OSession.Password := 'TIGER';
      OSession.Server := 'MFMS3';
      OSession.Connect();

      OQuery.Session := OSession;

      OQuery.SQL.Text := 'select * from bonus';
      OQuery.Open;
      OQuery.Append;
      OQuery.Fields[0].AsString := 'Fish';
      OQuery.Post;
    finally
      OQuery.Free();
    end;
  finally
    OSession.Free();
  end;
end;
Let me know if you have any questions or comments! Thanks!

-Mark

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Wed 09 Jul 2008 09:30

We have fixed this problem. The fix will be included in the next build of ODAC.

MarkF
Posts: 211
Joined: Thu 02 Mar 2006 14:55

Post by MarkF » Thu 10 Jul 2008 11:14

Fantastic, Thanks!

-Mark

Post Reply