mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-12-08 20:38:47 +00:00
update of old PL/SQL PLpgSQL and SQLPL patch based on current version
see [linguist] add support for oracle PLSQL (#1003)
This commit is contained in:
18
samples/SQLPL/runstats.sql
Normal file
18
samples/SQLPL/runstats.sql
Normal file
@@ -0,0 +1,18 @@
|
||||
create procedure runstats (out nr_tables integer, out nr_ok integer)
|
||||
begin
|
||||
declare SQLCODE integer;
|
||||
declare stmt varchar(100);
|
||||
|
||||
set nr_tables = 0;
|
||||
set nr_ok = 0;
|
||||
|
||||
for line as select tabschema, tabname from syscat.tables where type='T' and tabschema='SPODEN'
|
||||
do
|
||||
set nr_tables = nr_tables + 1;
|
||||
set stmt = 'CALL SYSPROC.ADMIN_CMD (RUNSTATS ON TABLE ' concat rtrim(line.tabschema) concat '.' concat line.tabname concat ')';
|
||||
execute immediate stmt;
|
||||
if SQLCODE = 0 then
|
||||
set nr_ok = nr_ok + 1;
|
||||
end if;
|
||||
end for;
|
||||
end!
|
||||
Reference in New Issue
Block a user