Print Thread
TOracleDataSet. Append - Error
#6218 03/23/04 06:48 PM
Joined: Mar 2004
Posts: 2
Germany
S
Member
OP Offline
Member
S
Joined: Mar 2004
Posts: 2
Germany
Hallo!

I have DOA 4.0.3.
And all what I want to do is:

DS: TOracleDataSet;
DS.Session:=MySession;

DS.SQL.Text:='select * from MyTBL';
DS.ReadOnly:=false;
DS.Open();
DS.Append; { ----- ERROR ------ }
DS.FindField('....').AsString:=....;
DS.Post;

But after DS.Append see I an Error Message,
which in translating at English is:
"EDatabaseError. Dataset, which is only for reading, can not be changed"

if I make:
Q: TOracleQuery;
Q.Session:=MySession;

Q.SQL.Text:='insert into MyTBL values (......)'
Q.Execute

Than all be OK?

What must I make with TOracleDataSet?

Thank You!

Johnny.

Re: TOracleDataSet. Append - Error
#6219 03/23/04 10:26 PM
Joined: Aug 1999
Posts: 22,208
Member
Offline
Member
Joined: Aug 1999
Posts: 22,208
To make a dataset updateable, you will need to add the rowid:

DS.SQL.Text:='select MyTBL.*, rowid from MyTBL';

[quote]
Making a dataset updateable
To be able to update records, a dataset needs to know the 'rowid' of every retrieved record. A rowid is an internal Oracle structure that uniquely identifies a record in the database. As long as you do not include it in the query, the CanModify property of the dataset remains False. To make an updateable dept dataset, the SQL property would be:

select dept.*, dept.rowid from dept

Furthermore, you should not use column aliases for the updateable table in the select statement of an updateable dataset. These alias names would be used in subsequent insert or updates to the updating table, and would therefore lead to an error.

If for some reason it is not possible to supply a rowid in the query, you can use the OnApplyRecord event to make the dataset updateable.[/quote]


Marco Kalter
Allround Automations
Re: TOracleDataSet. Append - Error
#6220 03/24/04 12:51 PM
Joined: Mar 2004
Posts: 2
Germany
S
Member
OP Offline
Member
S
Joined: Mar 2004
Posts: 2
Germany
Thank you, Marco!
I have tested all you said, super!

Johnny.


Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.058s Queries: 14 (0.008s) Memory: 2.5022 MB (Peak: 3.0393 MB) Data Comp: Off Server Time: 2024-05-03 20:26:00 UTC
Valid HTML 5 and Valid CSS