Trigger is resulting in ORA-04098 (Trigger invalid)

I'm trying to create a trigger which automatically updates the rpimary key each time a record is inserted in the table CONTACTS_MAN. This table is basically an address book.
SQL> describe contacts_man
Name Null? Type
CONTACT_ID NOT NULL NUMBER
DATEREF DATE
TITLE VARCHAR2(200)
FNAME VARCHAR2(50)
MNAME VARCHAR2(50)
SNAME VARCHAR2(50)
SUFFIX VARCHAR2(5)
COMPANY VARCHAR2(150)
DEPARTMENT VARCHAR2(200)
JOB_TITLE VARCHAR2(150)
BUSINESS_ST1 VARCHAR2(200)
BUSINESS_ST2 VARCHAR2(200)
BUSINESS_ST3 VARCHAR2(200)
BUSINESS_CITY VARCHAR2(200)
BUSINESS_POSTCODE VARCHAR2(20)
BUSINESS_COUNTY VARCHAR2(100)
BUSINESS_COUNTRY VARCHAR2(100)
BUSINESS_REGION VARCHAR2(150)
HOME_ST1 VARCHAR2(150)
HOME_ST2 VARCHAR2(200)
HOME_POSTCODE VARCHAR2(150)
HOME_CITY VARCHAR2(100)
HOME_REGION VARCHAR2(50)
BUSINESS_FAX VARCHAR2(50)
BUSINESS_PHONE VARCHAR2(50)
CAR_PHONE VARCHAR2(20)
COMPANY_MAIN_PHONE VARCHAR2(50)
HOME_PHONE VARCHAR2(50)
MOBILE1 VARCHAR2(50)
MOBILE2 VARCHAR2(50)
ANNIVERSARY DATE
DATE_OF_BIRTH DATE
CHILDREN NUMBER
GENDER VARCHAR2(10)
EMAIL1 VARCHAR2(50)
EMAIL2 VARCHAR2(50)
EMAIL3 VARCHAR2(50)
GOVERNMENT_ID VARCHAR2(500)
HOBBY VARCHAR2(500)
KEYWORDS VARCHAR2(500)
LANGUAGES VARCHAR2(500)
NOTES VARCHAR2(2500)
REFERRED_BY VARCHAR2(150)
SPOUSE VARCHAR2(100)
WEBPAGE VARCHAR2(150)
BUSINESS_PHONE2 VARCHAR2(100)
CATEGORY NUMBER
1) First I create the following sequence:
CREATE SEQUENCE mancontacts_seq
START WITH 10
INCREMENT BY 1;
2) Then create the following trigger:
CREATE OR REPLACE TRIGGER contactman_autokey
BEFORE INSERT ON CONTACTS_MAN
FOR EACH ROW
BEGIN
:NEW.contact_id := mancontacts_seq.NEXTVAL;
END;
WHEN TRYING TO INSERT I GET THE FOLLOWING ERROR:
SQL> INSERT INTO CONTACTS_MAN (FNAME, SNAME)
2 VALUES ('MyFirstName', 'MySurname');
INSERT INTO CONTACTS_MAN (FNAME, SNAME)
ERROR at line 1:
ORA-04098: trigger 'SYS.CONTACTMAN_AUTOKEY' is invalid and failed re-validation
Any suggestions are greatly appreciated.
Thank you!!
Edited by: user9367338 on May 2, 2011 10:10 AM
Edited by: user9367338 on May 2, 2011 10:12 AM

Thanks for a prompt response. I am on 11g. I dropped the SYS trigger. Connected to the same user but not as DBA.
Re-created sequence and triggers ensuring USER_SCHEMA.trigger and USER_SCHEMA.sequence.
Managed to insert records with no errors now. Didn't quite catch the last comment about 11g since I'm able to create sequences outside the SYS schema (ie: as a normal user). Is this is ok or am I still missing something? Thanks

Similar Messages

  • ORA-04098 trigger"BANKTRAN_BEF_DEL" is invalid and and failed re-validation

    Hey Experts,
    I created follwoing trigger successfully...
    create or replace trigger BANKTRAN_BEF_DEL
    before delete on BANKTRAN
    declare
    weekend_error EXCEPTION;
    not_authentocated_user EXCEPTION;
    begin
    if TO_CHAR(SysDate,'DY') = 'SAT' or TO_CHAR(SysDate,'DY') = 'SUN' THEN
    RAISE weekend_error;
    end if;
    if SUBSTR(User,1,3) <> 'ATN' THEN
    RAISE not_authentocated_user ;
    end if;
    EXCEPTION
    WHEN weekend_error THEN
    RAISE_APPLICATION_ERROR (-20001,
    'Deletions not allowed on weekends');
    WHEN not_authentocated_user THEN
    RAISE_APPLICATION_ERROR (-20002,
    'Deletions only allowed by authentocated users');
    end;
    but when deleting the records using query delete from BANKTRAN
    getting the below error
    ORA-04098 trigger"BANKTRAN_BEF_DEL" is invalid and and failed re-validation
    Edited by: SShubhangi on Jan 7, 2013 4:21 PM

    Alright.
    Now Try the DML that causes the Trigger to fire.
    And post the details.
    PS:- Please use {noformat}{noformat} before and after the SQL statements/results or code samples.
    It makes post more readable and you get better help.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Error ORA-04098: trigger 'GSD_WARTUNG.BI_WARTUNGS_AUFTRAEGE' is invalid...

    hello,
    whats this?? i just can't insert any data into my table anymore! the trigger is just marked as "invalid", what can i do to make it work again?
    thank you.
    josh

    ah damn the sequence didnt exist anymore! no idea how it was deleted, i never have done anything with sequences before... :-/

  • Error ORA-04098

    Please could somebody tell me what to do. I use both Procedure builder and Sql plus (Oracle 8i and Forms 6i). I ran a script catproc.sql (That is bundled in the admin subdirectory) last night. When I try drop a stored procedure or function - I get the error ORA-04098: trigger 'SYS.JIS$ROLE_TRIGGER$' is invalid and failed re-validation. When I try to describe the trigger SYS.JIS$ROLE_TRIGGER$ both logged on as an ordinary database user and as the dba,oracle claims that the trigger does not exist.
    Please what do I do.
    This problem did not occur until I ran the script catproc.sql.

    Did you try compiling the trigger as SYS? What user did you run the catproc.sql script as? It should have bee run as the SYS user.

  • Oracle Errorr ORA-04098

    I have a customer who is getting ORA-04098 "Trigger is invalid and failed revalidation". The trigger and the procedures it calls compile without errors. The trigger is enabled. I have tried recompiling all the procedures and then the triggers again but this hasn't helped. It is Oracle 8.0.3 on Windows NT. Can anyone suggest a course of action to get this running?
    Thanks,
    Karl
    [email protected]

    Karl,
    This is the Oracle documentation on the error
    Please check back and look for the proper authorizations for the trigger.
    ORA-04098 trigger 'string' is invalid and failed re-validation
    Cause: A trigger was attempted to be retrieved for execution and was found to be invalid. This also means that compilation/authorization failed for the trigger.
    Action: Options are to resolve the compilation/authorization errors, disable the trigger, or drop the trigger.
    Hope this helps.
    Shyam
    null

  • Errore ORA-04098 creating Trigger.

    hi,
    I have some problem creating a simple trigger for auto increment of an "Id_column".
    I create a sequence: create sequence "sequence_name" minvalue 1 maxvalue 999 increment by 1
    then create trigger: create trigger "trigger_registry"
    before insert on "registry"
    for each row
    when (new.ID_registryA is null)
    begin
    select "Sequence_name".nextval into: new.ID_registry
    FROM DUAL;
    END;
    and finally I try to insert something into registry table but I got this error: ORA-04098: il trigger 'SYSTEM.TRIGGER_NAME' is invalid and failed re-validation.
    Has anybody got any idea about this error?

    user3745218 wrote:
    ok, so i've corrected all but the error is still the same: ORA-04098: il trigger 'SYSTEM.TRIGGER_NAME' is invalid and failed re-validation.
    Unless you post SQL*PLus snippet like this, we can't help you:
    SQL> create or replace
      2  trigger emp1_bir
      3  before insert
      4  on emp1
      5  for each row
      6  when (new.sal < 0)
      7  begin
      8  select sss.nextval into :new.empno from dual;
      9  end;
    10  /
    Warning: Trigger created with compilation errors.
    SQL> show error trigger emp1_bir
    Errors for TRIGGER EMP1_BIR:
    LINE/COL ERROR
    2/1      PL/SQL: SQL Statement ignored
    2/8      PL/SQL: ORA-02289: sequence does not exist
    SQL> SY.

  • FRM-40735: WHEN-VALIDATE-ITEM trigger raised unhandled exception ORA-06508

    Hi all,
    In Production instance we have an issue on AP invoice workbench, gives an error (FRM-40735 Post-Query Trigger On Quering Invoice ) when we retrieve the existing invoice data entered.
    For this we compiled the invalid objects and applied the patch according to the metalink id [ID 1209736.1]
    After that we came up with new error FRM-40735: WHEN-VALIDATE-ITEM trigger raised unhandled exception ORA-06508.
    Can any one help us
    Thanks
    SAI

    Hi Thanks for the reply we have implemented the following things
    1) Please download and review the readme for Patch 8671468:R12.AP.B
    2) Please apply Patch 8671468:R12.AP.B in a test environment.
    3) Check the file versions , they have to be the same as given below.
    Patch/115/sql/aphanwfb.pls 120.64.12010000.11
    4) Please retest the issue.
    5) If the issue is resolved, please migrate the solution as appropriate to other environments.
    APXINWKB : When Entering Invoice Details, Get Error: FRM-40735: WHEN-VALIDATE-ITEM trigger raised unhandled exception ORA-06508 [ID 1284114.1]
    This is done no luck.
    Thanks
    Sai

  • FRM-40735: WHEN-VALIDATE-ITEM trigger raised unhandled exception ORA-04063.

    Hi All,
    After Cloning the 11i instace to 12.1.3 and when trying to create an absence
    am gettin the follwing Error
    ORA-01403: no data found
    FRM-40735: WHEN-VALIDATE-ITEM trigger raised unhandled exception ORA-04063.
    Please note I didnt get any of these kind of errors when cloned for CRP1 or CRP2.
    Thanks

    Hi,
    Its because of the invalid objects. We have compiled the invalid objects again and the issue got fixed.
    Thanks

  • FRM-40735: WHEN-LIST-ACTIVATED trigger raised unhandled exception ORA-29516

    Hi All,
    The users are facing problem on opening the OAF pages on 11i(11.5.10.2) instance.
    They face this error when they,
    1. Go to System Administrator responsibility.
    2. Open page under Workflow > Administrator Workflow > Status Monitor.
    3. This error pops up at the end of the form page. Below is what the error appearing.
    FRM-40735: WHEN-LIST-ACTIVATED trigger raised unhandled exception ORA-29516
    We are having DB:11.2.0.2.5,Applications:11.5.10.2
    Please suggest in resolving the error.
    Thanks
    Althaf khan

    The users are facing problem on opening the OAF pages on 11i(11.5.10.2) instance.
    They face this error when they,
    1. Go to System Administrator responsibility.
    2. Open page under Workflow > Administrator Workflow > Status Monitor.
    3. This error pops up at the end of the form page. Below is what the error appearing.
    FRM-40735: WHEN-LIST-ACTIVATED trigger raised unhandled exception ORA-29516
    We are having DB:11.2.0.2.5,Applications:11.5.10.2
    Please suggest in resolving the error.Was this working before? If yes, any changes been done recently?
    Can you find any errors in the database log file?
    Do you have any invalid objects?
    What is the complete error message? Any errors in Apache log files (error_log* and access_log*)?
    Thanks,
    Hussein

  • FRM-40735: WHEN-BUTTON-PRESSED trigger raised unhandled exception ORA-04063

    Hi experts,
    This problem as titled happened to me recently, and i found no way out.
    I collected the FRD information, what i can get is:
    GMDRCDSG, 11, Prog Unit, Entry, 361120504, /XGMDSRCHGMD_BASIC_SEARCH_PKG/INIT_GROUP
    Unhandled Exception ORA-04063
    State Delta:
    Error Message: FRM-40735: WHEN-BUTTON-PRESSED trigger raised unhandled exception ORA-04063.
    ON-ERROR Trigger Fired:
    Form: GMDRCDSGORA-04063 means some database object is broken, but this information does not specify exactly which
    object it is . I thought it is caused by GMD_BASIC_SEARCH_PKG, which is programmed in GMDSRCH.pll.
    So i recompiled the pld file, but didn't work.
    The further action i took is to find out all the invalid package/package body in database, and recompile them.
    Unfortunately, this also didn't work.
    Any help is greatly appreciated, thanks in advance:)
    Ted

    Could anybody help? Please.
    Thanks,
    Ted

  • FRM-40735:PRE-FORM trigger raise unhandled exception ORA-04067

    FRM-40735:PRE-FORM trigger raise unhandled exception ORA-04067:not executed, stored, procedure "PUBLIC.FND_TIMEZONES" does not exist.
    After I log into Applications, and when I click on responsibility, and when I'm in the Form to retreive the Navigator page, I got the above error.
    If I click on any one of the menu from the list, I automatically gets log off. "your logon session has become invalid".
    please help..

    Hi,
    Yes this was working befor enable rapid clone feature.How did you enable this feature? Did you apply any patches?
    Following Task has been made by me:
    Enable Rapid Clone Featue -------> execute pre clone -------> change IP and Hostname --------> execute post clone-----------> change has been made sucessfully.
    APPS.FND_TIMEZONE package is not avaliable .What does this query return?
    SQL> select object_name, object_type, owner
    from dba_objects
    where object_name = 'FND_TIMEZONES';Regards,
    Hussein

  • FRM-40735: ON-POPULATE-DETAILS trigger raised unhandled exception ORA-06508

    Dear All,
    I checked this forum before i post this thread. But i didn't get any solutions.
    Recently we have migrated our production database from 10gR2 to 11g EE R11.2.0.1.0 - 64bit.
    We are continuing 10gR2 version as our oracle application server after migration.
    Now we are facing a problem - When we open a screen and query the records we are getting an error as
    FRM-40735: On-Populate-Details trigger raised unhandled exception ORA-06508.
    Then the details are not populating.
    We are getting this error indefinitely. In the same screen if we close it and open then its not throwing an error.
    After some times it shows the same error. may be in any form. Due to this we can't even debug the code part.
    Command used to compile all plls
    for %%i IN (*.pll) do frmcmp module=%%i userid=userid/pw@connectstg batch=yes module_type=LIBRARY compile_all=yes window_state=Minimize
    Same way we compiled the forms mmbs. OLBS no change.
    We tried manually compilation of plls too.
    We didn't made any change in the On-Populate-Details. Frequently irregular indefinite
    Thanks in Advance,
    Regards
    Balaji M

    The "ORA-06508: PL/SQL: could not find program unit being called" error is caused when Forms can't find the program unit being called or the status of the program unit is "Invalid." Have you checked the particular program unit being called to ensure it's status is "Valid?"
    Also, the On-Populate-Details triggers is system generated. You might need to drop and recreate the related Releationship in order to fix the issue.
    Hope this helps,
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

  • When-button-pressed---trigger raised unhandled exception ORA-06502

    Dear all,
    I am trying to implement a hierarchical tree using the following codes on
    when-button-pressed
    DECLARE
    htree item;
    my_sql VARCHAR2 (200) := 'select 1, level, hee_name,null, to_char(hee_no)
    from hrm_employee
    connect by prior hee_id=hee_dirsup_id
                   start with hee_dirsup_id is null
                             order siblings by hee_name';
    BEGIN
    htree := FIND_ITEM ('trees.tree10');
    ftree.SET_TREE_PROPERTY (htree, ftree.query_text, my_sql);
    ftree.POPULATE_TREE ('htree');
    END;
    i am unable to see my hierarchical tree and i am having the above error message.
    Can anybody please help me sort this out? Is there any chunks of codes missing resulting to this error.
    I'll be very grateful for any help :)
    sheetal.

    Hi sheetal
    trigger raised unhandled exception ORA-06502
    Cause* :This error occurs when you try to assign a value to a variable, but the value is larger than the variable can handle.
    or if you are trying to assign a non-numeric value to a numeric variable.
    --=========================
    Action*: pls change the my_sql VARCHAR2 *(200)* to my_sql VARCHAR2 *(2000)*
    i am unable to see my hierarchical tree
    Pls have a look here at Andreas Weiden sample code....
    Hope this helps...
    Regards,
    Amatu Allah.

  • FRM-40735:PRE-FORM trigger raised unhandled expception ORA-06508-SATYAM

    Hi,
    This is Sateesh, presently working on Designer migration project from Designer 2000 V1.3.2 to Designer 10g with headstart.I successfully completed the migration of repository from 1.3.2 to 6i and also migrated the headstart to 6i using simple upgrade method.After this i successfully migrated the repository from 6i to 10g and I compiled all the libraries using forms10g and then i generated all the 10g forms through designer.then 10g forms and libraries are deployed in Oracle Application Server and then we are trying to access the application then we are getting the messsage for most of the forms, i.e FRM-40735:PRE-FORM trigger raised unhandled expception ORA-06508. Can you please help me out in this regard.
    Regards
    K.Sateesh Kumar

    Yes,
    that's right. FRM-40735 is a generic error message generated in case of form failure.
    This may be as a result of failure while calling sub-programs in a form or any other problem.
    For my case I had a call to a built in Package for which the user didnt have the privileges to execute that package.
    So how did I find out?
    EXCEPTION
    WHEN OTHERS THEN
    MESSAGE('SQLERRM: ' || SQLERRM);
    exception handling does the trick. I got the real error that was causing the problem.
    Error was: SQLERRM: xxx package does not exist. This made me think in the lines of either privileges or synonym problem. I found out that the user in the db doent have the execution privileges.
    GRANT ALL ON xxxpackage TO xxxuser;
    This is a nice forum. I love it and thanks to everyone.

  • FRM-40735 POST- UPDATE trigger raised unhandled exception ORA- 01403

    FRM-40735 POST- UPDATE trigger raised unhandled exception ORA- 01403
    I am getting the above error when i am trying to change the Assignment Category field of
    an employee from Junior Staff to Senior Staff.
    Navigation People> Enter & Maintain> (B)Assignment.
    Kindly assist me to resolve this error.
    Plz note there is a promotion that is suppose to be given to some employees in our company as of
    01-APR-2010 so i had to open the closed payroll periods and do the changes. I managed to change for all
    the 9 employees but 1 employee's assignment is giving me an error as follows :
    FRM-40735 POST- UPDATE trigger raised unhandled exception ORA- 01403
    The error displays after i try to save the changes made to the Assignment Category from Junior Staff to Senior Staff.
    NB: i have also tried to switch off the custom code...but its giving me same error.
    Also the element links have been defined for employment category on the links window.
    please help!!
    Edited by: 594647 on Jul 20, 2010 10:26 PM

    Release 12.1.1.
    OS is Red Hat Ent Ed 4
    i am trying to change the employee assignment category from Junior to Senior. so when i am updating the assignment details on the assignment screen (Navigation is People >Enter & Maintain> Assignment) and trying to save, the system gives error on the status bar of the application as follows:
    FRM-40735 POST- UPDATE trigger raised unhandled exception ORA- 01403
    NB: Error is appearing on the Assignment screen.
    Please help!!
    Edited by: 594647 on Jul 21, 2010 2:48 PM

Maybe you are looking for

  • Has anyone solved error 403?

    I'm using a Mid 2012 MacBook Air and have recently upgraded to 10.10.  I have been using iCloud for a few years now and after upgrading to 10.10 I have been receiving an error message in my Calendar, specifically; II can't solve this problem because

  • Acrobat Pro CC - Question involving user end embedding of files?

    My name is James, I'm a web designer, I've put together a .pdf for my clients I send out when I start the development process.  I would like to in some way embed an option for the client to send back a digital copy of their logo within the document. 

  • V.Important: How to use se24 to build a class step by step:  Points assured

    hi all I am new to OO based abap programming.  I want to build a class using SE24 but i dont know where to put the various pieces of code in SE24. Can anyone please provide a step by step procedure (including screenshots) on how to use SE24 to build

  • Tima capsule stop to work

    i've changed the name of my network and my time capsule stopped to work properly. actually time machine says "i cannot activate the image of back up disk" i've tryed to initialize the disk with the disck utility and now from the disck utility TM is a

  • JSP to PHP

    I have a content management system that is currently all JSP. At login time, session variables are set (username, password, authority level). Can and HOW do access JSP-set session varibles with PHP? Thanks