各位大俠
如下2個oracle 過程
 我在vs2005中怎么調用那?
CREATE OR REPLACE   procedure pro_ins_session
    (v_user_id   in varchar2,
     v_user_name in varchar2,
     v_prog_id   in varchar2) is
  begin
    insert into pub006t0
      select sys_context('userenv','sessionid'),
             v_user_id,
             v_user_name,
             sys_context('USERENV','IP_ADDRESS'),
             sys_context('USERENV','TERMINAL'),
             v_prog_id,
             sysdate
        from dual;
    commit;
  end ;
  CREATE OR REPLACE procedure pro_del_session is
  begin
    delete pub006t0
      where session_id=sys_context('userenv','sessionid');
    commit;
  end ; 謝謝各位大俠!

解决方案 »

  1.   

    DbCommand dbcmd = db.GetStoredProcCommand("");
    OracleParameter[] param = new OracleParameter[] {....};
    然后给参数值param[0].Value = “”;...
    然后param[0].Direction = ParameterDirection.Input;...
    然后cmd.Parameters.Add();
    然后就可以执行了基本上就这样吧
      

  2.   

     public static int OracleRunProcedure(string storedProcName, IDataParameter[] parameters)
            {             using (System.Data.IDbConnection iConn = GetConnection())
                {
                    using (System.Data.IDbCommand iCmd = GetCommand("", iConn))
                    {
                        iConn.Open();
                        try
                        {                        iCmd.CommandText = storedProcName;//声明存储过程名
                            iCmd.CommandType = CommandType.StoredProcedure;
                            
                            if (parameters != null)
                            {
                                foreach (IDataParameter parameter in parameters)
                                {
                                    iCmd.Parameters.Add(parameter);
                                }
                                
                            }
                            int rows = iCmd.ExecuteNonQuery();
                            return rows;
                        }
                        catch (System.Exception E)
                        {
                            //throw new Exception(E.Message);
                            return 0;
                        }
                        finally
                        {
                            if (iConn.State != ConnectionState.Closed)
                            {
                                iConn.Close();
                            }
                            
                        }
                    }
                }
                  
             }
      

  3.   

    http://topic.csdn.net/u/20100617/22/e12d1d95-e506-442a-9723-d093b2613b19.html