hi, i don't have this problem, but i get the same error for the following code. it's on c#. NET with ODP.NET (oracle data provider for .NET).
my oracle table is :
create table artikel (
benname varchar2(15),
gebiet varchar2(30),
datum date,
text clob not null,
gelesen number,
primary key (benname,datum) );
using Oracle.DataAccess.Client;
using Oracle.DataAccess.Types;
...
private void Button1_Click(object sender, System.EventArgs e)
{
DateTime datum = new DateTime();
datum = DateTime.Now;
string ConStr = "User Id=user1;Password=bllablla;Data Source=localhost";
OracleConnection con = new OracleConnection(ConStr);
con.Open();
OracleCommand cmd = con.CreateCommand();
cmd.CommandText = "insert into artikel(benname, gebiet, datum,text,gelesen) values('ruki', :pGebiet, :pDate, :pText, 0 )";
cmd.CommandType = CommandType.Text;
OracleParameter prm = new OracleParameter("pDate",OracleDbType.Date);
OracleParameter prm1 = new OracleParameter("pText",OracleDbType.Clob);
OracleParameter prm2 = new OracleParameter("pGebiet",OracleDbType.Varchar2);
prm.Direction = ParameterDirection.Input;
prm1.Direction = ParameterDirection.Input;
prm2.Direction = ParameterDirection.Input;
prm.Value = datum; // it works
prm1.Value = TextBox1.Text; // it works
prm2.Value = TextBox2.Text; // it doesn't work
cmd.Parameters.Add(prm);
cmd.Parameters.Add(prm1);
cmd.Parameters.Add(prm2);
cmd.ExecuteNonQuery();
}
...
it show's the following exception:
ORA-00932: inconsistent datatypes
Oracle.DataAccess.Client.OracleException:
ORA-00932:inconsistent datatypes
Line 81: cmd.Parameters.Add(prm2);
Line 82:
Line 83: cmd.ExecuteNonQuery(); // red (it shows that the problem occures here, but when i remove the parameter prm2, it works)
i hope that someone can help me.
THANKS