|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
ORA-00932: inconsistent datatypes
hi, i hope that some can help me. i have an application on c#.net with ODP.NET (oracle data provider for .NET) but i get the following exception:
Oracle.DataAccess.Client.OracleException: ORA-00932: inconsistent datatypes Line 83: cmd.ExecuteNonQuery(); the code of my application: ... 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; //Oracle.DataAccess.Types.OracleString vGebiet = new Oracle.DataAccess.Types.OracleString(TextBox2.Text); //vGebiet = TextBox2.Text; 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(); } 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) ); i hope that somebody can help. thanks |
|
#2
|
|||
|
|||
|
I don't know about the ADO.NET, but as long as your concern with Oracle, this error message occured when you try to pass a wrong data type value into a wrong data type that is not implicitly convertable, for example if you try to pass any numeric value into a character, an automatic conversion is applied and you get no error, but if you try to enter character value into a numeric field or numeric/character value into date, implicit conversion does not apply and you get error message.
|
|
#3
|
|||
|
|||
|
yes, i think im giving to a varchar2 a string and i think that's ok? isn't it?
|
|
#4
|
|||
|
|||
|
Describe ARTIKEL
The datatype for GEBIET must be VARCHAR2. It may not be. You hit error this most often on fields with the LONG datatype. One other obscure cause: you are trying to access a system table that normally is not accesible - usually because of a misspelling |
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > ORA-00932: inconsistent datatypes |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|