--执行说明 /*该脚本是用来获取数据库中每个 schema 下是否是 AO 表,如果有 AO 表,将会存储于临时表 *tab_aotable中,如果是非 AO 表,那么将会存储于临时表 tab_naotable 中,由于存储非AO *表和AO表都是存储于临时表中的,因此在会话退出后,临时表将会自动销毁,如果需要获取, *请重新执行以下语句 */ drop table if exists tab_aotable; drop table if exists tab_naotable; create temporary table tab_aotable(table_oid oid,table_name text,aotable text,cond char(1)) distributed by (table_oid); create temporary table tab_naotable(table_oid oid,table_name text,naotable text,cond char(1)) distributed by (table_oid); create or replace function f_get_aotable() returns void as $$ declare v_list_toid oid; v_list_tname text; v_sql text; v_is_ao_tablename text; v_table_oid oid; v_table_name text; v_is_ao_table text; cur1 CURSOR FOR SELECT a.oid, c.nspname ||'.' || b.tablename FROM … [Read more...]
近期评论