This content has been marked as final. Show 10 replies
Hello,1 person found this helpful
Do it in the When-Validate-Item trigger
If length(:block.item) = 4 then :block.item := :block.item || '-' || ltrim(to_char(:block.item + 1)); End if;
If you want to use the inserted value later on, e.g. for calculations, i would suggest to not save the additional 5 characters to the database, but to simple concatenate that value for display-purposes in forms.
What is the role of ltrim ?
how to insert only the first 4 characters in my database ?
Edited by: 979155 on 7 janv. 2013 08:55
how to insert only the first 4 characters in my database ?By not concatenating the following year into that item, but button the next year into a separate item.
i used data block manual(it is not connected to dB) so i think that i can insert only the first 4caracters using substr
i used data block manual(it is not connected to dB) so i think that i can insert only the first 4caracters using substrYes you can. The only question is why you do not use a database-block?
it's easier for me..
What is the difference between when-validate-item and post-text-item ?
Can you explain what the role of ltrim?
1 person found this helpful
it's easier for me..But only at first glance. Why would you want to use forms if not for its power to do all the database work on its own? Wrting everything on your own is like driving a car without using the engine ;)
What is the difference between when-validate-item and post-text-item ?WHEN-VALIDATE-ITEM is a validation-trigger. Its fired whenever an items value has changed, regeardless if you leave the item or try to save. When you do a RAISE FORM_TRIGGER_FAILURE in it, the causing action will not succeed (neither a navigation nor a COMMIT).
POST-TEXTITEM is a navigation trigger which fires when you leave a textitem, regardless if the value changed or not. But it will not fire when you try to save from a non-navigatable button or using a key.
Can you explain what the role of ltrim?http://lmgtfy.com/?q=oracle+ltrim
Edited by: Andreas Weiden on 07.01.2013 19:24
thank you very much for your help ;)
One last question:
in my case is that it is preferable to use when-v-alidate item-item or post-text ?
thank you for your help ;)
the problem 's solved ;)