<commit_before>set serveroutput on 

CREATE OR REPLACE PROCEDURE proc_rowcount_toddog AS
  name varchar2(50);
  result varchar2(10);
  tag varchar2(50);
  cursor c_table is
    select TABLE_NAME, NUM_ROWS, OWNER
      from all_tables where OWNER = 'HR';
  errorinloop EXCEPTION;
  err_num NUMBER;
  err_msg VARCHAR2(100);
begin
  name := 'sample.rowcount';
  for t in c_table loop
    tag := 'table_name:' || t.table_name || ',schema:' || t.owner;
    result := f_gaugetoddog(name,t.num_rows,tag);
    IF result != 'done' THEN
      RAISE errorinloop;
   END IF;
  end loop;
EXCEPTION
  WHEN errorinloop THEN
    raise_application_error(-20101, 'error inside loop on samples/rowcount_job.sql');
  WHEN OTHERS THEN
    err_num := SQLCODE;
    err_msg := SUBSTR(SQLERRM, 1, 100);
    raise_application_error(err_num, err_msg);
END;
/
show err<commit_msg>Update rowcount_job.sql<commit_after>set serveroutput on 

CREATE OR REPLACE PROCEDURE proc_rowcount_toddog AS
  name varchar2(150);
  tag varchar2(150);
  result varchar2(10);
  cursor c_table is
    select TABLE_NAME, NUM_ROWS, OWNER
      from all_tables where OWNER = 'HR';
  errorinloop EXCEPTION;
  err_num NUMBER;
  err_msg VARCHAR2(100);
begin
  name := 'sample.rowcount';
  for t in c_table loop
    tag := 'table_name:' || t.table_name || ',schema:' || t.owner;
    result := f_gaugetoddog(name,t.num_rows,tag);
    IF result != 'done' THEN
      RAISE errorinloop;
   END IF;
  end loop;
EXCEPTION
  WHEN errorinloop THEN
    raise_application_error(-20101, 'error inside loop on samples/rowcount_job.sql');
  WHEN OTHERS THEN
    err_num := SQLCODE;
    err_msg := SUBSTR(SQLERRM, 1, 100);
    raise_application_error(err_num, err_msg);
END;
/
show err
{'fraction_non_alphanumeric': 0.10198135198135198, 'fraction_numerical': 0.026806526806526808, 'mean_word_length': 3.9197707736389686, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4705624', 'n_tokens_mistral': 671, 'n_tokens_neox': 614, 'n_words': 164}