AS400 を実行している IBM iSeries に対してストアド プロシージャを実行しようとすると、タイトルに上記のエラーが表示されます。
System iNavigator ツールからストアド プロシージャを実行するために次のように入力すると、問題なく実行されます。
CALL QS36F.HH189P('1','1','')
最初のパラメーター方向はストアド プロシージャで入力として定義され、2 番目のパラメーターは出力として定義され、3 番目は出力として定義されます。
問題は、パラメータを設定する .Net コードからストアド プロシージャを実行しようとしたときです。誰か助けてくれませんか?
私のパラメータリストは次のように設定されています:
DB2Command.Parameters.Add("P_STRRRN", iDB2DbType.iDB2Char, 10);
DB2Command.Parameters["P_STRRRN"].Direction = System.Data.ParameterDirection.Input;
DB2Command.Parameters["P_STRRRN"].Value = strRRN;
DB2Command.Parameters.Add("P_LSTRRN", iDB2DbType.iDB2Char, 10);
DB2Command.Parameters["P_LSTRRN"].Value = string.Empty;
DB2Command.Parameters["P_LSTRRN"].Direction = System.Data.ParameterDirection.Output;
DB2Command.Parameters.Add("P_ERRMSG", iDB2DbType.iDB2Char, 70);
DB2Command.Parameters["P_ERRMSG"].Value = string.Empty;
DB2Command.Parameters["P_ERRMSG"].Direction = System.Data.ParameterDirection.Output;
解像度
コマンドテキストを次のように宣言する必要がありました。
string cmdtextstring = "CALL QS36F.HH189P" + "('" + strRRN + "',?,?)";
パラメータを次のように設定する必要がありました。
DB2Command.Parameters.Add("P_LSTRRN", iDB2DbType.iDB2Char, 10);
DB2Command.Parameters["P_LSTRRN"].Value = string.Empty;
DB2Command.Parameters["P_LSTRRN"].Direction = System.Data.ParameterDirection.Output;
DB2Command.Parameters.Add("P_ERRMSG", iDB2DbType.iDB2Char, 70);
DB2Command.Parameters["P_ERRMSG"].Value = string.Empty;