我正在尝试导入文件,但是它给了我异常:ORA-20001:无效的操作.在调用存储过程时,我该如何解决. [英] I am trying to import a file but it gives me exception : ORA-20001: Invalid Operation. while calling a stored procedure, how can i solve this.

查看:335
本文介绍了我正在尝试导入文件,但是它给了我异常:ORA-20001:无效的操作.在调用存储过程时,我该如何解决.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试导入文件,但是在调用过程时出现异常ORA-20001:无效的操作.

存储过程:

I am trying to import a file , but while calling the procedure i get an exception ORA-20001: Invalid Operation.

Stored Procedure:

begin
  -- Call the procedure
  imp_pkg.isinmstimp(cpath => :cpath,
                     cfilename => :cfilename,
                     cusername => :cusername,
                     ndp_list_id => :ndp_list_id);
end;





if (imp_module == "m_importisin")
           {
               //Call Procedure
               s_dsnstr = o_Cls_Utility.utl_fnGetDSNStr(SessionCheck.s_sessiondpid);
               OracleConnect o_Cls_OracleConnect = new OracleConnect(s_dsnstr);
               o_Cls_OracleConnect.CallStoredProcedure_PreInit();
               o_Cls_OracleConnect.CallStoredProcedure_Varchar2_AddParameters("cpath", parameter2);
               o_Cls_OracleConnect.CallStoredProcedure_Varchar2_AddParameters("cfilename", parameter3);
               o_Cls_OracleConnect.CallStoredProcedure_Varchar2_AddParameters("cusername", parameter4);
               o_Cls_OracleConnect.CallStoredProcedure_Double_AddParameters("ndp_list_id", 1);
               int recordsInserted = o_Cls_OracleConnect.CallStoredProcedure("IMP_PKG.ISINMSTIMP");


               o_Cls_OracleConnect.Dispose();
           }



在下面的行中,我得到了异常:



on below line i get the exception :

int recordsInserted = o_Cls_OracleConnect.CallStoredProcedure("IMP_PKG.ISINMSTIMP");



我有另一个可以正确执行的代码,但是为存储过程提供了例外:对于列"CDSIL_MIGR"."ADDRESS"."ZIP"(实际值:11,最大值:10),值太大.Row-no1



I have another code which exceutes correctly, but gives exception for Store Procedure : value too large for column "CDSIL_MIGR"."ADDRESS"."ZIP" (actual: 11, maximum: 10)Row-no1

if (imp_module == "m_impbankmaster")
          {
              //Call Procedure
              try
              {
                  parameter2 = "d:\\imports";
                  parameter3 = "CD100621U.002";
                  parameter4 = "611";

                  s_dsnstr = o_Cls_Utility.utl_fnGetDSNStr(SessionCheck.s_sessiondpid);
                  OracleConnect o_Cls_OracleConnect = new OracleConnect(s_dsnstr);
                  o_Cls_OracleConnect.CallStoredProcedure_PreInit();
                  o_Cls_OracleConnect.CallStoredProcedure_Varchar2_AddParameters("cpath", parameter2);
                  o_Cls_OracleConnect.CallStoredProcedure_Varchar2_AddParameters("cfilename", parameter3);
                  o_Cls_OracleConnect.CallStoredProcedure_Varchar2_AddParameters("cusername", parameter4);
                  o_Cls_OracleConnect.CallStoredProcedure_Double_AddParameters("ndp_list_id", 1);
                  int recordsInserted = o_Cls_OracleConnect.CallStoredProcedure("IMP_PKG.BANKMSTIMP");
                  o_Cls_OracleConnect.Dispose();
              }
              catch (Exception ex)
              {
                  throw ex;
              }
          }

推荐答案

ORA-20001在用户定义的异常范围内,因此您需要访问存储过程才能调试此错误.
但是就像您上一个问题一样,缺少参数,因此请检查您的parameterarray.
ORA-20001 is within the user defined exceptions range, so you need to get access to the Stored Procedure to debug this error.
But just like as in you previous question there is a missing parameter, so check your parameterarray.


这篇关于我正在尝试导入文件,但是它给了我异常:ORA-20001:无效的操作.在调用存储过程时,我该如何解决.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆