Home » Developer & Programmer » Forms » Primary keys, sequenes and blocks (Forms 6i, Oracle 10g)
Primary keys, sequenes and blocks [message #392281] Tue, 17 March 2009 05:25 Go to next message
didiera
Messages: 134
Registered: August 2007
Location: Mauritius
Senior Member
Hello everyone,

This is a question about the primary key management and forms 6i. I have a table represented by an 'enforce primary key' block for which there exist a field that serves as primary key based on a sequence. On my block, whenever I create a new record, I come up with an issue if after commiting my block I try to alter that new record. Obviously without a requery, I cannot manipulate it unless I set the 'enforce primary key' to Yes and designate the required field in the block as primary key. So far so good, I get to change it's values. However it does not seem like the changes are applied subsequently to any other commit I do and when I close my form, I'm always asked if I would like to save my changes.

My question: Is there some setting to be made so I can manipulate freshly inserted records, do a commit and have all the changes commited to the record?

regards,
Didier
Re: Primary keys, sequenes and blocks [message #392282 is a reply to message #392281] Tue, 17 March 2009 05:30 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
Random guess - is the primary key being set from the sequence in a database trigger?
Re: Primary keys, sequenes and blocks [message #392293 is a reply to message #392282] Tue, 17 March 2009 05:54 Go to previous messageGo to next message
didiera
Messages: 134
Registered: August 2007
Location: Mauritius
Senior Member
Hi,

yes indeed in a before_insert trigger. So it looks to me like I've got no other choice than requerying the records? It's not a problem as such and I was just asking in case I could avoid it.
Thansk a lot for that lightning-fast reply Razz

...are we in the same time-zone or what ?


regards,
Didier
Re: Primary keys, sequenes and blocks [message #392297 is a reply to message #392281] Tue, 17 March 2009 06:00 Go to previous message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
Set the DML Returning block property to yes.

This has got nothing to do with enforce primary key.
It's got everything to do with the fact that you've got a DB trigger changing values in the row.
Previous Topic: database not updating
Next Topic: Query
Goto Forum:
  


Current Time: Fri Sep 20 14:29:58 CDT 2024