KEY-COMMIT not firing

I am working on an Oracle 10g database and am using Oracle Forms Developer 10g to create forms. I have created a new 2 field table in my database:
CREATE TABLE career_cluster
(career_cluster_code VARCHAR2(3) NOT NULL
,CONSTRAINT career_cluster_pk
PRIMARY KEY (career_cluster_code)
USING INDEX
TABLESPACE GALINDX
,career_cluster_desc VARCHAR2(30) NOT NULL
TABLESPACE galaxy;
I have also created a form so that users can enter data into this table. I have a career_cluster data block in my form with two items: career_cluster_code (set with a maximum length of 3 in my property palette) and career_cluster_desc (set with a maximum length of 30 in my property palette). Both items are also set in the property palettes to a char data type. In my SQL code (in the form) I always have these two items set as varchar2 with (3) and (30), respectively.
The form opens fine when I run it, however when I click on my SAVE button my KEY-COMMIT trigger is not fired -- it jumps directly to my ON-ERROR trigger and I get an Oracle ORA-06502 error message. I don't see any inconsistencies in my data types or lengths. Below is my KEY-COMMIT code:
DECLARE hold_item varchar2(30) := :system.cursor_item;
hold_record varchar2(10) := :system.cursor_record;
mess_name varchar2(80);
mess_text varchar2(80);
BEGIN
go_block('career_cluster');
     if (error_code = 40202) then
          goto end_of_trigger;
     end if;
if :system.block_status = 'CHANGED' then null;
commit_form;
if FORM_SUCCESS then null;
mess_name := 'Transaction Complete';
mess_text := 'Career Cluster(s) committed to the database';
DISP_ALERT2(mess_text,mess_name);
end if;
else null;
mess_name := 'No changes to commit';
mess_text := 'No changes have been made to the Career Cluster Code Table';
DISP_ALERT2(mess_text,mess_name);
end if;
go_item(hold_item);
go_record(hold_record);
<<end_of_trigger>>
null;
END;
I put in a DISP_ALERT message right after the BEGIN statement but it never displayed so I don't think this trigger is firing. I also put a similar DISP_ALERT message in my ON-ERROR trigger and that does display, so I know it is going right to my ON-ERROR trigger. Does anyone have any ideas what might be triggering the ON-ERROR?
Thanks,
-NTW

ORA-06502 is a numeric or value error string which is raised when an arithmetic, numeric, string, conversion, or constraint error occurrs. For example, this error occurs if an attempt is made to assign the value NULL to a variable declared NOT NULL, or if an attempt is made to assign an integer larger than 99 to a variable declared NUMBER(2).
I would suggest you to look at the columns definitions in the table and the form fields/variables data types and lengths and make sure they are same as the backend table columns.
Also, you don't need to put NULL; after each IF ELSE conditions if you have any other statements.
I would also suggest that you handle any errors in either exception handler of the block or in the ON-ERROR triggers.
Try this:
DECLARE
    hold_item varchar2(30) := :system.cursor_item;
    hold_record varchar2(10) := :system.cursor_record;
    mess_name varchar2(80);
    mess_text varchar2(80);
BEGIN
    GO_BLOCK('career_cluster');
    IF :system.block_status = 'CHANGED' THEN
        commit_form;
        IF FORM_SUCCESS THEN
            mess_name := 'Transaction Complete';
            mess_text := 'Career Cluster(s) committed to the database';
            DISP_ALERT2(mess_text,mess_name);
        END IF;
    ELSE
        mess_name := 'No changes to commit';
        mess_text := 'No changes have been made to the Career Cluster Code Table';
        DISP_ALERT2(mess_text,mess_name);
    END IF;
    GO_RECORD(hold_record);
    GO_ITEM(hold_item);
EXCEPTION
  WHEN OTHERS THEN  MESSAGE(TO_CHAR(ERROR_CODE)||'-'||ERROR_TEXT);
  RAISE FORM_TRIGGER_FAILURE;
END;

Similar Messages

  • Key-nextrec not firing in forms 10g

    I have a code in the above trigger, but it is not firing, I have it in the block property and no other place in the form
    message('In key next rec----'); message(' ');
    IF :SYSTEM.Last_Record = 'TRUE' Then
    Null;
    Else
    next_record;
    End If;

    when-new-record-instance runs when you navigate to the next record.
    Key-Nxtrec (Nxtrec is the correct spelling) only runs when you press the key assigned to call that trigger. In my environment, it is the Shift+ Down-Arrow key, but it could be just Down-Arrow -- it all depends on what key sequence is assigned to Forms Function Number 67 in your Forms Resource file, FMRWEB.res (or fmrusw.res).
    So if the trigger runs when you press the correct keyboard key, and you issue the message but do not call the Next_Record; built-in, focus will not navigate to the next record in your running form.

  • Tab key event not fired in JTabbedPane

    Hello,
    I wanted to add the functionality of moving between tabs when Ctrl+Tab is pressed like Windows tabs.
    But the tab key listener event is not getting fired by pressing Tab. For all the other key pushes it is working good. It this a problem with Java? Any workarounds?
    Here is the sample code:
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class TestTab extends JFrame
         public void drawGUI()
              //getContentPane().setLayout(new GridLayout(1, 1));
              JTabbedPane lTabbedPane = new JTabbedPane();
              JPanel lFirstPanel = new JPanel();
              lFirstPanel.add(new JLabel("First Panel"));;
              JPanel lSecondPanel = new JPanel();
              lSecondPanel.add(new JLabel("Second Panel"));;
              lTabbedPane.addTab("Tab1", null, lFirstPanel, "Does nothing");
              lTabbedPane.addTab("Tab1", null,lSecondPanel, "Does nothing");
              getContentPane().add(lTabbedPane);
              lTabbedPane.addKeyListener(new KeyAdapter()
                   public void keyPressed(KeyEvent lKeyEvent)
                        System.out.println(lKeyEvent.getKeyText(lKeyEvent.getKeyCode()));
              setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
         public static void main(String[] args)
              TestTab lTestTab = new TestTab();
              lTestTab.drawGUI();
              lTestTab.setSize(200, 200);
              lTestTab.setVisible(true);

    The KeyPressed events for TAB and CTRL-TAB are typically consumed by the KeyboardFocusManager for component traversal. What you have to do is adjust traversal keys and add CTRL-TAB as an action of your JTabbedPane. This is usually done with the InputMap/ActionMap, not a KeyListener:
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import javax.swing.*;
    public class X {
        public static void main(String[] args) {
            Set tabSet = Collections.singleton(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0));
            KeyStroke ctrlTab = KeyStroke.getKeyStroke(KeyEvent.VK_TAB, InputEvent.CTRL_DOWN_MASK);
            final int FORWARD = KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS;
            final JTabbedPane tp = new JTabbedPane();
            //setFocusTraversalKeys to remove ctrl-tab as a forward gesture
            tp.setFocusTraversalKeys(FORWARD, tabSet);
            for (int i=0; i<6; ++i) {
                JPanel p = new JPanel(new GridLayout(0,1));
                JTextArea area = new JTextArea();
                area.setFocusTraversalKeys(FORWARD, Collections.EMPTY_SET);
                p.add(new JScrollPane(area));
                area = new JTextArea();
                area.setFocusTraversalKeys(FORWARD, Collections.EMPTY_SET);
                p.add(new JScrollPane(area));
                tp.addTab("tab " + i,p);
            //add ctrlTab as an action to move to next tab
            Action nextTab = new AbstractAction("nextTab") {
                public void actionPerformed(ActionEvent evt) {
                    int idx = tp.getSelectedIndex();
                    if (idx != -1) {
                        idx = (idx + 1) % tp.getTabCount();
                        tp.requestFocusInWindow();
                        tp.setSelectedIndex(idx);
            InputMap im = tp.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
            im.put(ctrlTab, nextTab.getValue(Action.NAME));
            tp.getActionMap().put(nextTab.getValue(Action.NAME), nextTab);
            JFrame f= new JFrame("X");
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(tp);
            f.setSize(400,300);
            f.setVisible(true);
    [/code[                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Key-enter trigger not firing

    hi friends,
    i have a trigger on key enter, but it is not firing when i press the enter key,
    why it is not working. i want the trigger to be fired only if the user press Enter key
    thanks
    Kris

    Hi Kris,
    I would suggest you try searching this forum for "KEY-ENTER". You shall be able to find out why it does not fire
    regards,
    teo

  • About Key-Commit

    I have lots of complex validation written on Key-Commit trigger.
    But whenever user tries to clear the form, its asking "Do You
    Want To Save The Changes", if user says yes then Key-Commit
    Trigger is not firing.
    Same thing happens when user press Key-Enterqry, Key-Exit
    button.
    So could u suggest me where can i write my complex validation
    that should fire before commit.
    Note : I can not write in Pre-commit & On-Commit trigger because
    i am having restricted procedure in kEY-COMMIT.
    wILL NEW VERSION OF FORMS FIRES HEY-COMMIT TRIGGER.
    rEPLY SOON
    BHAVESH
    null

    Hi Bhavesh,
    You might have solved your problem by now but if not then a
    suggestion from my end.
    In key-clrfrm trigger
    fire an explicit alert asking if user wants to commit changes
    if user chooses ok to do so then
    use following built-in : do-key('commit')
    which will explicitly fire the key-commit trigger
    hence fulfilling your purpose.
    the following is the source code :
    declare
    al_button number;
    begin
    if :system.form_status = 'CHANGED' then
    al_button := show_alert('c_alert');
    if al_button = ALERT_BUTTON1 then -- OK button
    do_key('commit');
    end if;
    end if;
    clear_form;
    end;
    Hope this solves your problem...
    Regards
    Rashmi
    Bhavesh (guest) wrote:
    : Hi
    : Thanks For reply
    : I can not write restricted procedure like go_item in
    : When-validate-record.
    : Also i have lots of complex validation, flag setting and
    : updatation which should gets fire before commit.
    : Because of restricted form procedure i can not write in pre-
    : commit or when-validate-record, according to me keycommit is
    the
    : correct trigger for all complex validation.
    : Also i am giving u example
    : Try to create simple master-detail form.
    : Make a business rule on form level that at least one child
    : record should present.
    : So how this business rule u will implement using simpest way,
    i
    : know there are lots of way like creating global or parameter
    : variables. but i don't want to use that.
    : My logic for above business rule is as,
    : Create key-commit trigger
    : navigate to detail ---- Restricted proc. go_block('detail')
    : go to the first record ---- Restricted proc. first_record
    : if :field is null then
    : message('at least one child should present') ;
    : raise form_triger_failure ;
    : end if ;
    : commit_form ;
    : so for above validation code which is the alternative trigger
    : Reply soon
    : Bhavesh
    : Fatih Sami KARAKAS (guest) wrote:
    : : Bhavesh Gandhi (guest) wrote:
    : : : I have lots of complex validation written on Key-Commit
    : : trigger.
    : : : But whenever user tries to clear the form, its asking "Do
    : You
    : : : Want To Save The Changes", if user says yes then Key-Commit
    : : : Trigger is not firing.
    : : : Same thing happens when user press Key-Enterqry, Key-Exit
    : : : button.
    : : : So could u suggest me where can i write my complex
    : : validation
    : : : that should fire before commit.
    : : : Note : I can not write in Pre-commit & On-Commit trigger
    : : because
    : : : i am having restricted procedure in kEY-COMMIT.
    : : : wILL NEW VERSION OF FORMS FIRES HEY-COMMIT TRIGGER.
    : : : rEPLY SOON
    : : : BHAVESH
    : : If you write your validation code in the
    : : WHEN-VALIDATE-RECORD trigger then
    : : this trigger fires before KEY-COMMIT.
    : : For KEY-EXIT and KEY-ENTERQRY, you must re-write this
    trigger.
    : : for the first one, write the code as
    : : exit_form(no_commit);
    : : for the second, write
    : : clear_block(no_commit);
    : : enter_query;
    : : Fatih Sami KARAKAS
    : : Turkiye
    null

  • Entity row with key oracle.jbo.Key is not found in EO

    Hi,
    We are using jDev 11.1.1.5.0.
    I am facing the issue Entity row with key oracle.jbo.Key is not found in my entity object.
    I have EO based VO and I am performing some operations on the VO. Based on user actions on UI, I need delete some records of the entity and I am using stored proc to delete those records and committing the changes in stored proc it self. After invoking stored procedure I am committing the changes performed in UI using ADF bindings.
    While invoking Commit from ADf I getting below error
    {code:java}
    <ADFLogger> <addContextData> Entity read all attributes
    <OracleSQLBuilderImpl> <rollbackToSavepoint> [139913] OracleSQLBuilder: ROLLBACK WORK TO SAVEPOINT 'BO_SP'
    <ADFLogger> <addContextData> Commit transaction
    <DCBindingContainer> <reportException> [139914] DCBindingContainer.reportException :oracle.jbo.RowAlreadyDeletedException
    <DCBindingContainer> <reportException> [139915] oracle.jbo.RowAlreadyDeletedException: JBO-25019: Entity row with key oracle.jbo.Key [204635 124 202810 N ] is not found in EO.
      at oracle.jbo.server.OracleSQLBuilderImpl.doEntitySelectForAltKey(OracleSQLBuilderImpl.java:878)
      at oracle.jbo.server.BaseSQLBuilderImpl.doEntitySelect(BaseSQLBuilderImpl.java:553)
      at oracle.jbo.server.EntityImpl.doSelect(EntityImpl.java:8259)
      at oracle.jbo.server.EntityImpl.lock(EntityImpl.java:5964)
      at oracle.jbo.server.EntityImpl.beforePost(EntityImpl.java:6484)
      at oracle.jbo.server.EntityImpl.postChanges(EntityImpl.java:6665)
      at oracle.jbo.server.DBTransactionImpl.doPostTransactionListeners(DBTransactionImpl.java:3286)
      at oracle.jbo.server.DBTransactionImpl.postChanges(DBTransactionImpl.java:3089)
      at oracle.jbo.server.DBTransactionImpl.commitInternal(DBTransactionImpl.java:2093)
      at oracle.jbo.server.DBTransactionImpl.commit(DBTransactionImpl.java:2374)
      at oracle.adf.model.bc4j.DCJboDataControl.commitTransaction(DCJboDataControl.java:1608)
      at oracle.adf.model.binding.DCDataControl.callCommitTransaction(DCDataControl.java:1416)
      at oracle.jbo.uicli.binding.JUCtrlActionBinding.doIt(JUCtrlActionBinding.java:1437)
      at oracle.adf.model.binding.DCDataControl.invokeOperation(DCDataControl.java:2149)
      at oracle.jbo.uicli.binding.JUCtrlActionBinding.invoke(JUCtrlActionBinding.java:740)
      at oracle.adf.controller.v2.lifecycle.PageLifecycleImpl.executeEvent(PageLifecycleImpl.java:402)
      at oracle.adfinternal.view.faces.model.binding.FacesCtrlActionBinding._execute(FacesCtrlActionBinding.java:252)
      at oracle.adfinternal.view.faces.model.binding.FacesCtrlActionBinding.execute(FacesCtrlActionBinding.java:210)
    {code}
    Please let me know if you have any pointers to resolve this.
    Thanks,
    Satya

    Where you are calling stored procedure which deletes records in the DB ?
    Try to override doDML() i your entity impl, as follows:
    protected void doDML(int operation, TransactionEvent e) {
         if(operation == DML_DELETE)    
              call_your_storedProc_here();
         else
             super.doDML(operation, e);
    Also, ensure that the procedure deletes the same set of records as well you in the middle tier.

  • Parent key is not found , SQLException

    Hello,
    I have simple master -details relations , those are used ion the same page of the application,
    in the normal situation, upon commit first INSERT for the master table is executed, then Insert of the details tables,
    but in only one scenario an INSERT is created for a detail before the insert of the master table, so I receive the SQLException which indicates that the parent key is not found, which is actually happening in this case, as the master table does not have a key yet, for that corresponding record,
    any ideas or hints about what could be the reason that the detail insert statement performed before the master's.
    please notice that the executable s are ordered in the page definition as the master comes first
    thanks in advance .

    Hi,
    thanks for replying,
    I already have an Association between the master and that detail entities.
    to be more clear:
    the master's ID is set using override create method of the entityImp class.
    all the other details are working fine, on the same page, this issue is happening for thin one detail entity.
    Gabriel Sideras wrote:
    Hi,
    Do you always have a problem and if not what are the specific steps to reproduce the error?No, I do not , and the steps are the same, I have created all the entities and the page in simplest way, using the wizards. drag and drop from the DataContro.
    regards

  • URGENT!  Problems with On-Commit and Key-Commit triggers!!

    Hi there,
    We are having a problem with our form actually saving a value to the database after the commit_form is given.
    When we hit the Save Button (which triggers the Key-Commit, and that in turn triggers the On-Commit trigger) we want a populated global variable to save to the database. Now when we hit Save, we can see the field get populated properly with this Global Variable (Global.Last_Tckt_Read), BUT it doesn't save to the database.
    Here is the code from the On-Commit trigger:
    IF :cg$bf_meter.closing_ticket_issued = 'N'
    THEN
    :CG$bf_meter.opening_meter_reading := :GLOBAL.LAST_TCKT_READ;
    :CG$bf_meter.opening_meter_reading_date := :GLOBAL.LAST_TCKT_DATE;
    :CG$bf_meter.closing_meter_reading_date := :CG$bf_meter.last_ticket_date;
    :GLOBAL.PREV_METER_READING := :CG$BF_METER.LAST_TICKET_READING;
    :GLOBAL.WINDOW_ACTIVE_CHECK := 'true';
    :GLOBAL.FTDAYCHM_SAVED := 'true';
    commit_form;
    ELSE
    :GLOBAL.PREV_METER_READING := :CG$BF_METER.LAST_TICKET_READING;
    :GLOBAL.WINDOW_ACTIVE_CHECK := 'true';
    :GLOBAL.FTDAYCHM_SAVED := 'true';
    commit_form;
    END IF;
    The code in the Key-Commit trigger is just commit_form;. Now, the code from the On-Commit seems to work fine if its in the Key-Commit trigger -- BUT we need to use the On-Commit in case the user exits the Form with the Exit Button on the toolbar or "X" on the title bar (Neither the Exit Button and the "X" will call the Key-Commit trigger).
    Any ideas how we can get this data value to actually SAVE in the database??
    Thanks for any help -- please respond, this deadline has already passed!
    Mike

    Well, I can't say I understand what you want, but:
    1) if you have only commit_form in key-commit - then you do not need this trigger. key-commit will fire when F10 (commit) is pressed, but since it is doing the same - there is no need.
    2) why don't you populate your block values to be saved right in SAVE button trigger and issue commit_form in the same trigger?
    Then you can have key-commit to cover the same functionality for F10 with code:
    go_item('save');
    execute_trigger('when-button-pressed');
    3) I cannot get the point of the "close" stuff - on close you want to check for changes or not? and to allow the user to exit with or without saving?

  • FRM-40735:KEY-COMMIT  ORA-02291 trigger raised unhandled exception

    FRM-40735:KEY-COMMIT ORA-02291 trigger raised unhandled exception. when i tried to save records.
    I am using multi record block , 12 records will display at a time, i am trying to save 1st and 5th record which i changed.
    calling a procedure in key-commit trigger
    PROCEDURE desig_updation IS
    V_count number := get_block_property('employee_master',query_hits);
    BEGIN
    go_block('employee_master');
    first_record;
    for i in 1.. V_count loop
         if((:desig is not null ) and (:new_date is not null) and (:emp_desig<>:desig) and (:new_date >=:emp_desig_date)) then
              :emp_desig :=:desig;
              :emp_grade:=:grade;
              :emp_desig_date:=:new_date;
              :emp_upd_by:=:global.usr;
              :emp_upd_on:=:system.current_datetime;
              if( (:radio_group=2) and (:incr_amt is not null)) then
                   increment_process;
                   end if;
         end if;
         if :system.last_record ='TRUE' then exit;
         else next_record;
         end if;     
    end loop;
    END;
    PROCEDURE commit_action IS
    BEGIN
    desig_updation;
    commit_form;
    IF FORM_SUCCESS THEN
    CLEAR_FORM(NO_VALIDATE);
    EXECUTE_TRIGGER('PRE-FORM');
    END IF;     
    END;
    key-commit-trigger
    commit_action;
    commit_form;
    IF FORM_SUCCESS THEN
    CLEAR_FORM(NO_VALIDATE);
    EXECUTE_TRIGGER('PRE-FORM');
    END IF;
    PROCEDURE increment_process IS
    m_gross_sal number;
    p_rslt varchar2(200);
    p_status varchar2(20);
    BEGIN
    delete from INCR_TEMP where ECODE = :emp_code ;
    m_gross_sal := aod_gross_salary(:emp_orgn,:emp_code,'A');--find current salary
    insert into INCR_TEMP(ECODE , CURR_SAL ,
    INCREMENT_AMT ,TOTAL_AOD,
    STATUS,INCR_TYPE)
    values(:emp_code,m_gross_sal,
    :incr_amt,m_gross_sal+:incr_amt,
    'N','I');
    forms_ddl('commit');
    update_emp_increment(:emp_orgn,:emp_code,
    TRUNC(to_date(to_char(:new_Date,'DD/MM/YYYY'),'DD/MM/YYYY')),null,
    :incr_amt, p_rslt,
    :parameter.p_user,to_date(to_char(SYSDATE,'DD/MM/YYYY'),'DD/MM/YYYY'),'I',
    p_status);
    END;
    thanks,
    rinz

    It seems you are insert some data in child table. For which parent data does not exist. In simple primary key values does not exist while you are trying to insert in foreign key values. check this link.
    http://www.lmgtfy.com/?q=ORA-02291
    -Ammad

  • Warning: untrusted X11 forwarding setup failed: xauth key data not generate

    Upon connecting to a RedHat Enterprise Linux server via ssh -X I get the following:
    Warning: untrusted X11 forwarding setup failed: xauth key data not generated
    Warning: No xauth data; using fake authentication data for X11 forwarding.
    I have previously (as in last week, ending 11/1/2008) been able to use x11 forwarding from the machine I'm trying to connect to. This problem also occurs with other servers, meaning it must be a problem with my local machine. Any suggestions are welcome.

    I get that if I use
    ssh -Y ...
    but NOT with -X.
    Do you have a $HOME/.ssh/config or /etc/ssh_config file that is specifying ForwardX11Trusted?
    Mostly I ignore the message when I get it as, my X11 forwarding works OK, AND I'm in an environment where my fellow employees could do much naster things to me (and get fired for it), than spoofing my X11 sessions.

  • After Trigger Not Fired

    Hi All,
    I had created a Before and After Trigger for each row on a table.
    The Before Trigger will be fired when some columns are updated.
    In the Before trigger, I will changed the value of 1 column, says delvstatus.
    The After trigger will be fired if the delvstatus was changed.
    However, I noticed that after trigger is not fired if the delvstatus is changed within Before Trigger.
    Is this a normal case for trigger execution in oracle?
    Any comments are welcome.
    Thanks.

    The before trigger and the after trigger should be fired like in the following test case.
    If not please post your test case and your 4 digits Oracle version.
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Prod
    PL/SQL Release 10.2.0.4.0 - Production
    CORE    10.2.0.4.0      Production
    TNS for 32-bit Windows: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production
    SQL>
    SQL> drop table t purge;
    Table dropped.
    SQL> drop table log purge;
    Table dropped.
    SQL>
    SQL> create table log(txt varchar2(50));
    Table created.
    SQL>
    SQL> create table t (x int primary key, s1 int, s2 int);
    Table created.
    SQL>
    SQL> create trigger tbu
      2  before update of s1
      3  on t
      4  for each row
      5  begin
      6  :new.s1 := 1;
      7  insert into log values('tbu fired');
      8  end;
      9  /
    Trigger created.
    SQL> show errors
    No errors.
    SQL>
    SQL> create trigger tau
      2  after update of s1
      3  on t
      4  for each row
      5  begin
      6  insert into log values('tau fired');
      7  end;
      8  /
    Trigger created.
    SQL> show errors
    No errors.
    SQL>
    SQL> insert into t values(0,0,0);
    1 row created.
    SQL> update t set s1 = 2 where x = 0;
    1 row updated.
    SQL> select * from t ;
             X         S1         S2
             0          1          0
    SQL> select * from log;
    TXT
    tbu fired
    tau fired
    SQL>

  • How to Run sequencially two Key-Commit triggers with different scope

    Hi all
    I have two Key-Commit triggers at form and Block level. Form level trigger is inherited from a library. In block level trigger, I have some additional checks. What I want is, to execute the Block level trigger first and than the form level. I tried working with the override/Before/after property of triggers which does the job of sequencing execution but the Raise Form_Trigger_Failure in the block level trigger doesn't stop the execution of form level trigger. Block level trigger does the checks and display corresponding alerts but than the form level trigger also executes.
    I don't wanna copy the code from Form level trigger to the block level trigger as it is common to whole application and may need some additional coding/ bug fixing later.
    Any help would be appreciated.
    RMA

    Thanks for all the help.
    In Key-Commit trigger I am just setting the Blocks' properties, nothing special, the main checks are in On-Commit trigger. I also understand the work around by using a user defined trigger but, to my knowledge, Oracle doesn't recommend it.
    My form has two datablocks, Parent and a child. The entered quantity in the Master block needs to be verified against the Number of units entered in the child block. If they are not the same, I want the alert and stop execution.
    Now I am using Pre-Insert trigger in the master block but was a little surprised because of the sequencing behavior. My understanding was that RAISE FORM_TRIGGER_FAILURE stops execution of all the code after it even is it is in another trigger/procedure ..but now it appears that I was wrong :-(
    Any suggestions??
    RMA

  • Strange behaviour on KEY-COMMIT trigger

    Hallo!
    I'm developing a form on Forms Builder [32 Bit] Version 10.1.2.0.2 and I have the following problem:
    In some of the fields I need to perform a check whether a user inserts correct content type (CAPS + language). To do this I have put on KEY-NEXT-ITEM and POST-TEXT-ITEM triggers on the fields an appropriate function to be executed that gives a suitable message to the user.
    On form level I have a KEY-COMMIT trigger that performs some actions besides commit as well.
    The problem is that if I enter wrong content on the relevant fields and right after I give SAVE (standard menu or toolbar way) I get the message displayed many times (more than the wrong fields) and no commit.
    Any ideas what should I do to eliminate this?
    Many thanks,
    Alexandra

    Thank you very much for the suggestions to use WHEN-VALIDATE-ITEM trigger. It works fine.
    My problem was caused by the code in KEY-COMMIT trigger on form level (following COMMIT;):
    CLEAR_FORM(no_validate);
    do_key('enter_query');
    These 2 lines caused the excessive validation producing multiple messages.
    I replaced with:
    If NOT form_success then
         RAISE Form_Trigger_Failure;
         else
         CLEAR_FORM;
         do_key('enter_query');
    End if;

  • Is their a difference between primary key and unique key with not null valu

    What is the difference in having a column as primary key and having unique key with not null for the column.
    vinodh

    SBH wrote:
    For quick review, below is the link
    http://www.dba-oracle.com/data_warehouse/clustered_index.htm
    You appear to have stumbled on a site that is a mine of disinformation about Oracle.
    >
    It would be helpful, if you explain it too..thnx !!
    The site is wrong and makes up its own terminology as it goes along.
    If the value for clustering factor approaches the number of blocks in the base table, then the index is said to be clustered. http://www.oracle.com/pls/db112/search?remark=quick_search&word=clustered+index
    There is no create clustered index in Oracle.
    - Clustering factor affects the efficiency of an index.
    - There can be clustered tables that you can create indexes on.
    - An Index Organized table is a similar concept to the Microsoft SQL Server clustered index, but it isn't the same thing at all.

  • Difference between PRIMARY KEY and UNIQUE KEY with NOT NULL

    What is the difference between PRIMARY KEY and UNIQUE KEY with NOT NULL constraint?
    Message was edited by:
    Nilesh Hole

    Answer for the master!!!
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:8743855576462
    Thanks,
    Karthick

Maybe you are looking for

  • What happen to the data stored in OVI suite if i f...

    If and only i had to reformat my computer,how do i backup all data like messages,contacts and others that stored in nokia OVI suite??

  • I can't install Microsoft SQL

    Hi, I can't install Microsoft SQL server 2008 or 2008R2 Could you please help me? Thank you.

  • I Web When brining in Photo's Size?

    Hi, I am trying to build a website through i web.  I have quite a few images (photos) that I would like to include.  I shoot with a Canon D-40 and often shoot in RAW or large jpgs. I bring them in to Aperture, so they are often large files.  Set up f

  • Crystal Reports Add-on error on workstations

    I have Crystal Reports 2008 installed with Business One, but I can only get the reports to run if I'm working on the server. At any other workstation, I get a Microsoft .Net Framework error when I try to run a Crystal Report from SAPB1. I followed th

  • The leave encashment exemption

    Hi, the leave encashment exemption  has not subtracted from the income . its coming in /4e7 . but not reflected in /133 Regards