title: Calling Bigquery Stored Procedure from Google Data studio
body: <p>Any idea how to call bigquery stored proc from Google data studio? I've a recursive query requirement which I've accomplished using Bigquery procedure. However need to pass parameters to this procedure from datastudio report and get results for the same and display in Data studio report. I have tried calling the procedure from Custom Query in Data studio no luck. Datastudio throws error. I tried calling procedure from a function however it doesn't work. ANy idea? How do I do I call procedure from Google Data studio?</p>
  <p>Procedure that is written</p>
  <pre><code>DECLARE stop INT64 DEFAULT 30;
      DECLARE v_target string;
      DECLARE v_target_column_name string;
      DECLARE max_counter INT64;
      DECLARE min_counter INT64;
      DECLARE v_exists bool;
      SET v_target = 'v_target';
      SET v_target_column_name = 'v_target_col';
      create or replace table test.poc_sttm_resp as
      select ROW_NUMBER() OVER() as counter,'N' as flag,source,source_column_name,target,target_column_name from test.test_sttm where target = v_target and target_column_name = v_target_column_name;
      LOOP
      SET max_counter = (select max(counter) from test.poc_sttm_resp);
      SET min_counter = (select min(counter) from test.poc_sttm_resp where flag = 'N');
      SET v_exists = EXISTS(select s.source from test.test_sttm s inner join
        (select source,source_column_name from test.poc_sttm_resp where counter =  min_counter
        ) r
        on s.target = r.source and
        s.target_column_name = r.source_column_name);
        IF stop = 0  OR min_counter is null THEN
          LEAVE;
        END IF;
        IF v_exists then
        insert into test.poc_sttm_resp
        select ROW_NUMBER() OVER() + max_counter as counter,'N' as flag,s.source,s.source_column_name,target,target_column_name from test.test_sttm s inner join
        (select source,source_column_name from test.poc_sttm_resp where counter = (select min(counter) from test.poc_sttm_resp where flag = 'N')) r
        on s.target = r.source and
        s.target_column_name = r.source_column_name;
        END IF;
        update test.poc_sttm_resp set flag = 'Y' where counter = min_counter;
          SET stop = stop - 1;
      END LOOP;
  </code></pre>
  <p>I tried calling the procedure from Data Studio,
  <code>call functions.testproc();</code> which didn't work</p>