本文介绍了从C#.net调用oracle SP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在oracle程序包中,我有3个存储过程,并且存储过程调用dbmon_dbinfo具有3个PL/SQL块,用于Insert(INS)更新和删除,我从以下代码中调用"INS":

In oracle package I am having 3 Stored procedures and the Stored procedures call dbmon_dbinfo is having 3 PL/SQL blocks for Insert(INS) Update and Delete I am calling ''INS'' from following code:

DateTime dt = DateTime.Now;
            OracleCommand objCommand = new OracleCommand();
            connection.Open();
            objCommand.Connection = connection;
            objCommand.CommandText = "PKG_DBMON_MASTER.dbmon_dbinfo(INS)";
            objCommand.CommandType = CommandType.StoredProcedure;
         //   objCommand.Parameters.Add("p_made", OracleType.VarChar).Value = "INS";
          //  objCommand.Parameters.Add("p_db_id", OracleType.VarChar).Value = 001;
            objCommand.Parameters.Add("name",OracleType.VarChar).Value = txtName.Text;
            objCommand.Parameters.Add("owner_name", OracleType.VarChar).Value = txtOwnerName.Text;
            objCommand.Parameters.Add("owner_email", OracleType.VarChar).Value = txtOwnerMail.Text;
            objCommand.Parameters.Add("project", OracleType.VarChar).Value = txtProject.Text;
            objCommand.Parameters.Add("created_date", OracleType.DateTime).Value = dtpCreatedDate.Text;
         //   objCommand.Parameters.Add("p_droped_date", OracleType.DateTime).Value =null;
            objCommand.Parameters.Add("sys_passwd", OracleType.VarChar).Value = "password";
            objCommand.Parameters.Add("system_passwd", OracleType.VarChar).Value = "password";
            objCommand.Parameters.Add("status",OracleType.VarChar).Value = txtStatus.Text;
            objCommand.Parameters.Add("srv_id", OracleType.Number).Value = decimal.Parse(txtServerID.Text);
            objCommand.Parameters.Add("dbms_id",OracleType.Number).Value =decimal.Parse(txtDBMSID.Text);
            objCommand.Parameters.Add("db_type", OracleType.VarChar).Value = txtStatus.Text;            
            objCommand.ExecuteNonQuery();



但它给出了以下异常



but it gives following exception

ORA-06550: line 1, column 7:
PLS-00801: internal error [22503]
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored


为什么?请帮忙.


Why is that ?? please help.

推荐答案


这篇关于从C#.net调用oracle SP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-21 00:49