Skip to content

Commit 7a62620

Browse files
committed
update tag on example
1 parent fe6fc4b commit 7a62620

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
tmp/
22
src/build/*
3+
libtoddog.so

samples/rowcount.sql

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,16 @@ declare
55
tag varchar2(50);
66
result varchar2(10);
77
cursor c_table is
8-
select TABLE_NAME, NUM_ROWS from all_tables where OWNER = 'HR';
8+
select TABLE_NAME, NUM_ROWS, OWNER
9+
from all_tables where OWNER = 'HR';
910
errorinloop EXCEPTION;
1011
err_num NUMBER;
1112
err_msg VARCHAR2(100);
1213
begin
1314
name := 'sample.rowcount';
1415
for t in c_table loop
15-
tag := concat('schema:hr,table_name:',t.table_name);
16+
tag := 'table_name:' || t.table_name || ',schema:' || t.owner;
17+
dbms_output.put_line(name || ':' || t.num_rows || ',' || tag);
1618
result := f_gaugetoddog(name,t.num_rows,tag);
1719
IF result != 'done' THEN
1820
RAISE errorinloop;

samples/rowcount_job.sql

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,37 +5,36 @@ CREATE OR REPLACE PROCEDURE proc_rowcount_toddog AS
55
result varchar2(10);
66
tag varchar2(50);
77
cursor c_table is
8-
select TABLE_NAME, NUM_ROWS from all_tables where OWNER = 'HR';
8+
select TABLE_NAME, NUM_ROWS, OWNER
9+
from all_tables where OWNER = 'HR';
910
errorinloop EXCEPTION;
1011
err_num NUMBER;
1112
err_msg VARCHAR2(100);
1213
begin
1314
name := 'sample.rowcount';
1415
for t in c_table loop
15-
tag := concat('schema:hr,table_name:',t.table_name);
16+
tag := 'table_name:' || t.table_name || ',schema:' || t.owner;
1617
result := f_gaugetoddog(name,t.num_rows,tag);
1718
IF result != 'done' THEN
1819
RAISE errorinloop;
1920
END IF;
2021
end loop;
2122
EXCEPTION
2223
WHEN errorinloop THEN
23-
raise_application_error(-20101, 'error inside loop on samples/rowcount.sql');
24+
raise_application_error(-20101, 'error inside loop on samples/rowcount_job.sql');
2425
WHEN OTHERS THEN
2526
err_num := SQLCODE;
2627
err_msg := SUBSTR(SQLERRM, 1, 100);
2728
raise_application_error(err_num, err_msg);
2829
END;
2930
/
30-
3131
show err
3232

3333
begin
3434
proc_rowcount_toddog;
3535
end;
3636
/
37-
38-
37+
show err
3938

4039
declare
4140
job_doesnt_exist EXCEPTION;
@@ -60,6 +59,7 @@ DBMS_SCHEDULER.create_job (
6059
comments => 'Job defined entirely by the CREATE JOB procedure.');
6160
END;
6261
/
62+
show err
6363

6464
prompt check if job enabled
6565
SELECT ENABLED as E FROM DBA_SCHEDULER_JOBS where JOB_NAME = UPPER('job_rowcount_toddog');

0 commit comments

Comments
 (0)