Reputation: 51
I am developping a web application in Oracle Application Express (Apex) technology.
I have a page where I can add a new record to a table called 'tz_tab'. That table has a column 'pos' which is one letter (single char) - 'Y' or 'N'. Now, i'd like to do something like this:
I tried creating triggers on 'tz_table' but with no success.
Summing up, I need to have only one record with 'pos' value == 'T' in 'tz_tab'.
Is there any method to do this by APEX or should it be done with oracle triggers?
Thanks!
Upvotes: 1
Views: 5604
Reputation: 15094
You don't say how you're doing your processing in Apex, but you can create a page process that fires after your insert/update step with something like.
UPDATE tz_table SET pos = 'N' WHERE id != :ID_OF_THE_ITEM_JUST_UPDATED
Upvotes: 1
Reputation: 1934
It sounds like you can achieve this by creating a PL/SQL process in your APEX page that will fire after submit. You should be able to check page items and perform an UPDATE statement as required.
Upvotes: 1