How do to display the number of rows Inserted/deleted etc. in PL/SQL

In Oracle 10 g PL/SQL, I have a delete statement in a stored procedure. This isn't in a cursor. I want to see the number of lines that I deleted. I can use dbms_output.put_line package. I should know this, but I don't have time to perfect syntax. How do I get the number of rows that are deleted and the display via dbms_output.put_lline?

For example:

set serveroutput on

begin

   delete  dept;

   dbms_output.put_line(sql%rowcount);

end;
/  

Miguel

Tags: Database

Similar Questions

  • Displays the number of rows in the table displaying a named criteria query data

    I created a test named for my View, called 'Criteria1' and Criteria1 to create a group of ADF with Table query. I want to display the number of rows in result when a search is performed. How can I do?

    Thanks in advance,
    Tom

    As mentioned, you can add outputText and you must give OutputText partialTriggers as query component your Id. Thus, when you give a search on the query component, it will refresh the outputText with the number of lines.


    ID = "ot1" partialTriggers = "id of the component of motion here" / > ""

  • How can I get the number of rows in the table using Sunopsis API target in ODI 10 g?

    Hi guys,.

    In fact, I want to send an alert message as soon as the interface is run from a package. I've included alert OdiSendMail that sends an email once the interface is running.

    Could someone please tell how to get the number of rows inserted into the table the Sunopsis API target.

    I tried to use < % = odiRef.getNbRows () % >, but this has not worked for me. Since I am a beginner, could you please help out me

    This is my mail to send ODI format

    "The population of data managed to < % = odiRef.getSysDate () % >

    Total of lines in the target table is: < - need an API code-> "


    Kind regards

    Clinton

    Published by: LawrenceClinton on February 25, 2013 20:53

    Hello

    Create the project with details below variable

    Nom_de_variable: Total_Row_Count

    Type of variable: Variable discount

    Definition tab:
    Data type: digital
    Action: No persistent

    Refresh the tab:
    Schema: provide the schema of your repository to work and be

    SELECT log.nb_row
    THE journal of snp_step_log, snp_scen_step step
    WHERE log.nno = step.nno
    AND step.scen_no = (SELECT scen_no FROM snp_scen_step WHERE step_name='<%=odiRef.getPrevStepLog ('STEP_NAME") % > ')
    AND log.sess_no = '< % = odiRef.getSession ("SESS_NO") % >' code at low
    AND step.step_name = ' < % = odiRef.getPrevStepLog ("STEP_NAME") % > '

    Note: add this variable after the stage of interface in your package (after the interface anywhere you can place), you can add this variable before ODISendEmailNotification in your package

    call this varciable * #Total_Row_Count * in the Notification of ODISendEmail

    for example :

    Data has been fulfilled successfully in < % = odiRef.getSysDate () % >
    Total no of lines filled are: * #Total_Row_Count *

    it will work

    cordially,
    Phanikanth

    edited by: Phanikanth on February 28, 2013 01:13

    edited by: Phanikanth on February 28, 2013 01:14

  • JDeveloper 10.1.3.4 af:table displays the number of rows of erratically

    For the experienced:

    There are several pages in the web application I developed using JDeveloper 10.1.3.4, and it allows the user to navigate between the pages back. A page displays the selected rows of a database table, using the af:table component.

    To display all the rows returned by the query in the underlying object in the view, I put the Rows of the af attribute: table to 0. However, rather than show lines as expected, the currently displayed lines are.

    1. when the user connects and starts a new session and accessing this page for the first time, the table on this page shows all lines (with the database I check the problem now, ago total 31 lines selected in the database table and all 31 lines are displayed).
    2 but if you leave this page, then come back, it shows only 10 lines and the top and bottom of the table actually appear dimmed (i.e., not in use) links "previous" and "next," which did not appear when you went to this page for the first time in the session. And there is simply no way to see other 21 pages.

    I thought that the attribute can be defined as lines =-1 and tried. But - 1 is not accepted. So I tried to place the lines = 25 and ran the application. His behavior is as follows:

    1. the first time in a session you navigate to the page, it works as you would expect with the lines = adjustment 25.
    2. When you leave the page and return, it shows the lines 22-31 and lets you click to display 'previous 21. However, if you click on this link, instead of display lines 1-21, it displays lines 1 to 25 and from there, works as you would expect with the lines = adjustment 25.
    3 leave the page and come back, it shows the lines 21-31 and displays the 'previous 20' link. A click on it and you do not see lines 1 to 20, but lines 1-25. Again, from there, it works as you would expect with the lines = 25 setting, until you leave the page.

    What could be wrong? And is there a solution to this problem?

    Thanks a lot for your help!


    Newman

    Hello

    just played with him a bit... looks like you did not for the iterator in def-1 page as the size of the beach:

      
        
      
    

    with that, I tested table with lines = 0, as well as 25 and it worked ok...

    Kind regards

    Branislav

  • How can I limit the number of rows in a text input field?

    I don't want to have it scrolling. For example If the field has four lines the user is writing the fourth lineand give such ENTER or continue type up to are no longer on this line, I don't want to create in the fifth line text field. Il a do?

    An approach here is to limit the number of lines, someone else might have a different approach... "tf" is the name of the instance of the textfield object.

    tf.addEventListener (Event.CHANGE, checkNumLines);

    function checkNumLines(evt:Event):void {}
    If (TF.numLines > 4) {/ / deletion of the last typed character}
    TF. Text = String (tf.text).slice(0,tf.length-1);
    }
    }

  • Display the number of row in DataGrid

    Hello

    Is there an easy way to display a line number (in the first column) in DataGrid or AdvancedDataGrid?

    I am trying to imitate the kind of Excel functionality in the DataGrid,

    both need to Open/Load and Save to file.

    I do not understand that it is not hard to do,

    but do not want to load and save these line numbers in file.

    Is there a simple standard solution for that?

    The code examples?

    TIA,

    Oleg.

    No real tricks to labelfunction.  But you can't just press a column. You have

    to change the table and reassign the columns property.

  • How to display the number of lines of time giving the values of the columns?

    Hi all

    I want to display the number of rows times the value exists in the column num in the query below


    with t AS
       ( SELECT 'venkatesh' NAME, 'hyd' LOC, 2 NUM FROM DUAL
         UNION ALL
         SELECT 'prasad' NAME, 'hyd' LOC, 3 NUM FROM DUAL
         UNION ALL
         SELECT 'krishna' NAME,     'hyd' LOC, 1 NUM FROM DUAL )
      SELECT T.* FROM T
      CONNECT BY ROWNUM <= NUM
    
    
    Expected output:
    
             venkatesh            hyd      2
             venkatesh            hyd        2
             prasad                 hyd        3
             prasad                   hyd      3
             prasad                   hyd      3
             krishna           hyd       1
    Published by: Nag Aswadhati on November 1, 2012 12:34

    Aswadhati NAG wrote:
    Hi all

    I want to display the number of rows times the value exists in the column num in the query below

    Expected output:
    
    venkatesh            hyd      2
    venkatesh            hyd        2
    prasad                 hyd        3
    prasad                   hyd      3
    prasad                   hyd      3
    krishna           hyd       1
    

    With the help of connection by: -.

    with t AS
       ( SELECT 'venkatesh' NAME, 'hyd' LOC, 2 NUM FROM DUAL
         UNION ALL
         SELECT 'prasad' NAME, 'hyd' LOC, 3 NUM FROM DUAL
         UNION ALL
         select 'krishna' name,     'hyd' loc, 1 num from dual )
      select t.name, t.loc
      from t
      connect by level <= num
             and name = prior name
             and (prior sys_guid() is not null);
    
    NAME      LOC
    --------- ---
    krishna   hyd
    prasad    hyd
    prasad    hyd
    prasad    hyd
    venkatesh hyd
    venkatesh hyd 
    
     6 rows selected
    
  • Add the number of rows in the table on the Page Framework OA

    Hi all

    I need to add a line at the bottom of a table in the OA framework to display the number of lines for the underlying table VO. Can someone point me in the right direction to get there?

    Thanks in advance!

    Kristopher

    Hi Kristopher,

    As directed by your post, my understanding is that you want to have a line at the bottom of the table that contains a field that displays the number of rows found in the t... RT?

    You can implement the same in the following way,
    You can add a footer to your table and add a messageStyledText point in it. At this point, you can assign the value of VO.getFetchedRowCount ().

    Hope this is what you are looking for.

    Kind regards
    REDA Papdeja

  • Determine the number of rows returned by a cursor

    I have a problem when I need to use slightly different logic based on whether or not a cursor returns a single line or multiple lines. I know you can use % ROWCOUNT to determine the number of rows returned far+, but it's not really help me because I need to know this information before I start to do any treatment.


    In other words. How can I know the number of rows returned by a cursor without actually iterate through the entire thing.

    I'm looking for something like this:
       Cursor ReqCursor(pi_cert_id IN Varchar2) Is
          SELECT course_id cid, grade g
            FROM requirements
           WHERE cert_id = pi_cert_id;
       c_ReqCursor ReqCursor%Rowtype;
    
    Open CertCursor(p_cert_num);
        Loop
            Fetch CertCursor
              INTO c_CertCursor;
            Exit When CertCursor%Notfound;
            
            If c_CertCursor%NumOfRows > 1 THEN
                Case A;
            Else
                Case B;
            End If 
       End Loop
    Close CertCursor;

    For your business add

     SELECT course_id cid, grade g, count(*) over() Tot_Rows
            FROM requirements
           WHERE cert_id = pi_cert_id;
    --"Fetch 1st row and you will know if the cursor has more than 1 row"
    

    HTH
    SS

  • How to check the number of lines inserted since the week last in the table

    Hello

    Oracle version: 11g

    OS: Linux

    We need to know the number of rows inserted for a table of 7 days, please can anyone suggest is all views to find that answer

    BR

    PMP

    The function dbms_stats.diff_table_stats_in_history should give you what you need, assuming you analyze the table regularly.

  • Text box layout problem - and the number of rows displayed

    Hello

    Wonder if you can help with my 2 problems

    1. when I create text boxes, the label is displayed to the left of the text box. How can I display label above the text box
    CGH

    Label
    TextBox

    Instead of

    Text box label

    2. when I ask report showing my data, that it shows that 15 records per page, for the next set of records, I need to click on the following icon at the bottom of the table to go to the next page.
    How can I view all on the same page?

    Thanks for help

    1. simply check this using the Horizontal / Vertical alignment of attribute in the section of the label of the element of the Page definition.

    2. in the report of the attributes, the value of the plan of paging None; and the number of rows and number of maximum lines to more than the number of rows that will be returned by the report query.

    (You should only ignore this last you really know that the number of lines make this a reasonable option.) Nobody is going to want to scroll through thousands of lines or wait 5 minutes for total information overload. You wouldn't be popular with your admins/ISP network due to the excessive bandwidth consumed either.)

  • How to display the number of socket in the ListBox UI control?

    I want to display the number of socket in the Listbox control on execution. I use DisplayExpression method, set the entry as '% TestSocketIndex', but it does not work. This methond works fine if I connect the Combobox of UI control to ExecutionViewMgr.ConnectExecutionList.

    Is there a solution

    Hey wellsc,

    I have looked at this issue and ran into the same issue you described. I dropped the CAR 482840 for a developer study the matter further. Unfortunately, workarounds only I can think immediately would be to use a ComboBox control or to implement the functionality desired by using a native LabVIEW ListBox.

    Let us know if there is something we can do to help, or if you have other questions about how to implement one of the workarounds. You can still use this CAR number to check the status of the issue, as well.

  • How to limit the number of rows returned in a query

    Hi friends,
    I want to limit the number of rows returned by my request to some 10 lines. How to do this. When I try to make some 6 rows with the rownum < 10 its giving results for a particular Department and that too only... btw I'm bundling my table and includes much a table joins and will order the results of the table by a column... How to do this...

    Run it:

    select * from (your query goes here) where rownum < 10
    

    Nicolas.

  • How to write a function to estimate the number of rows returned SQL?

    How to write a function to estimate the number of rows returned SQL through SQL Execution Plan?
    My idea is
    Call dbms_sql.parse to create the SQL PLAN, then ask the PLAN for the number of estimated return lines.
    But how to get SQL plan through "id cursor?
    Thank you.

    You can use EXECUTE IMMEDIATE to explain plan statement. About the STATEMENT_ID generation, it could be anything. Even a SYSTIMESTAMP cast as TANK would work.

  • How to determine the number of rows in the database and save the result to a local variable?

    Hello

    I'm a newbie in the use of TestStand, databases and SQL, and now I've met difficulties. I use TestStand 2014 (32 bit).

    I have a need to know the number of rows in a database and save that number in a local variable. I tried to practice using the database of the Types of step provided with TS. I tried to use the following in a SQL statement:

    Locals.NumberOfRows = ("SELECT COUNT (*) FROM TEST_TABLE")

    It returns an error: specified value is not the expected type. My goal is possible in this way, or I'm doing this completely wrong?

    -RautSa

    Thank you for your response, Norbert. I have a database of who wins new values at random, and sometimes I need the exact number of rows in this table.

    I managed to achieve my goal by using the SQL statement: "SELECT COUNT (*) as Rowcount OF TEST_TABLE", followed by a data GET operation, which records that number of lines in a local variable.

    -RautSa

Maybe you are looking for