I am using dotConnect driver for connecting to oracle database but i always get this error when i want to use parameters: ORA-00936: missing expression
CODE:
using (var cmd = conn.CreateCommand())
{
conn.Open();
cmd.CommandText = "SELECT stevilka_dokumenta from zmpt_dokumenti_po where status = @status"; ;
cmd.Parameters.Add("@status", OracleDbType.VarChar, "1");
using (var reader = cmd.ExecuteReader())
{
while (reader.Read())
{
string stevilkaDokumenta = reader.GetString("stevilka_dokumenta");
}
}
Error is here:
using (var reader = cmd.ExecuteReader())
why i get ORA-00936: missing expression? How must i declare input parameters?
just try changing @status
to :status
.