|
|
|
Re: Commit the data on change record [message #498226 is a reply to message #498225] |
Wed, 09 March 2011 05:10 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
Records belong to blocks, so block level. If I was you though I'd use post rather than commit. That applies the data to the db without making it permanent. Then the users still have the option of whether or not to save their changes.
|
|
|
|
|
|
|
Re: Commit the data on change record [message #498232 is a reply to message #498231] |
Wed, 09 March 2011 05:17 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
Did you have the trigger at the right level - block?
Did you get any error messages when you changed record?
Did you try querying the DB directly after changing record to see if the data had really been committed?
|
|
|
|
|
|
|
|
Re: Commit the data on change record [message #498244 is a reply to message #498241] |
Wed, 09 March 2011 05:44 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](/forum/images/custom_avatars/72104.gif) |
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
OK, I created a table and a form based on that table. It contains a single item.
WHEN-NEW-RECORD-INSTANCE trigger:SELECT 'BKID-'||LPAD(nvl(SUBSTR(MAX(BL_BANK_ID), 6,5), 0)+1,5,'0')
INTO :bl_bank_id
FROM sbm_bank_list;
COMMIT;
Form output (new records are created by simple DOWN key presses):
![/forum/fa/8772/0/](/forum/fa/8772/0/)
So, it obviously works OK. No idea what you might be doing wrong.
-
Attachment: new_bkid.png
(Size: 7.61KB, Downloaded 1287 times)
|
|
|
|
|
|
|
|
Re: Commit the data on change record [message #498256 is a reply to message #498254] |
Wed, 09 March 2011 06:10 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](/forum/images/custom_avatars/72104.gif) |
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Beep and a message can be suppressed by a little "trick": setting :SYSTEM.MESSAGE_LEVEL to a higher value. Here's an example:declare
l_current_msg_level number;
begin
l_current_msg_level := :system.message_level;
:system.message_level := 25;
COMMIT;
:system.message_level := l_current_msg_level;
SELECT 'BKID-'||LPAD(nvl(SUBSTR(MAX(BL_BANK_ID), 6,5), 0)+1,5,'0')
INTO :bl_bank_id
FROM sbm_bank_list;
end;
[EDITED by LF: fixed code formatting]
[Updated on: Wed, 09 March 2011 06:48] Report message to a moderator
|
|
|
|
Re: Commit the data on change record [message #498283 is a reply to message #498237] |
Wed, 09 March 2011 08:17 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
joy_division
Messages: 4963 Registered: February 2005 Location: East Coast USA
|
Senior Member |
|
|
ArkeologeN wrote on Wed, 09 March 2011 06:25SELECT 'BKID-'||LPAD(SUBSTR(MAX(BL_BANK_ID), 6,5)+1,5,'0') INTO :BL_BANK_ID FROM SBM_BANK_LIST;
I'm already using this query as WHEN-NEW-RECORD-INSTANCE on block level..I inserted commit with it.. but no result as I want..
I hate to rain on your parade after you think it is working, but this is an invalid way to get the maximum bank id in a multi-user environment. No doubt more than one person will get the same number at some point. You really should be using sequences.
|
|
|
|
|
|