日期:2014-05-17  浏览次数:20940 次

如何将一些句子转换成存储过程
select a.b,c.d from a,b where a.b1 = c=d1 and a.b2 = c=d2 and a.b3 = 1 and a.b4 like '12345' ,我要用C#调用存储过程

------解决方案--------------------
SQL code

create or replace procedure <proc_name> (参数A out 类型,参数B out 类型)
is
begin
select a.b,c.d  into 参数A,参数B from a,b 
where a.b1 = c=d1 and a.b2 = c=d2 and a.b3 = 1 and a.b4 like '12345';
end;

------解决方案--------------------
SQL code

CREATE OR REPLACE PROCEDURE <proc_name>
(parameter_list)
IS
BEGIN
  select a.b,c.d from a,b where a.b1 = c=d1 and a.b2 = c=d2 and a.b3 = 1 and a.b4 like '12345';
  --这个是SQL语句得到一个结果集,要用到CURSOR去处理结果集,让C#程序调用
END;