Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the Oracle equivalent of SQL Server's SET NOCOUNT ON?

What is the Oracle equivalent of SQL Server's SET NOCOUNT ON?

From the SQL Server documentation:

SET NOCOUNT ON... Stops the message that shows the count of the number of rows affected by a Transact-SQL statement or stored procedure from being returned as part of the result set...

For stored procedures that contain several statements that do not return much actual data, or for procedures that contain Transact-SQL loops, setting SET NOCOUNT to ON can provide a significant performance boost, because network traffic is greatly reduced.

like image 328
Luke Girvin Avatar asked May 23 '12 13:05

Luke Girvin


People also ask

What is set Nocount on in Oracle?

SET NOCOUNT ON/OFF statement controls the behavior in SQL Server to show the number of affected rows in the T-SQL query. SET NOCOUNT OFF – By default, SQL Server shows the number of affected rows in the messages pane. SET NOCOUNT ON – We can specify this set statement at the beginning of the statement.

What is SQL set Nocount on?

SET NOCOUNT ON prevents the sending of DONEINPROC messages to the client for each statement in a stored procedure.

What is SQL Rowcount in Oracle?

%ROWCOUNT yields the number of rows affected by an INSERT, UPDATE, or DELETE statement, or returned by a SELECT INTO statement. %ROWCOUNT yields 0 if an INSERT, UPDATE, or DELETE statement affected no rows, or a SELECT INTO statement returned no rows.

Which of the given flags is are used to not show any message in getting the number of rows in a table in SQL Server database a Nomessage B Nocount?

When you use SET NOCOUNT ON, the message that indicates the number of rows that are affected by the T-SQL statement is not returned as part of the results.


2 Answers

There is no equivalent in Oracle when set nocount on is used inside a stored procedure, simply because it's not necessary to do (inside a procedure or function).

The only vaguely matching thing is set feedback off as mentioned by BigMike

like image 148
a_horse_with_no_name Avatar answered Nov 03 '22 00:11

a_horse_with_no_name


SET FEEDBACK OFF at SQL*plus prompt.

For official docs please refer to this

like image 25
BigMike Avatar answered Nov 03 '22 02:11

BigMike