AXMIM
AXMIM

Reputation: 2472

Can datasource of a report by a big query procedure?

Can the datasource of a google datastudio report come from a bigquery procedure?
If so how?


So far, I've tried calling the procedure from a "Custom Query" like so :

CustomQueryCallProcedure

CREATE OR REPLACE PROCEDURE `EDL-DEMO.DatasetDemo.Test`(paramSample1 STRING, paramSample2 INT64)
BEGIN

  SELECT *
  FROM `EDL-DEMO.DatasetDemo.someView`;
  
END;

This attempt gave : Error ID: 7b7e7776


Another work around that might be possible would be to use temporary table, but at this point, I will probably step away from procedure instead.

Upvotes: 0

Views: 124

Answers (1)

shollyman
shollyman

Reputation: 4384

Another option is to use a scheduled query to invoke the procedure on a defined interval, and point the data studio report at the output table(s) generated by the procedure.

This may have been what you were alluding to with the temporary table comment. It's largely a question of the complexity of the procedure; in your example case you could avoid the procedure entirely and do a scheduled CREATE OR REPLACE TABLE ... AS SELECT ... query.

Upvotes: 1

Related Questions