oracle可以使用out型参数返回值,例如:
-- 查询某商品编号是否存在,返回查询状态create or replace procedure proc_getGood
(
param_shopId number,--商品编号
param_flag out number--查询状态 0不存在
)
as
declare v_count number(1)
begin
select count(*) into v_count from tb_goods where shopid=param_shopid
if v_count =0 then
param_flag:=0
else
param_flag:=1
end if
end
CREATE OR REPLACE PROCEDURE sap_po_test(idIN NUMBER,p_message OUT VARCHAR2) AS
mycount number(4) := 0
BEGIN
SELECT COUNT(*)
INTO mycount
FROM 表
WHERE id = p_id
IF mycount >0 THEN
p_message := 'S'
ELSE
p_message := 'E'
END IF
RETURN
END
( ⊙ o ⊙ )啊!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)