google-bigquery

BigQuery: Running Several Queries Sequentially in One Scheduled Query


I have recently realized that some individual queries placed in a single schedule do not execute sequentially. I was wondering how I can ensure that these queries run only after the previous query has completed.


Solution

  • You could write an array of queries, Iterate over that array and execute each one using EXECUTE IMMEDIATE command. Here's a sample.