我必须从SQL Server迁移到Oracle,我有这个SP
ALTER procedure ST_004_264_01_14292
@n1 decimal(4,2),
@n2 decimal(4,2),
@resultado decimal(4,2) output
as
select @resultado=(@n1+@n2)/2;
drop procedure ST_004_264_01_14292
declare @variable decimal(4,2)
execute ST_004_264_01_14292 5,6, @variable output
select @variable;
答案 0 :(得分:3)
假设我理解你的问题,那么答案是肯定的。 程序可能会自行丢弃。 (虽然我无法理解为什么有人想做这样的事情)
在sql server 2012上测试:
create procedure stp_test
(
@CountBefore int output,
@CountAfter int output
)
AS
begin
select @CountBefore = count(*)
from sys.procedures
where name = 'stp_test'
drop procedure stp_test
select @CountAfter = count(*)
from sys.procedures
where name = 'stp_test'
end
GO
declare @x int,
@y int
exec stp_test @x output, @y output
select @x as [count before], @y as [count after]
结果:
count before count after
------------ -----------
1 0