Kei*_*A45 3 .net c# stored-procedures oracle10g ora-06550
所以我试图从我的C#.NET应用程序调用Oracle存储过程.我可以找到的大多数在线参考建议"使用System.Data.OracleClient;",但.Net 3.5无法识别该命名空间,因此我使用的是"Oracle.DataAccess.Client".
下面是我的代码的一些解释,以前设置和测试的OracleConnection称为'myConn'已经填充了参数':arg_myArg'(如果重要的话,这是一个数字):
command.Connection = myConn;
command.CommandType = CommandType.StoredProcedure;
command.CommandText = "exec mySchema.myProc(:arg_myArg)"
command.ExecuteNonQuery();
Run Code Online (Sandbox Code Playgroud)
诀窍在于程序没有按设计返回,它只是填充了我从中拉出的不同表.但是,当我尝试运行上面的代码时,我在最后一行得到一个'OracleException'并给出了这个错误:
ORA-06550: line 1, column 13:
PLS-00103: Encountered the symbol "MYSCHEMA" when expecting one of the following:
:= . ( @ % ;
The symbol ":=" was substituted for "MYSCHEMA" to continue.
Run Code Online (Sandbox Code Playgroud)
从命令中删除"exec"会出现此错误:
ORA-06550: line 1, column 8:
PLS-00801: internal error [22503]
ORA-06550: line 1, column 8:
PL/SQL: Statement ignored
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?我很乐意澄清任何事情
这是我第一次在stackoverflow.com和我上周的这份工作上发帖,所以我很感激你的理解和相对急于搞清楚这一点
我想你需要这样的事情
command.Connection = myConn;
command.CommandType = CommandType.StoredProcedure;
command.CommandText = "mySchema.myProc"; // the proc name
command.Parameters.Add(/* TODO: Add parameter here */);
command.ExecuteNonQuery();
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
9703 次 |
| 最近记录: |