Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Does PL/SQL have a RowCount 1

Status
Not open for further replies.

SLAbel

Programmer
Apr 30, 2001
21
0
0
US
Hello,

Using SQL Server, I could get the number of rows effected by a delete statement by using @@RowCount. I have looked through my books but as I am not sure what the value/function would be called, my search has come up empty. Any help you could provide would be nice.

Thanks
scott
 
Would I use it like this to return the number of rows deleted? Forgive me, I am not at work now and cant test it.
Code:
Procedure MyDelete(strValue IN  VarChar2,
                   intRows  OUT Number)
Is
Begin

    Delete
    From   MyTable
    Where  MyColumn = strValue;

    Select sql%rowcount
    Into   intRows
    From Dual;

End MyDelete;

thanks
scott
 
Hello,

Just for all of you who want to kno for sure. I am at work and I have tested it and the above way is not correct. You DO use sql%rowcount BUT you use it like this:

Code:
Procedure MyDelete(strValue IN  VarChar2,
                   intRows  OUT Number)
Is
      intRows     Number(11);
Begin

    Delete
    From   MyTable
    Where  MyColumn = strValue;

    intRows := sql%rowcount;

End MyDelete;

Hope that helps some others
scott |-0
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top