How do you efficiently use OracleCommand and Parameters to get data from an Oracle DB when you have a fixed length char colum and don`t know how big the column is?
Let`s assume we want to get an ID named IID which is a char (5 bytes) fixed.
OracleCommand myCommand1;
myCommand1.CommandText = "SELECT * FROM IDS WHERE IID = :IID";
myCommand1.Parameters.AddWithValue("IID", "1234");
Would NOT return an item but
myCommand1.Parameters.AddWithValue("IID", "1234 ");
Would because it matches the 5 bytes in the database
You could also specify the space
myCommand1.Parameters.Add("IID", OracleDbType.Char, 5).Value = "1234";
But in my case just pretend that the programmer does not always know the exact amount of the char size defined in the database (if it makes sense or not). I use devart but I think this is more of a general issue. How could you pass the "1234" parameter without padding?
Thanks in advance