cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SACommand & SQL load table

Former Member
0 Likes
4,240

I have an .NET 3.5 Application and I use SACommand with an SQL "load table" statement to load data from a asciifile to a table of an SQl Anywhere 12 database. If I have only a few datasets it run's perfect but if I have some more (< 10.000) datasets I got a timeout.

code example:

string Query = "load Table P_Texte from 'C:\\kakomdb.server\\communic \\P_Texte.txt'";

try
{
SACommand cmd = Sybase12Con.CreateCommand();
cmd.CommandText = Query;
cmd.CommandTimeout = 1200;
cmd.ExecuteNonQuery();
}

If I use "load table" and the same big asciifile directly with Interactive SQL it run's fast and perfect too.

I use a network database connection for both cases.

Any advice to solve this problem?

Accepted Solutions (0)

Answers (1)

Answers (1)

VolkerBarth
Contributor
0 Likes

(Note: I do not use SACommand with .NET so I have not tested this.)

According to the docs, the CommandTimeout property is not supported by the SQL Anywhere .NET Data Provider.

As to the docs, to set a request timeout (here for 30 seconds), use the following example.

cmd.CommandText = "SET OPTION request_timeout = 30";
cmd.ExecuteNonQuery();
MCMartin
Participant
0 Likes

funny in 11.0.1 it is not said to be non implemented.

ian_mchardy
Product and Topic Expert
Product and Topic Expert

You probably want to only set request_timeout for the current connection:

SET TEMPORARY OPTION request_timeout = 30

so that the option is not set for all connections with the same user.

VolkerBarth
Contributor
0 Likes

BTW, isn't 0 the default value - i.e. no timeout at all? Or does ADO.Net have a different default value?