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();



     p1.Value = id_1;


     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).


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.

“God could create the world in six days because he didn't have to make it compatible with the previous version.”