Advertisement

01.22.2008 at 01:44PM PST, ID: 23102675
[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

Select count(*) if count > 1 delete else insert.

Asked by mathieu_cupryk in Oracle Database

Procedure InsertDeleteOperators_Operations

I need to do a

select (*)

if count > 1
{
do a delete
}
else
{
do an insert
}

Merge the two below to form the above.
--------------------------------------------------------------

PROCEDURE InsertOperators_Operations
(
                 pcCompanyID   IN OPERATORS_OPERATIONS.COMPANY_ID%TYPE,
               pcPlantID         IN OPERATORS_OPERATIONS.PLANT_ID%TYPE,
              pcOperationID IN OPERATORS_OPERATIONS.OPERATION_ID%TYPE,
                 pcOperatorID  IN OPERATORS_OPERATIONS.OPERATOR_ID%TYPE,
             pcCreationUser IN OPERATORS_OPERATIONS.CREATION_USER%TYPE,
             pcCreationDate IN OPERATORS_OPERATIONS.CREATION_DATE%TYPE
)

IS

BEGIN

INSERT INTO Operators_Operations
(
           COMPANY_ID,
             PLANT_ID,
             OPERATION_ID,
             OPERATOR_ID,
             CREATION_USER,
             CREATION_DATE
)
VALUES
(
         pcCompanyID,
               pcPlantID,
              pcOperationID,
         pcOperatorID,
             pcCreationUser,
             pcCreationDate

);

COMMIT;

EXCEPTION

WHEN OTHERS THEN
     ROLLBACK;
     DBMS_OUTPUT.PUT_LINE(SQLERRM);

END InsertOperators_Operations;
---------------------------------------------------------------
PROCEDURE DELETEOPERATOR_OPERATIONS
(
  pcCompanyID   IN OPERATORS_OPERATIONS.COMPANY_ID%TYPE,
  pcPlantID          IN OPERATORS_OPERATIONS.PLANT_ID%TYPE,
  pcOperationID IN OPERATORS_OPERATIONS.OPERATION_ID%TYPE,
  pcOperatorID  IN OPERATORS_OPERATIONS.OPERATOR_ID%TYPE
  )
IS
BEGIN
  DELETE OPERATORS_OPERATIONS
  WHERE COMPANY_ID = pcCompanyID  
    AND PLANT_ID = pcPlantID
    AND OPERATION_ID = pcOperationID
    AND OPERATOR_ID = pcOperatorID  
  ;
END DELETEOPERATOR_OPERATIONS;
--------------------------------------------------------------Start Free Trial
 
Loading Advertisement...
 
[+][-]01.22.2008 at 01:56PM PST, ID: 20718826

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.22.2008 at 02:33PM PST, ID: 20719170

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.22.2008 at 02:40PM PST, ID: 20719216

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.22.2008 at 06:20PM PST, ID: 20720390

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.22.2008 at 09:39PM PST, ID: 20721047

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.23.2008 at 05:19AM PST, ID: 20723023

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.23.2008 at 05:22AM PST, ID: 20723043

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 Database
Sign Up Now!
Solution Provided By: jinesh_kamdar
Participating Experts: 3
Solution Grade: A
 
 
[+][-]01.23.2008 at 05:28AM PST, ID: 20723096

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.23.2008 at 05:29AM PST, ID: 20723104

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.23.2008 at 05:30AM PST, ID: 20723112

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.23.2008 at 05:32AM PST, ID: 20723126

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628