5TH
SCENARIO: CAPTURING OUTPUT VALUE FROM A PROCEDURE
create procedure totalincome (@loc varchar(20),@total integer output)
asbegin
select @total=sum(sal) from emp_hist where eloc=@loc;
end;
SCENARIO:
MOVING FIXED LENGTH DATA INTO VARIABLE LENGTH
INPUT
FILE:
SCENARIO
: PROCEDURE TO CAPTURE OUTPUT VALUE AND TO RETURN A VALUE
BY PASSING AN INPUT VALUE
ALTER PROCEDURE NOV_PROC (@PARTYID VARCHAR(30),@NM VARCHAR(30) OUT)
AS
BEGIN
DECLARE @CNT INTEGER;
SELECT @NM=PARTYNAME FROM PARTY WHERE PARTYID=@PARTYID;
select @cnt=count(*) from party;
RETURN @CNT;
END;
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.