David N Murray wrote:

> Hi all,
>
> I'm having a heck of a time querying a large table.  What I'm trying to do
> is:
>
> #!/usr/bin/perl -w
> use DBI;
> use strict;
> $|++;
> my $dbh = DBI->connect("dbi:ADO:Provider=SQLOLEDB;Integrated Security=SSPI;Data 
> Source=(local);Initial Catalog=db;CommandTimeout=900");
> die "Connect failed: " . $DBI::errstr if !defined($dbh);
> my $sql = <<EOS;
> select top 30000 c.col1, c.col2, c.col3, d.col4
> from tabl1 c, tabl2 d
> where c.col4 = d.col4
> and c.col5 = 'N'
> and c.col6 = '0'
> EOS
>
> my $sh = $dbh->prepare($sql);
> $sh->{ado_conn}->SetProperty("CommandTimeout",900);
> $sh->execute; # HERE
> $sh->finish
> $dbh->disconnect;
>
> The line marked HERE always errors out with a "Timeout expired" error
> between 30 and 40 seconds after HERE is begun.

Does this

  my $dbh = ...
  $dbh->{ado_commandtimeout} = 0;
  my $sth = ...
  print $sth->{ado_comm}{CommandTimeout};

work?

BTW: I have the problem the other way around: MSDAORA doesn't timeout.


Steffen

Reply via email to