title: Snowflake odbc connector Query Timeout
body: <p>I am trying to run my query through snowflake using odbc connector only for 30 sec....i.e if the query is taking more than 30 sec to execute it should stop and fail immediately.</p>
  <p>In the odbc connection, I am passing one parameter <em>query_timeout</em> to make this happen.
  Code of my odbc connection:</p>
  <pre><code>&lt;?php
  
  class SnowflakeConnection{
      private $server;
      private $user_name;
      private $password;
      private $port;
      private $schema;
      private $warehouse;
      private $database;
      private $connection;
      private $dsn;
  
  public function __construct($server,$port,$user,$password,$database,$schema,$warehouse){
      $this-&gt;server=$server;
      $this-&gt;port=$port;
      $this-&gt;user_name=$user;
      $this-&gt;password=$password;
      $this-&gt;database=$database;
      $this-&gt;schema=$schema;
      $this-&gt;warehouse=$warehouse;
  
      $this-&gt;dsn = &quot;Driver=SnowflakeDSIIDriver;Server=&quot; . $server;
      $this-&gt;dsn .= &quot;;Port=&quot; . $port;
      $this-&gt;dsn .= &quot;;Schema=&quot; . $schema;
      $this-&gt;dsn .= &quot;;Warehouse=&quot; . $warehouse;
      $this-&gt;dsn .= &quot;;Database=&quot; . $database;
      $this-&gt;dsn .= &quot;;query_timeout = 30&quot;;
  }
  </code></pre>
  <p>but instead of 30sec, my query is running for 45sec and then failing and giving me an error.
  Error msg:</p>
  <p><a href="https://i.stack.imgur.com/aD8ui.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aD8ui.png" alt="Error Message" /></a></p>
  <p>Basically, My query is running for elapsed time, not for the <em>query_timeout</em> value that I have passed in the parameter.</p>
  <p>Can anyone help me here in setting up the exact timeout time(like 30sec or 1 min) in odbc using code??</p>
  <p><strong>Note:</strong> I have also tried it by setting 45 as <em>query_timeout</em> value, but for 45 the query is running for 1 min 30 sec</p>