Ja, BigQuery understøtter EXECUTE IMMEDIATE
kommando til at køre dynamisk forespørgsel.
DECLARE p_dataset_name STRING DEFAULT 'mydataset';
DECLARE p_table_name STRING DEFAULT 'demo';
DECLARE p_column_name STRING DEFAULT 'c1';
DECLARE p_data_type STRING DEFAULT 'string';
DECLARE sydt STRING;
DECLARE qry STRING;
SET sydt = CONCAT(EXTRACT(HOUR from CURRENT_TIMESTAMP()),'_',EXTRACT(MINUTE from CURRENT_TIMESTAMP()),'_',EXTRACT(SECOND from CURRENT_TIMESTAMP()));
SET qry = 'create table '||p_dataset_name||'.'||p_table_name||'_'||sydt||' ('||p_column_name||' '||p_data_type||')';
EXECUTE IMMEDIATE qry;