how to get @@error and @@rowcount at the same time? : Sql dba



how to get @@error and @@rowcount at the same time? : Sql dba..

Answer / Prashant Mishra

To get both @@ERROR and @@ROWCOUNT at the same time, you can use a SELECT statement with the GET DIAGNOSTICS statement. For example: `SELECT @rc := @@ROWCOUNT, @err := @@ERROR FROM dual;`

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL PLSQL Interview Questions

What is difference between db2 and sql?

1 Answers  


What is column?

1 Answers  


How we get all_group_function's(Sum,avg,count,max and min_value of a column(Sal) Using pl/sql anonymous block, with out using group function's. You shouldn't use more than one select statement in entire the program. Like cursor c is select * from <table_name>; except this you can't use another select statement. You can use no of variables as per requirement.

1 Answers  


Table Student has 3 columns,Student_id,Student_Name & Course_Id. Table Course has 2 columns, Course_Id & Course_Name.Write a query to listdown all the Courses and number of student in each course.

10 Answers   TCS,


What is procedure explain with example?

1 Answers  


What is a behavioral trigger?

1 Answers  


define sql delete statement ? : Sql dba

1 Answers  


What is the difference between alter trigger and drop trigger statements?

1 Answers  


what is log shipping? : Sql dba

1 Answers  


how a reference cursor works?what all adnvantages are gained with it..specify the situation?

4 Answers   TCS,


What is the maximum database size for sql express?

1 Answers  


What is sequence in sql?

1 Answers  


Categories