title: GCP BigQuery message "Not found: Connection" when I use a connection in scripting
body: <p>I am using GCP bigquery. I have an external connection &quot;myconnectionid&quot; defined. This connection is of connection type  &quot;Cloud SQL - MySQL&quot; and it works fine for a running fedarated query from bigquery to the cloudsql mysql instance such as below.</p>
  <pre><code>SELECT * FROM 
  EXTERNAL_QUERY(&quot;myconnectionid&quot;,&quot;SELECT CURDATE() from Dual;&quot;)
  </code></pre>
  <p>However when I attempt to declare a SQL variable and assign the return value from federated query to that variable ( I suppose that amounts to bigquery scripting) I get a message &quot;Not found: Connection myconnectionid&quot;.
  Please see example of error causing snippet of code below</p>
  <pre><code>DECLARE MYDATE DATE;
  SET MYDATE = (SELECT * FROM 
  EXTERNAL_QUERY(&quot;myconnectionid&quot;,&quot;SELECT CURDATE() from Dual;&quot;))
  </code></pre>
  <p>This snippet gives me an error <strong>&quot;Not found: Connection myconnectionid at [2:14]&quot;</strong></p>
  <p>Do gcp bigquery external connections need a special handling in scripting ?
  Or more simply ; do you know how I could overcome this error ?</p>
  <p>I am reading through google documentation on connections <a href="https://cloud.google.com/bigquery/docs/working-with-connections#federated_query_syntax" rel="nofollow noreferrer">https://cloud.google.com/bigquery/docs/working-with-connections#federated_query_syntax</a>
  and also the google documentation on big-query scripting
  <a href="https://cloud.google.com/bigquery/docs/reference/standard-sql/scripting" rel="nofollow noreferrer">https://cloud.google.com/bigquery/docs/reference/standard-sql/scripting</a>
  No luck yet.</p>
  <p>Your help much appreciated</p>
  <p>Thanks !!</p>