Out Parameters in SQL server/Oracle
Can we write multiple out parameters in SQL server/Oracle, if yes please write one example..
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Hemant SrivastavaPosted Jul 28, 2014, 2:30 PM
Yes we can write
A simple example:
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE dbo.MultipleOutputParameters
(
@P_Id INT,
@LastName VARCHAR(50) OUTPUT,
@FirstName VARCHAR(50) OUTPUT,
@City VARCHAR(50) OUTPUT
)
AS
BEGIN
SELECT @LastName = LastName,
@FirstName = FirstName,
@City = City
FROM dbo.ADDRESS
WHERE P_Id = @P_Id
END
GO