How to use a button to fire PLSQL anonymous block or stored procedure
DougApr 1 2011 — edited Apr 8 2011I am converting from a Forms application to APEX, and things that used to be easy have become almost impossibly difficult. I have a page that represents a record with one item called "history_rec." This is a checkbox item. Clicking it causes the column for this record to be populated with the letter "H," indicating that this record is now historical and not active. I also have on this page a button labeled "Renew Record." This button redirects to the current page and sets the value of 5 page items to the values in the record being replaced by the new record.
(All this, by the way, is for an insurance tracking system on loan collateral. The insurance has to be renewed annually, and this system is used to make certain that it is.)
I also want the button to fire a process which updates the old record by populating the history_rec column. To do this I created a process called "make_history" which contains the following SQL code:
"Update insure
set history_rec = 'H'
where insureseq = :P22_INSURESEQ"
For the "Process Point," I have selected "On Demand: Run this process when requested by AJAX."
Is this possible from my "Renew Record" button, and if so, how? If not, how should I proceed?