119: if table_owner%notfound then
120: null;
121: end if;
122: close table_owner;
123: edw_log.put_line('owner '||l_owner);
124: edw_log.put_line('staging '||p_stg_name);
125: if l_owner is not null then
126: cid := DBMS_SQL.open_cursor;
127: DBMS_SQL.PARSE(cid, 'truncate table '||l_owner||'.'||p_stg_name||' drop storage', dbms_sql.native);
120: null;
121: end if;
122: close table_owner;
123: edw_log.put_line('owner '||l_owner);
124: edw_log.put_line('staging '||p_stg_name);
125: if l_owner is not null then
126: cid := DBMS_SQL.open_cursor;
127: DBMS_SQL.PARSE(cid, 'truncate table '||l_owner||'.'||p_stg_name||' drop storage', dbms_sql.native);
128: g_dummy_int:=DBMS_SQL.EXECUTE(cid);
138:
139: Procedure truncate_Dimension(Errbuf in out NOCOPY varchar2, Retcode in out NOCOPY varchar2, p_dim_name in varchar2) IS
140:
141: BEGIN
142: edw_log.put_line('Dimension name is '||p_dim_name);
143: IF (p_dim_name IS NULL) THEN
144: truncate_All_Dimensions;
145: ELSE
146: truncate_One_Dimension(p_dim_name);
149:
150: Procedure truncate_One_Dimension(p_dim_name in varchar2) IS
151: BEGIN
152: /* truncate the level staging tables */
153: edw_log.put_line('Truncating staging tables for '||p_dim_name);
154: FOR r1 IN dimm(p_dim_name) LOOP
155: truncate_Table(r1.table_name);
156: edw_log.put_line('Truncated staging table '||r1.table_name);
157: END LOOP;
152: /* truncate the level staging tables */
153: edw_log.put_line('Truncating staging tables for '||p_dim_name);
154: FOR r1 IN dimm(p_dim_name) LOOP
155: truncate_Table(r1.table_name);
156: edw_log.put_line('Truncated staging table '||r1.table_name);
157: END LOOP;
158: END;
159:
160: Procedure truncate_All_Dimensions IS
181: BEGIN
182: open factt(p_fact_name);
183: fetch factt into l_staging_table;
184: close factt;
185: edw_log.put_line('Truncating staging tables for '||p_fact_name);
186: truncate_Table(l_staging_table);
187: edw_log.put_line('Truncated staging table '||l_staging_table);
188: END;
189:
183: fetch factt into l_staging_table;
184: close factt;
185: edw_log.put_line('Truncating staging tables for '||p_fact_name);
186: truncate_Table(l_staging_table);
187: edw_log.put_line('Truncated staging table '||l_staging_table);
188: END;
189:
190:
191: Procedure truncate_All_Facts IS