Insert after validation

Hi all

I use JDeveloper 11.1.2.4.0, I created two tables:

table_A (ID_A, Description_A)

table_B (ID_B, Description_B)

I created a model and a user interface, then I created a page special-flow and jsf.

I drag the VO of the table_A on the page and drop it in the form of ADF operating createInsert and validation.

When I press the button post I want to validate a table_A notice and record the value of (ID_A)

to insert a record on table_B:

ID_B = ID_A

Description_B =""

Kind regards

You can do it in java, but it is more work and therefore more chance of error.

If you replace the validation after the method of the OS, you can add the line in table b, but to commit it again add the first transaction is already made.

If you want to do it in java, you can override the prepareForDML method and add the line b of the table in the same transaction. This line of table a and b are to be filed together or none of them is inserted.

When you implement what you'll notice the amount of work to do against a trigger simple db.

Timo

Tags: Java

Similar Questions

  • Commit after validation failed

    Hello

    I have a simple page built on https://apex.oracle.com/pls/apex/f?p=98653:2.

    It has 3 validations:

    V1.1 = Condition 1 button

    BEGIN

    INSERT INTO test (cod)

    SELECT NVL (MAX (COD), 0) + 1

    TO test it;

    ---

    RETURN TRUE;

    END;

    V1.2 = Condition 2 button

    BEGIN

    INSERT INTO test (cod)

    SELECT NVL (MAX (COD), 0) + 1

    TO test it;

    ---

    SELECT MAX (cod)

    IN: P2_COD

    TO test it;

    ---

    RETURN TRUE;

    END;

    V2 = buttons 1 or 2, the Condition after V1.1 or V1.2

    BEGIN

    RAISE_APPLICATION_ERROR (-20101, 'Error');

    ---

    RETURN TRUE;

    ---

    EXCEPTION

    WHILE OTHERS THEN

    ROLLBACK;

    ---

    RETURN FALSE;

    END;

    ===========================

    Validation v2 runs after V1.1 or V1.2.

    Problem: V1.1 is restored on the execution of V2. V1.2 is not restored.


    Obs: instead of using a method, I use insertions on validations on purpose.

    Why is it? Why V1.2 is committed and not V1.1?

    Found that: Oracle APEX Blog of Dan McGhan: implicitly commits in the APEX

    But, even when...

  • Converting a string to a Date using an insert after trigger.

    Hi people:

    I have a table that has a column (called DATE_FED) that must be registered in the format string.

    Once all data insertion after trigger is triggered that copies of some columns in another table.

    The problem is that the insert after trigger will not work because the table is copied in stores DATE_FED data in a Date format.

    I'm trying to understand how to use the TO_DATE function to convert the NEW. Data DATE_FED to a Date format and the trigger does not work.

    Here is the trigger, as it is currently worded:

    Create or replace TRIGGER "FARM". "' BALES_FED_PAST_TRIG ' AFTER INSERT"FARM ". ' ' BALES_FED_PASTURE ' 'OLD' NEWS like 'NEW' FOR EACH LINE REFERENCING OLD declare

    BEGIN

    insert into BALES_STORAGE (BALES_LOST_SUBTRACTED, HARVESTING, CUTTING, STACKYARD, DATE_MOVED, FED_ID, BALE_YEAR) values (: new.) BALES_FED,: new. CULTURE: new. CUTTING: new. STACKYARD,: new. DATE_FED,: new. FED_ID,: new. BALE_YEAR);

    END;

    This trigger worked until I had to change the column type of DATE_FED from the Date to a string.

    I tried things like:

    TO_DATE (DATE_FED): = GCNEW. DATE_FED;    in a statement, but I don't get it.

    Summary:

    I need an insert after trigger to convert NEW. DATE_FED (a string) again. DATE_FED (a Date).

    Tables:

    BALES_FED_PASTURE is the table, the trigger to run.

    BALES_STORAGE is the table the trigger is to copy certain columns.

    I thank very you much for any help.

    Matthew

    FriendlyTooo wrote:

    I have a table that has a column (called DATE_FED) that must be registered in the format string.

    If you book the date in a format string. Bad design. In any case, what is this format? Register you as hh24:mi:ss dd/mm/yyyy or DD-me-YYYY, or... You what it is, you must use this format in your trigger:

    insert into BALES_STORAGE (BALES_LOST_SUBTRACTED, HARVESTING, CUTTING, STACKYARD, DATE_MOVED, FED_ID, BALE_YEAR) values (: new.) BALES_FED,: new. CULTURE: new. CUTTING: new. STACKYARD, TO_DATE(:new.) DATE_FED, "whatever-format-is"),: new. FED_ID,: new. BALE_YEAR);

    SY.

  • Question about sort after validation

    Hello!
    I have a view object. I put in "order by clause" some sort (in the tab query this object to display). I created the jsf page and dropped this display as a table object. Also, I gave up a posting as button operation. When I change a value in the line and press validate, does not my 'order by clause' on the view object and I get unsorted data. When I press Commit the second time, performs a "order by clause. Can suggest you how to bypass this "Commit" behavior?
    JDeveloper version 11.1.2.2.0

    I thank the of to get answers.
    Best regards, Stanislav

    Hello

    Perform execution after validation. You can do this by running the two actions in the actionListener validation button. Search this forum to find out how to perform the action of support of bean binding.

    Arun-

  • FRM-40735: trigger for INSERTION after raised unhandled exception ORA-25207

    Hello
    I am trying to create custom applications. In that when creating custom responsibility I get the following error
    FRM-40735: trigger for INSERTION after raised unhandled exception ORA-25207

    I know ORA-25207 is related to the activation of the queues, but how do I find out which queue this error is ponting at.

    File alertlog Checked, $APPLCSF / $APPLLOG found nothing.

    Any help is appreciated

    Concerning
    Taher

    PL see if the steps described in MOS Doc 211095.1 (11, 5 - AP: Frm-40735: trigger of sur-Commit not triggered managed Ora - 25207 Exception on APXPAWKB) can help.

    It is an odd error and should not occur when you create custom responsibilities. You have customizations/triggers/customizations enabled on the form of accountability?

    HTH
    Srini

  • Blocking of a field in a table after validation

    Hello! "m using jDev 11.1.2.4.0

    My project to get a table and I built a few postings by program for when the user insert or modify table data.

    Everything works except if the field that is not block, that is, when the user inserts incorrect data, an error message appears, but it is possible to validate the changes anyway.

    So, I want to know how to block the field after a valiodation! To do this validation, I use a valueChangeEvent by the following:

    FacesContext.getCurrentInstance () .addMessage (id1.getClientId (FacesContext.getCurrentInstance ()),

    new FacesMessage (FacesMessage.SEVERITY_ERROR, "invalid year.", ")

    "The year should be after 2015."));

    Any help is welcome!

    Kind regards.

    For example, for af:inputText /RichIinputText, there are setValid() method:

    http://docs.Oracle.com/CD/E23943_01/apirefs.1111/e10684/Oracle/ADF/view/rich/component/rich/input/RichInputText.html

    STO, suffice it to say

    setValid (false);

    before showing the FacesMessage

    Here is an example of the use of setValid(), for af:inputFile, search for FichierMettre update() method in the link below:

    Oracle Fusion Middleware Blog by - Mohammed Tanveer: ADF Fileupload - InputFile with autosubmit & valuechange listener

  • Problem of update in table form (after validation fails)

    Hello.

    I have a problem on the shape of tables using APEX 4.2.5.

    Application page has a table and a filter element to filter results in a table.

    The default value of this element is 0 (zero). This means that all the records are retrieved.

    SQL WHERE clause look like where deptno = decode(:P1_deptno,0,deptno,:P1_deptno)

    I created testcase: https://apex.oracle.com/pls/apex/f?p=4000

    W: nlzoh

    SUP: test01

    P: test

    The application name is A1.

    Everything works fine (insert and update), until there are validation error - due to an incorrect value in the column form.

    If I add by example in the second row (ename BLAKE) in the column WORK 1111 - so it would look like MANAGER1111 I get a validation error.

    Then I remove 1111 so validation would be ok, form insert 16 records (all). I is not updated that one record, it inserts all records.

    This allways happens after the validation error.


    When there is no validation error, changed row is updated as expected

    Insert also didn't happen, when there are value DEPTNO in filter.

    So the unexpected result is because of that where would adopt.


    So I have two questions.

    1. Why does it inserts all lines after the validation error? When there is no validation error, only the changed rows are updated - even if there is no DEPTNO in the filter.

    -Why modified column id drop apex?

    2. How can I change where clause, so iz will not work correctly.


    I hope it's understandable.


    Kind regards

    Dean


    Hello

    I created a new shape similar to your condition. His work with no problems.

    Please check Page 2 of application A1

    BR,

    Patrick

  • Browser does not refresh page after validation!

    Hello all, I use JDeveloper 11.1.2.3.0

    I have a big problem here. I create a simple page and insert a form, a createInsert button and a button of validation , for example. I run this page and all is well. I create a new record, fill in the form, and then validate. Right now if I press F5 to reload the page, the browser asks me confirmation "to view this page, Firefox must send information that will repeat any action (for example, a search or order confirmation) that was carried out earlier." I do not understand why he should repeat any action, I checked for Sales transactions after the validation operation and transactions are clean. If I leave this page to another and back to the first it works fine, F5 refreshes without problem.

    If I have a table with multiple lines and that I have updated first line for example and then click on the third line and then perform a refresh (Confirm on above message), the third row will get the all the information of the first line...

    Does anyone know how to fix this?

    OK I found the real problem and the solution to it. As I said the reopening of the page brings no problem, but only to hit F5 don't. My buttons 'submit' and 'committed' a 'partialSubmit = false' who must perform a total of pages submitted in this case. Apparently this is not "detected" by the browser when you press F5, although the presentation is made. Change "partialSubmit = true' the buttons did the trick." Tung

  • Is it a "trigger" after validation?

    Hi all.

    I want to do some complicated logics (can take a long time) after a row of data is inserted and committed successfully.

    "Lead them" in Oracle to meet my needs?

    I know that the trigger for insert/update normal is executed before the validation of the transaction. But I can't let users front end waiting so long time to the end of the logic.

    Thank you very much.

    then submit a job from within the trigger executes a procedure and let the procedure complicated logic.

  • Iterator refreshing after validation

    Hello

    JDev 11.1.2.4

    I have two buttons, which committed one and one that refreshes the iterator. The user adds a row to a wrong position (problem with sorting in memory). In any case as the user clicks the validation, registration is in the database and to the right when I update the iterator. The added row is still in the wrong position. Then, the user clicks the refresh iterator and magically the added line is in the right position. It makes no sense to me, why the update after the validation does not sort the lines directly appeal is sort the rows. When the update is called, I can see the SQL query with good running ORDER BY clause.

    {} public void commit (ActionEvent actionEvent)

    Super.Commit (); Call the validation on the data control operation

    refreshIterator(); Does not sort the lines

    }


    private void refreshIterator() {}

    DCIteratorBinding it = ADFUtils.findIterator ("MyView1Iterator");

    it.invalidateCache ();

    it.executeQuery ();

    IT. Refresh (DCIteratorBinding.RANGESIZE_UNLIMITED);

    }

    {} public void refreshIterator (ActionEvent actionEvent)

    refreshIterator(); Sort the rows

    }

    Thank you

    I fixed it. It was my mistake, I called the wrong actionListener on the page.

  • Update after validation value

    Hi all

    I am begginner in ADFand using jdev 11.1.2.4

    I have the table, there is attribute called 'flag' I want what update of this table, and then press "commit" after pressing on... put this "flag" with 1"

    ex. After pressing commit "" update table set flag = 1 ".

    can someone help me please.

    Thanx

    This approach will break the frame. Don't ever call him commit inside a doDML methods such as this is just in the validation cycle.

    The link I've posted explicitly mentioned that you cannot change attribute of inside doDML as already values came out. You must use prepareForDML for that. Commit or rollback are called from the outside, so you shouldn't worry about this.

    Timo

  • Tests for insert after execution of the ApplyMRU

    Apex 4.0, tabular forms.

    I have 2 tabular forms. First is a master. Second is a detail. On pages separate.

    I would like to automatically redirect to the detail, if a new record is inserted on the master.

    I thought that maybe I could test #MRI_COUNT # for 1 after execution of the APPLYMRU.

    So I.

    1. establish a process after APPLYMRU that retrieves the high key out of the master and update a page with the value element.

    2 set up a branch to call detail and set a page element in detail to the master page to the #1 element.

    Tried to make subordinate them to point value #MRI_COUNT = # = 1. Neither the fire.

    Is the concept of test #MRI_COUNT # wrong? Is there a better way to do it.

    Thank you!

    I came up with a solution that works. Not very elegant. A little brutal. But it works.

    1 insert a PL/SQL block process that runs on submit before ApplyMRU. Captured key high on the table. Moved to Pxxx_OLD_KEY.

    2. Insert a PL/SQL block process that runs on submit after ApplyMRU. Captured key high on the table. Moved to Pxxx_NEW_KEY.

    3. put a branch to the detail page that has unwound on condition that Pxxx_OLD_KEY! = Pxxx_NEW_KEY and SUBMIT button. Past Pxxx_NEW_KEY to the details page.

    If there were updates only the front and after the key would be the same. If REMOVE the button has been pressed the direction would not run.

    Not particularly proud of it. But it works so far.

  • Process of conditional based on IR-link after validation step

    Hello

    I am trying to find a solution to the following situation:

    A PL/SQL-Process must be released if:
    -the value of a page element is not null
    and
    -l' user has clicked on a link to the column in an interactive report (the link is "conditional")

    My starting situation:

    _1. DB-Configuration: _
    CREATE TABLE TABLE1 
    (
      NR NUMBER 
    , SHOW_BUTTON CHAR 
    );
    
    INSERT INTO TABLE1 (NR, SHOW_BUTTON) VALUES (1, 'Y');
    INSERT INTO TABLE1 (NR, SHOW_BUTTON) VALUES (2, 'N');
    INSERT INTO TABLE1 (NR, SHOW_BUTTON) VALUES (3, 'Y');
    _2. ApEx-Configuration: _

    Interactive report with the following region source:
    SELECT 
       DECODE(SHOW_BUTTON, 'Y', '<img src="#WORKSPACE_IMAGES#OK.png" alt="PushMe">', NULL) "E"
     , NR 
    FROM TABLE1
    The link should appear only if the value in the column SHOW_BUTTON is equal to "Y".
    The column 'E' format is set to column report Standard, with a branch to the page itself.
    View details and the search bar in the report interactive is disabled.
    Furthermore, I placed an element on the page that is displayed below the text box.

    What must happen now, if the cklicks of the user on the link:
    1. the textarea element must be validated; must not be null
    2. If the textarea element is not null, the SQL/PL-Process must be started

    I tried several ways, including javascript, but I can't find the right way to make it work.

    Any suggestions?

    Thank you very much!

    André



    Database version:
    Oracle Database 10 g Release 10.2.0.5.0 - 64 bit Production
    PL/SQL Release 10.2.0.5.0 - Production
    CORE Production 10.2.0.5.0
    AMT for Linux: Version 10.2.0.5.0 - Production
    NLSRTL Version 10.2.0.5.0 - Production

    ApEx version:
    4.0.2.00.07

    Published by: seggione on May 7, 2013 10:37

    Hello

    For this you don't have to do any complex changes(Dynamic actions) as I had mentioned previously.

    Simply change your column to link to send the page rather than redirect to the same page.

    either change the link in the column and value
    Target URL
    URL javascript:apex.submit ('MYREQUEST');

    And modify your process plsql to erase the value of P1_TEXTAREA

    and disable/remove the dynamic action because it is no longer necessary

  • Oracle sql developer - data not available after validation tool

    The data that is inserted into the table. If I run the select query, I can see the inserted data. But once I run validation, and then run the select query on the same window, no record found.

    It's strange looks. Don't know what the problem is.

    Kind regards
    Suresh

    Hi Suresh,

    Hope that you introduce into a global temporary table, where the table is created in the
    ON COMMIT DELETE ROWS.

    Thank you
    Shankar.

  • Popup is closed when the command link is pressed even after validation exceptio

    Hi Techies,

    I use JDeveloper 11.1.1.4. I have an example of .jspx page that has a table, a command link and a popup. When the user clicks on the link command, the pop-up gets shown.

    The context menu contains af:panelWindow as an immediate child. window Panel as a layout of Group Panel that contains the input box and a command link. The input text is a validation. Now my problem is the same if the validation fails if I click on the order link in the popup, the popup is gone. Fortunately, it is not updated in the database (infact, the action and actionlisteners themselves are not called since the commit fails.) Hopefully this is the expected behavior) but my question is: could someone tell my way to prevent the popup to hide when I click on the order link in the popup once after the failure of the validation?

    Kind regards
    V. Praveen

    Hello

    you have set PartialSubmit = true on the commandLink?

    Frank

Maybe you are looking for

  • has dropped family sharing

    has dropped family sharing?

  • Travel - deleting Photos synchronized without Mac

    I'm stuck! I am currently on vacation and want to add photos and videos, that I take with my camera for my iPad to share etc.  But I'm running out of space! However, my iPad has some video on that I can't remove.  I think they are synced from my Mac

  • What should I do if my iPhone 5s forbade me to my game for a month

    Hello sorry I'm a bit new to this but I have an iPhone 5 s It is updated with iOS 9.3.1 The problem I'm having is that it is forbidding me from my games... what I mean by (BANNED), is that I can play the game he forbade me to on my iPod. We'll my log

  • Carbon X 1 deployment recipe card 4th gen?

    There is no recipe card of deployment available at the https://support.lenovo.com/us/en/documents/ht104042 for the 4th X 1 carbon generation. The model was announced in February 2016; When the deployment recipe card be available?

  • Enum change color in a cluster that is in a table

    Hello I have this cluster with a string and an enum, which is in a table. I use an event producer/consumer model, on the event of the mouse clicking on a line specific VI another opens with a string of button and comment of success/failure. After pla