Strange OraTable problem during append / rowid
Posted: Thu 14 Sep 2006 09:17
I have a very strange problem with TOraTable (Odac 5.7 for delphi):
I use a TOraTable component with FilterSQL property set to something like "MANDANT = :m1 AND LAGER = :m2". I then open it and check, wether dada exists or not. If not, I try to append:
TOraQuery.Append;
TOraQuery.Fields[0].AsString := '1';
TOraQuery.Fields[1].AsString := '99';
...
In my old version compiled with an older Odac suite this worked fine. Now, at the first "Fields[0].AsString :=" line I get an error:
"Field ROWID can not be changed"
In fact, Fields[0] refers to ROWID, this did not happen in the older version! If I run the program against an 8.1i Oracle DB this error occurs; if I start it on my local 10g test database, it works fine?!
Why does TOraTable behave this way? How can I deactivate the select of the ROWID as FIELD[0] ?
Many thanks in advance
Detlev Moehring, germany
Edit: I have made some tests and it grows stranger and stranger:
I created a table TEST with a few columns and build a test application to use TOraTable for selecting and editing data. That works fine! If i debug TOraTable.sql.text it is "SELECT * FROM TEST" and that's what I want.
So I replaced the Tablename "TEST" with the original tablename (on the same database) and after the prepare statement I checked the "TOraTable.SQL.TExt" property again;
"SELECT ROWID, T FROM "
WHY?? What is the reason for TOraTable to use another query strategy on different tables?
That is ugly!
I use a TOraTable component with FilterSQL property set to something like "MANDANT = :m1 AND LAGER = :m2". I then open it and check, wether dada exists or not. If not, I try to append:
TOraQuery.Append;
TOraQuery.Fields[0].AsString := '1';
TOraQuery.Fields[1].AsString := '99';
...
In my old version compiled with an older Odac suite this worked fine. Now, at the first "Fields[0].AsString :=" line I get an error:
"Field ROWID can not be changed"
In fact, Fields[0] refers to ROWID, this did not happen in the older version! If I run the program against an 8.1i Oracle DB this error occurs; if I start it on my local 10g test database, it works fine?!
Why does TOraTable behave this way? How can I deactivate the select of the ROWID as FIELD[0] ?
Many thanks in advance
Detlev Moehring, germany
Edit: I have made some tests and it grows stranger and stranger:
I created a table TEST with a few columns and build a test application to use TOraTable for selecting and editing data. That works fine! If i debug TOraTable.sql.text it is "SELECT * FROM TEST" and that's what I want.
So I replaced the Tablename "TEST" with the original tablename (on the same database) and after the prepare statement I checked the "TOraTable.SQL.TExt" property again;
"SELECT ROWID, T FROM "
WHY?? What is the reason for TOraTable to use another query strategy on different tables?
That is ugly!