Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ORA-00936: missing expression when reading from database with dotConnect driver and oracle database

Tags:

c#

dotconnect

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?

like image 235
senzacionale Avatar asked Sep 06 '11 08:09

senzacionale


1 Answers

just try changing @status to :status.

like image 135
CD.. Avatar answered Sep 28 '22 12:09

CD..