Problem with Oracle Parameter - not getting whole value of parameter

db , oracle Hāora, India
  • 9 years ago

    Hello, I have come accros this problem, altough I have been using this code before

    I have an oracle command with 1 parameter

    string cmd = " Select value from Database where id = :p1";

     OracleCommand command1 = new OracleCommand ( cmd, connection); OracleParameter p1= new OracleParameter ( "p1", OracleType.Varchar, 8);

     p1.Direction = ParameterDirection.InputOutput; OracleDataReader rdr = null;

    try { connection.Open();

     command.Parameters.Clear();

     command.Parameters.Add(p1);

     p1.Value = id_1;

    command.ExecuteNonQuery();

     rdr = command .ExecuteReader();

     ......

     

    the problem I get is in this line p1.Value=id_1;

    id_1 is a string of max 8 characters,

    and in p1.Value I get just the 1character

     any idea why?

     thanks Probi

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.” - Antoine de Saint Exupéry