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?
只需尝试将@status
更改为:status
。
另外,对于仍然有问题的人,请确保最后不要包含分号...
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.