Advertisement

01.19.2006 at 09:11AM PST, ID: 21702725
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.6

How can I use When-Button-Pressed Trigger PL/SQL to insert and update to the table?

Asked by nguyenkt007 in Oracle IAS Application Server

Tags: , , , ,

I have created Canvas with fields/text items so that user can fill the request and submit it. While it submit activity, I want the When-Button-Pressed to insert new record and if the record exist then just update record to table. I did created CREATE TRIGGER on that button. When I compiled it and got an error return. Can anyone take a look at it and tell me what did I do wrong? Thank you! Have a great day.  Here's my syntax:

CREATE OR REPLACE TRIGGER Add_RequesOrder
AFTER UPDATE ON tbl_Reqest_Order
REFERENCING NEW AS n
FOR EACH ROW

DECLARE
      
      rowCount NUMBER;

BEGIN            
            SELECT COUNT(*) INTO rowCount FROM tbl_Reqest_Order WHERE Request_ID = :n.Request_ID;

            IF rowCount = 0 THEN                        
                INSERT INTO tbl_Reqest_Order(Request_ID, Submit_By, Request_Date, Site_Location, Req_Priority, Issue_Descript, Resolved_By, Resolved_Descript);
                                    VALUES (:n.Request_ID, :n.Submit_By, :n.Request_Date, :n.Site_Location, :n.Req_Priority, :n.Issue_Descript, :n.Resolved_By, :n.Resolved_Descript);            
            ELSE                  
            UPDATE tbl_Reqest_Order SET tbl_Reqest_Order.Submit_By = :n.Submit_By
                              WHERE tbl_Reqest_Order.Request_ID = :n.Request_ID;            
            END IF;
END;Start Free Trial
 
Loading Advertisement...
 
[+][-]01.20.2006 at 03:00AM PST, ID: 15747813

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Oracle IAS Application Server
Tags: insert, count, pressed, button, trigger
Sign Up Now!
Solution Provided By: gacki
Participating Experts: 1
Solution Grade: B
 
 
 
Loading Advertisement...
20080716-EE-VQP-32