Advertisement

05.09.2008 at 02:03PM PDT, ID: 23390830
[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!

Trigger with Sequences number

Tags: oracle, ORACLE, 10g, C#
Hi,
i converted SQL DBto Oracle by using SQL developer and Oralce created following sequences and trigger automatically see below. but when i trying to insert data into the table or use magrate data tool in sql developer, it gose to infinite loop and get error message as
ORA-06512: at "SYSMAN.HOOKUPPARTS_ID_TRG", line 15
ORA-04088: error during execution of trigger 'SYSMAN.HOOKUPPARTS_ID_TRG'
01013. 00000 -  "user requested cancel of current operation"
*Cause:    
*Action:

any help on this one will be much appreciated.

Thanks

Ying
CREATE SEQUENCE  HookupParts_Id_SEQ  
  MINVALUE 1 MAXVALUE 999999999999999999999999 INCREMENT BY 1  NOCYCLE ;

CREATE OR REPLACE TRIGGER HookupParts_Id_TRG BEFORE INSERT OR UPDATE ON HookupParts
FOR EACH ROW
DECLARE
v_newVal NUMBER(12) := 0;
v_incval NUMBER(12) := 0;
BEGIN
  IF INSERTING AND :new.Id IS NULL THEN
    SELECT  HookupParts_Id_SEQ.NEXTVAL INTO v_newVal FROM DUAL;
    -- If this is the first time this table have been inserted into (sequence == 1)
    IF v_newVal = 1 THEN
      --get the max indentity value from the table
      SELECT max(Id) INTO v_newVal FROM HookupParts;
      v_newVal := v_newVal + 1;
      --set the sequence to that value
      LOOP
           EXIT WHEN v_incval>=v_newVal;
           SELECT HookupParts_Id_SEQ.nextval INTO v_incval FROM dual;
      END LOOP;
    END IF;
    -- save this to emulate @@identity
   sqlserver_utilities.identity := v_newVal;
   -- assign the value from the sequence to emulate the identity column
   :new.Id := v_newVal;
  END IF;
END;
Start your free trial to view this solution
Question Stats
Zone: Database
Question Asked By: ying88888
Solution Provided By: angelIII
Participating Experts: 3
Solution Grade: A
Views: 4
Translate:
Loading Advertisement...
05.09.2008 at 02:10PM PDT, ID: 21536430

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.10.2008 at 06:11AM PDT, ID: 21538918

Rank: Sage

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.11.2008 at 04:13AM PDT, ID: 21542104

Rank: Wizard

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
20080236-EE-VQP-29 / EE_QW_2_20070628