日期:2014-05-17 浏览次数:21768 次
set serveroutput on format wrapped
create or replace procedure te
(id_ in test.id%type,
name_ out varchar2)
as
begin
select name into name_ from test where id=id_;
end;
/
OracleParameter p1 = new OracleParameter("id_", OracleType.Int32);
p1.Direction = ParameterDirection.Input;
// p1.OracleType = OracleType.Int32;
p1.Value = Convert.ToInt32(3);
cmd.Parameters.Add(p1);
OracleParameter p2 = new OracleParameter("name_", OracleType.VarChar);
p2.Direction = ParameterDirection.Output;
p2.Value = "w";
cmd.Parameters.Add(p2);
cmd.ExecuteNonQuery();
Label1.Text = cmd.Parameters[1].ToString();