Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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:
C#
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
VB
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.
Posted
Updated 16-Nov-10 23:33pm
v2

1 solution

I can see two potential issues - you'll need to work out which best fits. The first is that by default, the OracleParameter binds by position and not by name. To fix this, add objCommand.BindByName before you execute the command. The second issue could be that you haven't qualified your command name enough - potentially you might need to add the user name up front (without seeing how you are connecting, I can't comment any further), but this would give you the command text: username.PKG_DBMON_MASTER.dbmon_dbinfo(INS).

Ah hah - I've just spotted it while typing this in - you don't need to put a parameter value into your command text - change it to PKG_DBMON_MASTER.dbmon_dbinfo() instead, as you are specifying the parameters in your code. BTW - you should wrap your command in a using block to get it automatically disposed.
 
Share this answer
 
Comments
Kasunmit 17-Nov-10 22:01pm    
thank you very much for ur help pete ...
Kasunmit 17-Nov-10 23:43pm    
but still having that error :( pls help ..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900