BigQuery Execute Immediate with a variable

Answered

I have a questy that in a nutshell looks like following:

 

DECLARE variable STRING;

SET variable = (SELECT STRING_AGG(field) FROM table);

EXECUTE IMMEDIATE FORMAT("""SELECT * FROM (%t)""", variable);

 

But the only error I'm getting is the following:

 

The statement works fine in GCP

1 comment
Comment actions Permalink

Let's try this workaround: please go to File | Settings | Database | General and set 'for selection execute': 'exactly as one statement'. Then just select entire query and run it.

Also, we've created issue on our tracker, please follow and vote to get noticed when it's done.

0

Please sign in to leave a comment.