Print Thread
key violation when posting record
#2575 10/10/01 02:24 AM
Joined: Oct 2001
Posts: 2
R
rbarth Offline OP
Member
OP Offline
Member
R
Joined: Oct 2001
Posts: 2
i use oracle, doa, midas and delphi5.

for inserts i set the key fields in before insert triggers in oracle.

when i insert records in my client cds i get a key violation during the 2. post because the 2. key is null, like the first one.

if i use ado instead of doa i don't have this problem so it seem that doa/oracledataset tells the cds via the provider wich fields are key fields.

so how can i prevent cds from knowing that this field is a key field?

regards,
ralf barth

Re: key violation when posting record
#2576 10/11/01 04:03 PM
Joined: Aug 1999
Posts: 22,220
Member
Offline
Member
Joined: Aug 1999
Posts: 22,220
Hmm, I don't immediately have a solution for this. The key is indeed reported to the client dataset. I guess we need a feature that would allow you to disable this.

------------------
Marco Kalter
Allround Automations


Marco Kalter
Allround Automations
Re: key violation when posting record
#2577 10/12/01 01:23 PM
Joined: Jun 2001
Posts: 8
Berlin, Germany
R
Member
Offline
Member
R
Joined: Jun 2001
Posts: 8
Berlin, Germany
thx marco,

1. question:
do you plan to implement thouse solution and when would it be ready?

the problem is: there is a (very bad i guess) solution by dan miser: i have to fill the key fields with dummy numbers for the post and then mark them as 'no update fields', (TField.ProviderFlags.pfInUpdate := false i guess, have to test if it works).
for this dirty workaround (i really don't like it) i should know which fields are the key fields. we have no special cds/provider/oracledataset for each table we do all the things dynamic. but i can't find a property in my clientdataset field object for this.
so the 2. question:
can i read the info you give the cds about the key fields?

regards,
ralf

Re: key violation when posting record
#2578 10/18/01 04:46 PM
Joined: Aug 1999
Posts: 22,220
Member
Offline
Member
Joined: Aug 1999
Posts: 22,220
1.
We still have to look into this, so I can't tell you if and when it will be implemented.

2.
I think (I'm not sure, I haven't tried this), that TClientDataSet.IndexDefs represent the keys.

------------------
Marco Kalter
Allround Automations


Marco Kalter
Allround Automations
Re: key violation when posting record
#2579 09/27/02 03:52 AM
Joined: Sep 2002
Posts: 2
NORWAY
B
Member
Offline
Member
B
Joined: Sep 2002
Posts: 2
NORWAY
I'm having the same problem. Any progress on this ?

Re: key violation when posting record
#2580 09/27/02 05:01 AM
Joined: Sep 2002
Posts: 2
NORWAY
B
Member
Offline
Member
B
Joined: Sep 2002
Posts: 2
NORWAY
I have created a solution of my own. It's really simple, just checking for OracleDictionary.EnforceConstraints and OracleDictionary.DisabledConstraints.IndexOf(constraint_name) < 0

in method "TOracleTableInfo.GetConstraints".

No Item will then be created.

Re: key violation when posting record
#2581 01/03/03 07:59 PM
Joined: Jan 2002
Posts: 30
N
Member
Offline
Member
N
Joined: Jan 2002
Posts: 30
I am having the same problem. Where is this method that is referred to? (GetConstraints)

Re: key violation when posting record
#2582 01/03/03 10:05 PM
Joined: Aug 1999
Posts: 22,220
Member
Offline
Member
Joined: Aug 1999
Posts: 22,220
It's in OracleData.pas, if you have the Direct Oracle Access source files.

------------------
Marco Kalter
Allround Automations


Marco Kalter
Allround Automations

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.029s Queries: 13 (0.007s) Memory: 2.5280 MB (Peak: 3.0394 MB) Data Comp: Off Server Time: 2024-05-16 20:47:38 UTC
Valid HTML 5 and Valid CSS