Discussions
Categories
- 197K All Categories
- 2.5K Data
- 546 Big Data Appliance
- 1.9K Data Science
- 450.8K Databases
- 221.9K General Database Discussions
- 3.8K Java and JavaScript in the Database
- 31 Multilingual Engine
- 552 MySQL Community Space
- 479 NoSQL Database
- 7.9K Oracle Database Express Edition (XE)
- 3.1K ORDS, SODA & JSON in the Database
- 556 SQLcl
- 4K SQL Developer Data Modeler
- 187.2K SQL & PL/SQL
- 21.4K SQL Developer
- 296.4K Development
- 17 Developer Projects
- 139 Programming Languages
- 293.1K Development Tools
- 111 DevOps
- 3.1K QA/Testing
- 646.1K Java
- 28 Java Learning Subscription
- 37K Database Connectivity
- 161 Java Community Process
- 105 Java 25
- 22.1K Java APIs
- 138.2K Java Development Tools
- 165.3K Java EE (Java Enterprise Edition)
- 19 Java Essentials
- 162 Java 8 Questions
- 86K Java Programming
- 81 Java Puzzle Ball
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 94.3K Java SE
- 13.8K Java Security
- 205 Java User Groups
- 24 JavaScript - Nashorn
- Programs
- 475 LiveLabs
- 39 Workshops
- 10.2K Software
- 6.7K Berkeley DB Family
- 3.5K JHeadstart
- 5.7K Other Languages
- 2.3K Chinese
- 175 Deutsche Oracle Community
- 1.1K Español
- 1.9K Japanese
- 233 Portuguese
TRIGGER Instead of

Alexandra Robin
Member Posts: 1,676 Blue Ribbon
How do I use the wizard in Apex to create an "instead of " trigger? Or where can I write one manually? The wizard adds it's own 'create" statement and more so that it gets all messed up!
Thank you.
Thank you.
Tagged:
Answers
-
just go to the object browser and change it manually. notice that you can create it only on views.
-
Thanks.
For all my questions to the forum, I figured out this ANSWER after loads of laboring and it worked...ah yes, there really is SATISFACTION! Here you go:
Go to the SQL Workshop > SQL Commands button. After you write the code, run it so it will get saved in the object browser.
1. write an INSTEAD OF trigger that will update the tables in your view INSTEAD OF the view itself. It should look someting like this:
create or replace trigger SH_VEND_ITEM_VW_UPD
instead of UPDATE ON ITEM_VW
for each row
begin
UPDATE ACCESS_ITEM
SET ITEM_NOTES = :new.ITEM_NOTES
WHERE ITEMNO = :old.ITEMNO;
UPDATE ACCESS_VENDOR
SET VEND_NOTES = :new.VEND_NOTES
WHERE VENDNO = :old.VENDNO;
UPDATE VEND_ITEM_PRIORITY
SET VEND_ITEM_NOTES = :new.VEND_ITEM_NOTES
WHERE VI_PRIORITY_ID = :old.VI_PRIORITY_ID;
end;
2. go to your application and create a PL/SQL page process, AFTER SUBMIT that looks like it's going to update the view itself
UPDATE VEND_ITEM_VW
SET ITEM_NOTES = :P3_ITEM_NOTES,
VEND_NOTES = :P3_VEND_NOTES,
VEND_ITEM_NOTES = :P3_VEND_ITEM_NOTES
WHERE VI_PRIORITY_ID = :P3_VI_PRIORITY_ID;
This discussion has been closed.