首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > oracle >

c# 怎么调用存储过程,并传值

2012-01-01 
c# 如何调用存储过程,并传值?我现在会写简单的存储过程,但是我不太会调用,每次都是把一长串当成sql语句使

c# 如何调用存储过程,并传值?
我现在会写简单的存储过程,但是我不太会调用,每次都是把一长串当成sql语句使用。导致代码太长了。
那怎么调用存储过程啊,而且还要传参数?

[解决办法]
1.创建
create or replace procedure PTest(pid in number,pout out number) as
begin
pout := pid + 1000;
end PTest;

2.调用

在sqlplus中执行:
set serverout on
declare
v_result number(5);
begin
PTest(123, v_result);
dbms_output.put_line('Result:' || v_result);
end;

热点排行