need, update the message after inserting the trigger data

Hi all

CREATE OR REPLACE TRIGGER xxc_student

AFTER INSERTION

WE raise

BEGIN

Dbms_output.put_line ('end of Inserted');

END;

And I want to insert data into the table:

INSERT INTO student (name) VALUES ("ABC");

INSERT INTO student (name) VALUES ("CCC");

INSERT INTO student (name) VALUES ('DDD');

INSERT INTO student (name) VALUES ("EEA").

COMMIT;

I have the following results:

1 row inserted

end of Inserted

1 row inserted

end of Inserted

1 row inserted

end of Inserted

1 row inserted

end of Inserted

ENGAGE

And I would have

1 row inserted

1 row inserted

1 row inserted

1 row inserted

end of Inserted

Oracle Database 11 g Enterprise Edition Release 11.1.0.7.0 - 64 bit Production

Thank you

No, this isn't possible; e by a trigger.  Relax, you have created is a statement after trigger, so it fires after the insert statement is complete.  In the first example, you have 4 separate SQL statements, so the trigger is activated after each statement.  In your second example, you have a single SQL statement that affects the 4 lines, if the trigger is activated once the end of the statement.

The number of inserted rows is reported since sqlplus (the client), based on what the engine SQL in the database said he did.  Since there is only a single statement engine SQL reports 4 lines inserted at the client, not four row insertions.

What problem are you trying to solve with this approach?  In General, dbms_output is not much used in production code, except occasioanlly as a simple debugging tool.

John

Tags: Database

Similar Questions

  • How to display a message after inserting line in the table...

    Hello

    I want to display a message after inserting rows in the table as *' you have inserted a new line with success *'.


    I use the ADF button createinsert to insert the rows in table.after that I am stolen it.


    After commit I want to display message for the user.for what I need to do.





    Please help me.





    Sanchez.

    Double-click the validation button, to link Action property dialog will appear and then create a method of bean managed for the validation button.
    Then, add the following code to the method:

    public String saveButton_action() {}
    BindingContainer links = getBindings();
    OperationBinding operationBinding = bindings.getOperationBinding ("Commit");
    Object result = operationBinding.execute ();
    Note "!" operator has been removed from the default code.
    {if (OperationBinding.GetErrors (). IsEmpty())}
    FacesContext ctx = FacesContext.getCurrentInstance ();
    FacesMessage saveMsg is new FacesMessage ("saved successfully");.
    ctx.addMessage (null, saveMsg);
    }
    Returns a null value.
    }

    Then, restore the ActionListener value.

    I hope this helps.

  • Unable to connect Adobe cloud after update the expiration date of credit card

    Unable to connect Adobe cloud after update the expiration date of credit card.

    The activation server show that CC has expired on 21 September, 2015. Please renew the subscription if possible or re-purchase.

    The best option will be to contact Adobe support for this.

    Concerning

    Stéphane

  • Dear Sir, our creative cloud need updating, but always after 70 or 80% update, update stopped creative cloud - (display an error - 184 fetal. How can I solve this problem. Please help me...

    Dear Sir, our creative cloud need updating, but always after 70 or 80% update, update stopped creative cloud - (display an error - 184 fetal. How can I solve this problem. Please help me...

    Please visit get the following message appears when you try to install Illustrator 2015: Exit Code 184

  • Planted in the middle of the intallation: "could not update the registry data.

    My hard drive was a hardware malfunction and had to be replaced altogether. I just got my new hard drive, and after fit, he tried to install vista Home premium 32B, that came with my dell inspiron 530 computer. About 10 minutes after the installation a message announcing that "windows could not update the registry data" and "installation has been cancelled. This was repeated several times. Any ideas why and how to solve?
    Thank you.

    HI -.
    Other people who have had this problem report that choose NOT to do the updates during installation allows you to install finish. They are then installing updates once the installation is complete. You see an option to install no updatesa as part of the installation? Barb winter
    Program Manager of Microsoft Answers
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • How can I update the expiration date on my credit card account?

    How can I update the expiration date on my credit card account?

    How can I update the expiration date on my credit card account?

    Go to your Bank and get a new card.

  • is com.mslv.oms.automation.AutomationException by updating the order data

    Hello

    I wrote a sample Xquery Automator with external event receiver.

    DECLARE namespace SGD = "urn: com:metasolv:oms:xmlapi:1";

    DECLARE namespace log = "java: org.apache.commons.logging.Log;

    declare namespace automator = "java: oracle.communications.ordermanagement.automation.plugin.ScriptReceiverContextInvocation";

    declare the namespace context = "java: com.mslv.oms.automation.TaskContext";

    " declare osm namespace = ' http://xmlns.Oracle.com/communications/OrderManagement "; "

    declare saxon namespace = " " http://Saxon.SF.NET/ "; "

    " declare namespace xsl = ' http://www.w3.org/1999/XSL/transform ";

    declare the external variable $context;

    declare the external variable $log;

    declare the external variable $automator;

    Let $taskData: = fn:root (.) / CRAMER. Response

    Let $orderId: = $taskData/CRAMERWOID

    Let $jid: = $taskData/CRAMERJOBID

    Let $ordUpdateReqXML: =)

    " < OrderDataUpdate xmlns =" http://www.MetaSolv.com/OMS/OrderDataUpdate/2002/10/25 "> "

    < update path = "/" >

    < job_id > HC < / job_id >

    < / update >

    < / OrderDataUpdate >

    )

    Let $ordUpdateReqXMLStr: saxon =: serialize($ordUpdateReqXML, <xsl:output method="xml" omit-xml-declaration="yes" indent="yes" saxon:indent-spaces="4"/>)

    return)

    Journal: info($log, "### XML Transformed")

    Journal: info ($log, $ordUpdateReqXML),

    Journal: info ($log, "# XML Transformed after serialized"),

    Journal: info ($log, $ordUpdateReqXMLStr),

    Automator:setUpdateOrder($Automator,"true"),

    Context:updateOrderData($context,$ordUpdateReqXMLStr),

    context: completeTaskOnExit ($context, "success")

    )


    but when running it throw exception automation:

    Caused by: java.lang.NullPointerException

    at oracle.communications.ordermanagement.automation.plugin.AbstractScriptPluginImplementation.updateOrderData (unknown Source)

    NOTE: - in Design Studio Plugin properties - Xquery Automation tab I tried with two control box checked and unchecked data verification options.

    Please guide me what is wrong with my code.

    Let me know if more information needed on this.

    Thank you

    Stack trace

    com.mslv.oms.automation.AutomationException

    at oracle.communications.ordermanagement.automation.plugin.AbstractExternalReceiverDispatcher.processMessage (unknown Source)

    at com.mslv.oms.automation.AutomationDispatcher.onLocalMessage (unknown Source)

    at oracle.communications.ordermanagement.cluster.message.a.a (unknown Source)

    at oracle.communications.ordermanagement.cluster.message.impl.a.a (unknown Source)

    at oracle.communications.ordermanagement.cluster.message.impl.a.a (unknown Source)

    at oracle.communications.ordermanagement.cluster.impl.a.a (unknown Source)

    at oracle.communications.ordermanagement.cluster.message.ClusterMessageHandlerBean.onMessage (unknown Source)

    at com.mslv.oms.security.base.ControllerBean.processExternalListenerAutomationMessage (unknown Source)

    at com.mslv.oms.security.base.OMSController_h9cupp_EOImpl.__WL_invoke (unknown Source)

    at weblogic.ejb.container.internal.SessionRemoteMethodInvoker.invoke(SessionRemoteMethodInvoker.java:40)

    at com.mslv.oms.security.base.OMSController_h9cupp_EOImpl.processExternalListenerAutomationMessage (unknown Source)

    at com.mslv.oms.security.base.OMSController_h9cupp_EOImpl_WLSkel.invoke (unknown Source)

    at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:174)

    at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:222)

    at com.mslv.oms.security.base.OMSController_h9cupp_EOImpl_1036_WLStub.processExternalListenerAutomationMessage (unknown Source)

    at oracle.communications.ordermanagement.automation.plugin.AbstractExternalReceiverDispatcher.processMessage (unknown Source)

    at com.mslv.oms.automation.AutomationDispatcher.onLocalMessage (unknown Source)

    at com.mslv.oms.automation.plugin.AutomationDispatcherImpl.a (unknown Source)

    to com.mslv.oms.automation.plugin.AutomationDispatcherImpl$ 2.a (unknown Source)

    at oracle.communications.ordermanagement.cluster.message.ClusterMessageHandlerBean.onMessage (unknown Source)

    at weblogic.ejb.container.internal.MDListener.execute(MDListener.java:583)

    at weblogic.ejb.container.internal.MDListener.run(MDListener.java:902)

    at weblogic.work.ExecuteRequestAdapter.execute(ExecuteRequestAdapter.java:21)

    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:145)

    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:117)

    Caused by: java.lang.NullPointerException

    at oracle.communications.ordermanagement.automation.plugin.AbstractScriptPluginImplementation.updateOrderData (unknown Source)

    I found the solution, just need to order to update set to false after the order data update

    Here is the update of Xquery

    DECLARE namespace SGD = "urn: com:metasolv:oms:xmlapi:1";

    DECLARE namespace log = "java: org.apache.commons.logging.Log;

    declare namespace automator = "java: oracle.communications.ordermanagement.automation.plugin.ScriptReceiverContextInvocation";

    declare the namespace context = "java: com.mslv.oms.automation.TaskContext";

    declare namespace osm = "http://xmlns.oracle.com/communications/ordermanagement";

    declare the saxon namespace = "http://saxon.sf.net/";

    declare namespace xsl = "http://www.w3.org/1999/XSL/Transform";

    declare the external variable $context;

    declare the external variable $log;

    declare the external variable $automator;

    Let $taskData: = fn:root (.) / CRAMER. Response

    Let $orderId: = $taskData/CRAMERWOID

    Let $jid: = $taskData/CRAMERJOBID

    Let $ordUpdateReqXML: =)

    http://www.MetaSolv.com/OMS/OrderDataUpdate/2002/10/25">

    HC

    )

    Let $ordUpdateReqXMLStr: saxon =: serialize($ordUpdateReqXML, )

    return)

    Journal: info($log, "### XML Transformed")

    Journal: info ($log, $ordUpdateReqXML),

    Journal: info ($log, "# XML Transformed after serialized"),

    Journal: info ($log, $ordUpdateReqXMLStr),

    Automator:setUpdateOrder ($Automator, true (()),

    Context:updateOrderData($context,$ordUpdateReqXMLStr),

    (: threshold, I have added to the problem)

    Automator:setUpdateOrder ($Automator, false (),.

    context: completeTaskOnExit ($context, "success")

    )

  • Impossible to update the display data

    Hello
    I created a simple view based on a table, but I can't update the data in the view. How can I do that.

    Thank you

    You will need create an INSTEAD OF trigger to update the base table of way...

    for example

    SQL> select * from test1;
    
         EMPID DT                        SALES       COMM
    ---------- -------------------- ---------- ----------
             1 26-SEP-2009 10:19:05        200          0
             1 29-SEP-2009 10:19:05        300          0
             1 06-OCT-2009 10:19:05        100          0
             2 01-OCT-2009 10:19:05        400          0
             2 04-OCT-2009 10:19:05        150          0
    
    SQL> create view vw_sales as
      2  select empid, sum(sales) as sales, sum(comm) as comm from test1
      3  group by empid;
    
    View created.
    
    SQL> select * from vw_sales;
    
         EMPID      SALES       COMM
    ---------- ---------- ----------
             1        600          0
             2        550          0
    
    SQL> update vw_sales set comm = sales*0.1;
    update vw_sales set comm = sales*0.1
           *
    ERROR at line 1:
    ORA-01732: data manipulation operation not legal on this view
    

    So, as a standard, we can update the display because it contains aggregates.

    If we create instead of trigger on the view, we can grab the update and update "instead of" the view's base tables...

    in my example, I'll answer to update the commission on the employee, by spreading the commission also on all sales for this employee records...

    SQL> ed
    Wrote file afiedt.buf
    
      1  create or replace trigger trg_vw_sales instead of update on vw_sales
      2  begin
      3    update test1
      4    set comm = :new.comm / (select count(*) from test1 where empid = :new.empid)
      5    where empid = :new.empid;
      6* end;
    SQL> /
    
    Trigger created.
    

    So now, we should be able to update the view...

    SQL> update vw_sales set comm = sales*0.1;
    
    2 rows updated.
    
    SQL> select * from vw_sales;
    
         EMPID      SALES       COMM
    ---------- ---------- ----------
             1        600         60
             2        550         55
    

    It's looks right. The commission shall be 10% of the total value of sales. :)

    And if we check the base table...

    SQL> select * from test1;
    
         EMPID DT                        SALES       COMM
    ---------- -------------------- ---------- ----------
             1 26-SEP-2009 10:19:05        200         20
             1 29-SEP-2009 10:19:05        300         20
             1 06-OCT-2009 10:19:05        100         20
             2 01-OCT-2009 10:19:05        400       27.5
             2 04-OCT-2009 10:19:05        150       27.5
    
    SQL>
    

    ... the commission is evenly distributed over the sales as we wanted.

    ;)

  • Update the field Date according to the date of another field

    Hi I have a field called "contract end Date" which I update manually according to the contract, and a field called "notify contract end Date" I want to be updated automatically with the "end of contract date" - 45 days.
    Is this possible via workflow? can someone give me the syntax that works? If I want to manually insert the value of the field 'Date to end the contract to notify' it will overwrite it?
    Thank you, David

    Hello!

    Create your workflow on your object type, select the before saving the trigger modification event, put the following condition:

    [< contract end date >] <>MEADOW ("< the contract end date > '")

    And in action, update the field End Date of the contract to notify with end Date of contract - 45 and check the replacement value. You contract end Date field must be with the type date.

    I hope this will help, do not hesitate to ask for more!

    Max

  • Update the XML data store

    Hello experts,

    I've created an interface when an xml file is reversed in the form of a source data store. Xml data are pumped into a target of oracle db. All this goes well.

    I'm creating a scenario where I get an xml file from a ftp server on a daily basis (with agent). This new xml file has the same structure as that already used in the interface. The question is: How can I update the data in the xml data store?

    I tried to replace the original xml file, but it does not work and cdc does not seem to apply here, I searched for quite a while now.

    Thank you very much!

    Yves

    Hello

    See if that helps
    XML for the interface Oracle even insert County regardless of input XML file

    Thank you
    Fati

  • Updating the XML data

    We know how or if you can update or insert new data in an xml file in Flash AS3?

    An example would be a person complete and submit a form, then the input is sent to the xml file to create or update the nodes in the xml file.

    Thanks in advance.

    You can do that directly flash player.

    You can do this via a script server-side, e.g. a script using php that processes the application of flash, but often the data in this type of scenario would be stored in a database instead of an xml file (however you use php to update an xml file is quite possible too)

  • How to copy "Date to update the" to "Date of creation"?

    For some reason, all my photos have had their 'date Created' changed for a date in 2015? I do not have a back-up I can restore (a more 30 000 photos), but both the "date modified" and the date of "Last opened" remain as the original "date of creation".

    Is it possible to copy the 'date Modified' or the 'last opening' to replace the 'created date '?

    ANY suggestions much appreciated.

    Thank you and happy new year,

    Kenneth

    I use a MacBook Air with the latest Photos and operating system installed.

    Where you see the 'creation Date' in the Photos?  The information about the Photos Panel is only indicating the date of capture integrated in the file original image IPTC and EXIF tags.

    File creation date that you see in the Finder, if you access the originals using the Finder, may change, if your library is synchronized with iCloud. All original image in my library on my MacBook Pro to iCloud retina display a date of creation sometime in July, when I downloaded the iCloud library.

  • Whenever I turn on my computer I need to the correct date and time

    I have windows XP everytime I turn on, I have to change the date and time, as it shows always 1 January 2005 23.00

    [Moved from comments]

    On Wednesday, April 10, 2013 19:32:35 + 0000, joey2140 wrote:

    I have windows XP everytime I turn on, I have to change the date and time, as it shows always 1 January 2005 23.00

    Certainly, you need to replace the motherboard battery CMOS.
    They are just 3 $US or more and easy to replace.

  • Update the metadata/data in the cube considered ASO of BSO

    Hi Experts,

    I'm creating a cube of ASO reports and would like to know the best way to automate the update of metadata and data of a BSO cube without the use of a partition? This is my first time with ASO. Any idea or examples would be much appreciated. Please notify.

    Thanks in advance!

    Use the command 'clear data' in calc script or its all in your script report how you extract... :))

  • Need to Partition network each insertion of new data?

    Hello

    I would just ask, if I have a network that is partitioned with the help of SDO_NET. LOGICAL_POWERLAW_PARTITION and I added more data in my table of knots and links after the partitioning of the network, I need to run SDO_NET. Once again LOGICAL_POWERLAW_PARTITION?

    Thank you

    Hello

    When the network topology changes you must divide the new network to reflect the change.

    You will need to re - build the blobs of partition when you partition the network.

    I hope that helps!

    Jack

Maybe you are looking for

  • What is the accuracy of the watch heart rate Moniter?

    My heart rate monitor Apple Watch occasionally reads too low was 30. When this happens and I manually check my pulse there is an important difference, which is that my pulse is 70. My question is, is this a fault of my watch or is it like that?

  • Search field in the corner upper rh does not: can't type in it. It's new.

    That describes the problem.All I can do is click on it and then I get a new page of google with a quick search bar in the middle of the page and then I can type into it. It's new, has happened an hour ago. I tried to remove firefox and download again

  • missing vga port

    I have HP Pavilion p077TX-15 Notebook lapptop and I found that there was not then, how can I connect to a projector vga port?

  • How to restore a previous version of Safari?

    I have an old iMac with the Lion, 10.7.5 operating system. It uses Safari version 6.1.6. I recently downloaded a new version of Safari, but now I get a message that my operating system is too old to deal with. The operating system upgrade is not an o

  • What is windows 7 read documents created on windows xp please?

    I have a new I Mac and want to install a Windows program use Word. If I install Windows & he will read all the files I transfer to my PC, which runs on Windows XP? Thank you