Skip to Main Content

ODP.NET

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

executeScalar is extremly slow (800s) vs SQLdev(15ms)

2365b68c-5487-4426-9338-6825dc2dbfa7Aug 18 2015 — edited Aug 25 2015

My problem is that my application in C# is extremely slow.

It search a single compagny number with parameters.

When i take the request in SQLdeveloper i had the result in 0.015 second

The same request with this code takes ~800 seconds:

            using (var connection = new OracleConnection(MyConnectionString))

            {

                connection.Open();

                var command = connection.CreateCommand();

                command.CommandText = getCompanyNumberSQL;

                command.Parameters.Add(":identifierName", OracleDbType.NVarchar2, identifierName, ParameterDirection.Input);

                command.Parameters.Add(":identifierValue", OracleDbType.NVarchar2, identifierValue, ParameterDirection.Input);

                command.Prepare();

                var r = command.ExecuteScalar(); //~800seconds

                result = r == null ? string.Empty : Convert.ToString(r);

                connection.Close();

            }

This post has been answered by 2365b68c-5487-4426-9338-6825dc2dbfa7 on Aug 19 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 22 2015
Added on Aug 18 2015
3 comments
1,169 views