Create new Tabular Form
- Create page > Page type: Form > Tabular Form
- Select the following options:
- Note: For simplicity/demo purposes, limiting to just the SAL and ENAME columns.
- Primary Key: Select Primary Key Column(s) > Primary Key Column 1 > EMPNO
- Run through the rest of the wizard.
Remove Automatic DML
Since custom code will be used to process the page, delete the automatic row processing process as shown below.
Create Process
Create a new process with the following settings (the Source is included below the image).
if :empno is null then -- code to insert emp null; else update emp set ename = :ename, sal = :sal where empno = :empno; end if;
Using the above technique you can now use a tabular form to call custom PL/SQL code rather than the automatic row processing.
The next article will cover how to modify data from multiple tables in the same Tabular Form.
Martin, you deleted the ApplyMRD process without implementing a replacement Delete capability. Your code shows how to distinguish between insert and update, but how would you identify a delete request?
ReplyDeleteGood point. I'll write up a new post regarding the deletes soon.
ReplyDeleteHave you ever done a write up regarding deletes?
DeleteThis article really helped make the whole custom processing for a tabular form so much easier. Thanks.
I haven't written one yet. Hopefully soon.
DeleteThank you so much for this. After trying many other options that failed to work, I finally found your blog post which solved my issue instantly. Great post!
ReplyDeleteThanks for your excellent post. It has been a great help.
ReplyDeletegsc
If you delete the MRU, and the form uses rowid as PK, deletes no longer work....set the MRU condition to never, and then the PK definition from it is still used.
ReplyDelete