I am using OracleCommand.Parameters in a select query for on an Oracle 11g database. The following statement works great on columns that are of type number or varchar.
string theQuery = "select * from TABLE where COLUMN = :p1";
OracleCommand Cmd = new OracleCommand(theQuery);
Cmd.Parameters.Add(new OracleParameter("p1", "2183989118"));
Cmd.Connection = Conn;
Cmd.CommandType = CommandType.Text;
The problem is that I really want to run the statement against a column of type CHAR(20 BYTE), and when I do this i never get a result. The query works if I am not using parameters and just adding '2183989118' in theQuery directly.
Am i missing something in my Parameters.Add statement?