如何调用存储过程,有返回值的,有参数的,存储过程中调用存储过程
答案:2 悬赏:0 手机版
解决时间 2021-01-30 11:42
- 提问者网友:星軌
- 2021-01-30 01:27
如何调用存储过程,有返回值的,有参数的,存储过程中调用存储过程
最佳答案
- 五星知识达人网友:煞尾
- 2021-01-30 02:06
create procedure proc_a as declare b int; c varchar2(10); begin proc_b(b, c); dbms_output.put_line (c); end procedure a; 你照我这个写吧 proc_b(b, c); proc_b是你调用的带返回参数的存储过程 b是输入变量,c是输出变量
全部回答
- 1楼网友:归鹤鸣
- 2021-01-30 03:44
你这个是oracle的,sqlserver不是这样实现的。
返回值int 你要这样定义
alter procedure [dbo].[proc_res_get_check_result] (
@i_olt_ip varchar output
)
as
然后结果数据集直接在存储过程中
select * from
(
select ro.onu as onu,ro.olt_ip as olt_ip,ro.pon as pon,ro.onu_id as onuid,ro.check_time as check_time,ro.flag as flag,
ro.onu_name as res_name,ro.onu_sn as res_sn,po.onu_dev_name as ems_name,po.loid as ems_sn
from res_onu_data ro
left join pm_onu po on po.onu_name = ro.onu
where ro.olt_ip = @i_olt_ip
union
select re.onu as onu,re.olt_ip as olt_ip,re.pon as pon,re.onu_id as onuid,re.check_time as check_time,'20000000000000000000' as flag,
'' as res_name,'' as res_sn,po.onu_dev_name as ems_name,po.loid as ems_sn
from res_check_ems re,pm_onu po
where po.onu_name = re.onu and re.olt_ip = @i_olt_ip
)rr order by rr.onu;
就可以了
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯