How to Know, No. of Rows has been Update, throught Triggers

Hi all,
I am having problem in after update trigger. I want to know How many rows has been updated by a sql statement, for that I have written on (AFTER UPDATE TRIGGER ON EMP). But it is not giving any result. I am executing Update statement from
Sqlplus (UPDATE EMP SET SAL=23 WHERE EMPNO=7369;) We cant use Commit, and dbms_output.put_line in trigger. thats why I have used exception.
CREATE OR REPLACE TRIGGER EMP_UPDATE AFTER UPDATE ON EMP
DECLARE
NO      NUMBER;
NOROW      EXCEPTION;
PRAGMA      EXCEPTION_INIT(NOROW, -20101);
BEGIN
NO:=SQL%ROWCOUNT;
IF NO<>0 THEN
RAISE_APPLICATION_ERROR(-20101,'Some Rows UPDATED');
END IF;
END;

Hi Sachindra
What SQL*Plus version you are using?
Some versions that come with forms6i they dont write the number of rows updated, they just write operation 44 succeeded or something like that.
But if you use the SQL*Plus database client (sqlplusw.exe or sqlplus.exe) which those 2 get installed with the db you will be able to see the number of rows update/deleted/inserted
SQL> conn scott/tiger
Connected.
SQL> DESC EMP
Name Null? Type
EMPNO NOT NULL NUMBER(4)
ENAME VARCHAR2(10)
JOB VARCHAR2(9)
MGR NUMBER(4)
HIREDATE DATE
SAL NUMBER(7,2)
COMM NUMBER(7,2)
DEPTNO NUMBER(2)
SQL> UPDATE EMP SET SAL = 23 WHERE EMPNO = 7369;
1 row updated.
SQL>
Hope this helps
Regards
Tony G.

Similar Messages

  • How to know if a file has been updated in iCloud after modification?

    How to know if a file has been updated in iCloud after modification?
    I work on various app including Keynote on my Mac Pro. And after modification, i close file and I wait.
    When I see no more Internet traffic. I assume that keynote has uploaded all the works I have done into iCloud.
    But when I open the same file on my iPad on the way to work. I do not see the file updated.
    I assume that I did not wait long enough.
    I wished I had a way to enforce the updated file to upload and way to get confirmation that it has been completed.
    In windows I simply push the sync button.
    But for iCloud I do not yet see anything like that.
    Please help.

    you would be better served asking this in the iCloud discussion, where users are more knowledgeable about iCloud. Replies on iOS and iCloud issues are usually unanswered here because of our lack of knowledge.

  • Project Managers to know when a task has been updated for the last time

    Hi,
    I would like know if there is any timestamp feature in Project Server 2007, so that it can be possible for Project Managers to know when a task has been updated for the last time.
    Thanks in advance

    Hi,
    If you are using the My Tasks to drive the task updates then you can use the 'Applied Requests and Errors' available under 'Go To' in the Task Updates area. Here the PM can find when requests have been approved and how many updates he/she received for a
    particular task (by clicking the task name) etc.
    Hope this helps
    Paul

  • How to know that a method has been called and returning value of a method

    Hi, everyone! I have two questions. One is about making judgment about whether a method has been called or not; another one is about how to return "String value+newline character+String value" with a return statement.
    Here are the two original problems that I tried to solve.
    Write a class definition of a class named 'Value' with the following:
    a boolean instance variable named 'modified', initialized to false
    an integer instance variable named 'val'
    a constructor accepting a single paramter whose value is assigned to the instance variable 'val'
    a method 'getVal' that returns the current value of the instance variable 'val'
    a method 'setVal' that accepts a single parameter, assigns its value to 'val', and sets the 'modified' instance variable to true, and
    a boolean method, 'wasModified' that returns true if setVal was ever called.
    And I wrote my code this way:
    public class Value
    boolean modified=false;
    int val;
    public Value(int x)
    {val=x;}
      public int getVal()
      {return val;}
       public void setVal(int y)
        val = y;
        modified = true;
         public boolean wasModified()
          if(val==y&&modified==true)
          return true;
    }I tried to let the "wasModified" method know that the "setVal" has been called by writing:
    if(val==y&&modified==true)
    or
    if(x.setVal(y))
    I supposed that only when the "setVal" is called, the "modified" variable will be true(it's false by default) and val=y, don't either of this two conditions can prove that the method "setVal" has been called?
    I also have some questions about the feedback I got
    class Value is public, should be declared in a file named Value.java
    public class Value
    cannot find symbol
    symbol  : variable y
    location: class Value
    if(val==y&&modified==true)
    *^*
    *2 errors*
    I gave the class a name Value, doesn't that mean the class has been declared in a file named Value.java*?
    I have declared the variable y, why the compiler cann't find it? is it because y has been out of scale?
    The other problem is:
    Write a class named  Book containing:
    Two instance variables named  title and  author of type String.
    A constructor that accepts two String parameters. The value of the first is used to initialize the value of  title and the value of the second is used to initialize  author .
    A method named  toString that accepts no parameters.  toString returns a String consisting of the value of  title , followed by a newline character, followed by the value of  author .
    And this is my response:
    public class Book
    String title;
    String author;
      public Book(String x, String y)
       { title=x; author=y; }
       public String toString()
       {return title;
        return author;
    }I want to know that is it ok to have two return statements in a single method? Because when I add the return author; to the method toString, the compiler returns a complain which says it's an unreachable statement.
    Thank you very much!

    Lets take this slow and easy. First of all, you need to learn how to format your code for readability. Read and take to heart
    {color:0000ff}http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html{color}
    Now as to your first exercise, most of it is OK but not this:   public boolean wasModified()
          if (val == y && modified == true)
                return true;
    y being a parmeter to the setValue method exists only within the scope of that method. And why would you want to test that anyways? If modified evaluates to true, that's all you need to know that the value has been modified. So you could have   public boolean wasModified()
          if (modified == true)
                return true;
       }But even that is unnecessarily verbose, as the if condition evaluates to true, and the same is returned. So in the final analysis, all you need is   public boolean wasModified()
          return modified;
       }And a public class has to be declared in a file named for the class, yes.
    As for your second assignment, NO you cannot "return" two variables fom a method. return means just that: when the return statement is encountered, control returns to the calling routine. That's why the compiler is complaining that the statement following the (first) return statement is unreachable.
    Do you know how to string Strings together? (it's called concatenation.) And how to represent a newline in a String literal?
    db

  • Is there any way to know that the UI has been updated due to a bind change?

    Hi
    For the given code snippet
    var c=Circle{
      centerX:10  
      centerY:10
      fill:Color.YELLOW
      onMouseClicked:function(event){
          c.fill=Color.RED;
    printNodeAsImage(filename) //to a file
    }

    Oops..Got posted before I could finish the query
    Hi
    For the given code snippet
    var c=Circle{
      centerX:10  
      centerY:10
      fill:Color.YELLOW
      onMouseClicked:function(event){
          c.fill=Color.RED;
          printNodeAsImage(c, filename) //to a file
    }Let us assume that printNodeAsImage(c,filename) saves the circle node with the current color to a file. See http://rakeshmenonp.wordpress.com/2010/04/26/javafx-1-3-save-as-image/ for a implementation of this function
    What we notice instead is that printNodeAsImage(c, filename) actually saves the node with the color YELLOW instead of RED. Is there any way to know deterministically when the UI has been updated due to a variable value change (or because of binding). (In this case the transition from Yellow to Red) So that we can perform other operations on the UI state - like saving it to a file
    Regards,
    Dhruva Ray

  • HT4623 The APP application on my iPad does not function properly - any downloads requested immediately fail and send me back to the main iPad screen.  Any suggestions on how to fix this - all software has been updated to iOS 5.1.1 and no other updates are

    The APP application on my iPad does not function properly - any downloads requested immediately fail and send me back tot he main iPad screen.  Any suggestions on to hoe to fix this?  The software has been updated to iOS 5.1.1, and no furthe updates are available.

    This is my boilerplate response when app downloads are stalled or in the "waiting" mode. There are a bunch of things here to try.
    Tap on the "installing" icon and see if you can pause the install, then tap on it again in order to resume the install.
    Reboot the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons.
    Make sure that you do not have a stalled download in iTunes - a song or podcast .... if you have a download in there that did not finish, complete that one first. Only one thing can download and install at a time on the iPad so that could be what is causing the problem.
    If that doesn't work - sign out of your account, restart the iPad and then sign in again.
    Settings>iTunes & App Store>Apple ID. Tap your ID and sign out. Restart the iPad by holding down on the sleep button until the red slider appears and then slide to shut off. To power up hold the sleep button until the Apple logo appears and let go of the button.
    Go back to Settings>iTunes & App Store>Sign in and see if the install resumes.
    If all else fails, download the updates or the apps in iTunes on your computer and then sync the content to your iPad.

  • How do i know if row has been updated?

    Hi
    Please can someone guide me on how I can determine if my update has been successful. I am currently using the method below but my data is being put into the table but the method rowUpdated() returns false when it should return true.
    rs.moveToInsertRow();
    rs.updateString("SL_Name", "Antek")
    rs.insertRow();
    System.out.println("Row updated " + rs.rowUpdated());
    Thanxs
    Antek

    I am using a primary key which is set by ms-sql server and it has the properties not-null auto incrementing. I was using the manual insert function before but then I realised the moveToInsertRow() method so I changed because of the added benefits to my program I can get. Before I was using the following code to see if a row was inserted see below. (I want something similar for the new way I insert data into table please)
    ======
    what i use to use before
    ======
    int numRows= myStatement.executeUpdate(sql);          
    System.out.println(numRows + " rows updated");
    if (numRows > 0)
    returnString = "success";
    Antek

  • How to know weather Vendor ID  has been created for a Particular employee

    HI Experts,
    We have got ticket from  emploee pertaining to  his Vendor Id.
    How we can check weather the vendor Id has been created for him.
    What is the transaction code we use to check this.
    Thanks in advance.
    Sairam.

    Hi,
    For this you need to go for coustom only..
    Before the following should be identify.
    1. Personnel number should be assign in vendor master single field only because in vendor master there are five fields can mapp with personnel number.
    2. For vendor creation of employee should have different vendor group in Vedor master
    3. vender nuber range must be same as Employee number range.
    Based on above conditions you can create coustom report.

  • Topic has been updated since your last login

    Is this message some kind of new improvement, or didn�t I simply notice that before? I think they should fix the current bugs before adding new features here.

    Why can't you use a base-table block? You are sure trying to do things the hard way!
    But if you insist... To make the comparison, you FIRST need to save the database value of each column in your block as you populate the block -- so you need a displayed/updateable value PLUS a hidden value of the same field. Then, to emulate Forms automatic processing, when you select and lock the row (after the user has made a change to one of the fields) you need to fetch all the values from the database again, and compare these against the hidden saved values. If any one compares not equal (and you must check for both null, also), then the row has been updated by another user.
    Good luck.

  • How to show a row has been "removed" from a table

    We maintain rows in a table with a version number which will determine the current set of accounts for a version. I need to be able to show the changes between the versions - when a row was ADDED, REMOVED or there was NO CHANGE. I can work out ADDED and NO_CHANGE without any problem, but I'm not sure how I can determine that a row has been REMOVED when it no longer exists in the next version.
    I have provided an example piece of SQL below:
    with w_acct1 as
    (select 'A1' acct, 0 vers from dual
    union all
    select 'A2' acct, 0 vers from dual
    union all
    select 'A3' acct, 0 vers from dual
    union all
    select 'A1' acct, 1 vers from dual
    union all
    select 'A2' acct, 1 vers from dual
    union all
    select 'A1' acct, 2 vers from dual
    union all
    select 'A4' acct, 2 vers from dual)
    select a.*,
           nvl(lead(acct) over (partition by acct order by vers desc),'NULL') ld,
           case when lead(acct) over (partition by acct order by vers desc) is null then
                   'ADDED'
               when lead(acct) over (partition by acct order by vers desc) = acct then
                   'NO_CHANGE'
               else
                   'REMOVED'
               end add_remove
    from w_acct1 a
    order by vers,acctWhich gives me the following result:
    ACCT VERS LD ADD_REMOVE
    A1     0     NULL     NEW
    A2     0     NULL     NEW
    A3     0     NULL     NEW
    A1     1     A1     NO_CHANGE
    A2     1     A2     NO_CHANGE
    A1     2     A1     NO_CHANGE
    A4     2     NULL     NEW
    The result I want is:
    ACCT VERS LD ADD_REMOVE
    A1     0     NULL     NEW
    A2     0     NULL     NEW
    A3     0     NULL     NEW
    A1     1     A1     NO_CHANGE
    A2     1     A2     NO_CHANGE
    A3     1     NULL     REMOVED
    A1     2     A1     NO_CHANGE
    A2     2     NULL     REMOVED
    A4     2     NULL     NEW
    Note the REMOVED rows associated with the version even though they don't exist in the dataset for that version number.
    Can this be done with analytic functions or some other cool Oracle feature I'm missing?
    Regards
    Richard

    You can't know about a row being removed unless you have a record of that row somewhere, either as a copy of your old data (see example below) or you've recorded the information using delete triggers etc.
    SQL> ed
    Wrote file afiedt.buf
      1  with old_data as (select 1 as id, 'A' as dta from dual union all
      2                     select 2, 'B' from dual union all
      3                     select 3, 'C' from dual)
      4      ,new_data as (select 1 as id, 'A' as dta from dual union all
      5                    select 3, 'X' from dual union all
      6                    select 4, 'Y' from dual)
      7  --
      8      ,ins_upd as (select * from new_data minus select * from old_data)
      9      ,del_upd as (select * from old_data minus select * from new_data)
    10      ,upd as (select id from ins_upd intersect select id from del_upd)
    11      ,ins as (select id from ins_upd minus select id from upd)
    12      ,del as (select id from del_upd minus select id from upd)
    13  --
    14  select 'Inserted' as action, null as old_id, null as old_dta, new_data.id as new_id, new_data.dta as new_dta
    15  from new_data join ins on (ins.id = new_data.id)
    16  union all
    17  select 'Updated', old_data.id, old_data.dta, new_data.id, new_data.dta
    18  from old_data join new_data on (old_data.id = new_data.id)
    19                join upd on (upd.id = new_data.id)
    20  union all
    21  select 'Deleted', old_data.id as old_id, old_data.dta as old_dta, null as new_id, null as new_dta
    22  from old_data join del on (del.id = old_data.id)
    23  union all
    24  select 'No Change' as action, new_data.id as old_id, new_data.dta as old_dta, new_data.id as new_id, new_data.dta as new_dta
    25  from new_data where id not in (select id from ins_upd union all
    26*                                select id from del_upd)
    SQL> /
    ACTION        OLD_ID O     NEW_ID N
    Inserted                        4 Y
    Updated            3 C          3 X
    Deleted            2 B
    No Change          1 A          1 A
    SQL>

  • How do I know if the program has been downloaded to another computer or not?

    How do I know if the program has been downloaded to another computer or not? Also how do I know if it is the educational version or not?

    What exactly? Your questions don't make much sense since you failed to provide an explanation what problem you actually have, what program you actually mean and so on. That aside, edu versions are technically not different from the normal programs, just their licensing is different.
    Myleniumu

  • How do i know if my iphone has been syncronize with other device and how to remove it.?, how do i know if my iphone has been syncronize with other device and how to remove it.?thanks

    how do i know if my iphone has been syncronize with other device and how to remove it.?, cuz. I had found out that one of my co-work who was updatinng my phone was syncronizing to his name..in this case my photos is been syncronize to his acount.pls help...
    thanks

    Hey Cherielly,
    Thanks for using Apple Support Communities.
    Since you are having an issue with syncing to a different apple id. You may want to make sure you are signing in with the correct apple id.
    iOS: Sign in with a different Apple ID in the iTunes Store, App Store, and iBooks Store
    http://support.apple.com/kb/ht1311
    Have a nice day,
    Mario

  • Hi, for Iphone tips page "see when a message was sent " , then how do I know that the message has been read?

    Hi,
    for Iphone tips page "see when a message was sent " , then how do I know that the message has been read? Thanks  

    Hi Bhavesh,
    Please see my replies inline:
    > 1. If i remember your ealier thread correct also, I
    > would suggest that you drill down in Where Did the
    > Error Occur. Instead of no restriction, select
    > Adapter Engine and also your Corresponding Adapter
    > and then trigger the error message and check if the
    > alert is triggered.
    When I click on "Where did the error occur" -> "Adapter Engine", I do not have a choice of errors from the dropdown. I only see one option "*".
    Is this right?
    > 2. ><i>When I click on "Alert Inbox" ->
    > "Subscription", I get a message "The table does not
    > contain any entries". Is this correct?</i>
    >
    > Yes this is correct. You have defined in your alerts
    > as the option as FIED RECIPIENTS. You also have
    > options like Reciepients via User Role and
    > Subscription Authorization in ALRTCADTDEF.
    >
    I see.
    I've also managed to overcome this problem by selecting "Subscription Authorization" in the Alert Category Definition page, and entering SAP_XI_MONITOR as one of the roles.
    After that, I am able to see a the alert category defined. By default it's already subscribed, because I'm using the same user - PISUPER.
    I saw in another post that the option "Suppress Multiple Alerts of this Rule" should be left unchecked. I tried that, but I still do not see any alerts raised in ALRTDISP.
    What did I miss?
    Please help.
    Thanks.
    Ron

  • HT5824 hi..i m not sure if i have used the icloud before..how do i know if my iphone has been backed up by icloud?

    hi....i m very blur at this...not sure if i have used icloud before...how do i know if my iphone has been backed up ?
    it all happened 2 days ago when my iphone lost everything after updating to ios7. I couldn't even restore back up even i have done my back up before updating...
    just trying my luck here , if anyone can help he to retrieve my photos and notes.

    Access iCloud.com on a computer to check
    http://support.apple.com/kb/PH2702
    Lost or Stolen iOS device  >  http://support.apple.com/kb/HT5668

  • How do I know if my iPad has been virus infected through an attachment in an email opened

    How do I know if my iPad has been infected by a virus through opening an email attachment

    Read http://en.wikipedia.org/wiki/IOS_jailbreaking
    It will void your warranty and cause Apple to no longer support your mobile device.
    Allan

Maybe you are looking for

  • Credit memo on billing posted to accounting

    Hi... If I wanted created a credit memo on billing that already posted to accounting, do I need to cancel the billing first? This billing posted to acct on the previous closed fiscal year. Tq Henery

  • Using Apple remote with MacBook PRo

    How can I manage a PowerPoint presentation on my MacBook Pro using the Apple remote control that came with it?

  • MaxOccurs="unbounded" is not working for NXSD files.

    Hi, I am using the below XSD structure to read fixed length files. The fixed length files can have mutliple occurrences of a bunch of lines. For e.g., 1 A 0010CTCTL 09834 1 A 0020A1TH1 09089 1 A 0030A2TH2 98765 1 A 0010CTCTL 1233 1 A 0020A1TH1 0908 1

  • Termination type was RABAX_STATE while trying to broadcast the Webtemplate?

    Hi, Termination type was RABAX_STATE while trying to broadcast the Webtemplate using Bex Broadcaster. I am attaching the screenshot in the link mentioned below. THis is the error i am getting while trying to broadcast the webtemplate developed by use

  • Evaluating a String to XML element

    we had a xquery function getProductRepo($columnSelect as xs:int) as ns0:productVal for $productval in ns11:getProductVal() return <ns0:ProductVal> <repo1>fn:data($productval/val)</repo1> <repo2>fn:data($productval/val)</repo2> <repo3>fn:data($product