title: Snowflake procedure in SQL
body: <p>Hi Can anybody help me create a snowflake procedure in SQL for the below scenario</p>
  <p>Input:</p>
  <pre><code>select table_schema,table_name,table_type from information_schema.tables where table_schema = 'MYSCHEMA';
  </code></pre>
  <p>output: I need to insert this data along with ddl for each table_name using snowflake procedure
  example, my backup table will contain table_schema,table_name,table_type,ddl_stt</p>
  <pre><code>create or replace procedure proc_getddl
  is
  v_tableschema varchar(30);
  v_tablename varchar(30);
  v_tabletype varchar(30);
  v_getddl varchar(110);
  
  cursor getddl is 
  select table_schema,table_name,table_type,get_ddl('table','INVOICING')
  from information_schema.tables
  where table_schema = 'MYSCHEMA';
  begin
  open getddl;
  LOOP
  fetch getddl into v_tableschema,v_tablename,v_tabletype,v_getddl;
  EXIT WHEN getddl%NOTFOUND;
  INSERT INTO backup_table
  values (v_tableschema,v_tablename,v_tabletype,v_getddl);
  
  END LOOP;
  close getddl;
  end proc_getddl;
  </code></pre>
  <p>please help</p>
  <p>I tried something like this (but in oracle)I cant use this as get_ddl is not working for table_name unless specified</p>