@@ -255,6 +255,37 @@ BEGIN
255
255
END;
256
256
$function$ LANGUAGE plpgsql;
257
257
258
+ -- Complete import with subsequent drop of staging tables
259
+ DROP FUNCTION IF EXISTS sql_import_sequences_and_insert_into_tables(boolean , text [], int [], text );
260
+ CREATE FUNCTION sql_import_sequences_and_insert_into_tables (exec boolean = FALSE, stusab_criteria text [] = ARRAY[' %' ],
261
+ seq_criteria int [] = ARRAY[- 1 ], actions text = ' atem'
262
+ ) RETURNS text AS $function$
263
+ DECLARE
264
+ sql TEXT := ' ' ;
265
+ bool_large_geo BOOLEAN ;
266
+ bool_small_geo BOOLEAN ;
267
+ bool_estimate BOOLEAN ;
268
+ bool_moe BOOLEAN ;
269
+ sql_large_geo TEXT ;
270
+ sql_small_geo TEXT ;
271
+ sql_large_geo_moe TEXT ;
272
+ sql_small_geo_moe TEXT ;
273
+ seq_criteria2 int [];
274
+ filename_part TEXT := ' ' ;
275
+ BEGIN
276
+ EXECUTE ' SELECT ' || current_schema() || ' .get_refyear_period();' INTO filename_part;
277
+ IF seq_criteria = ARRAY[- 1 ] THEN
278
+ seq_criteria2 := (SELECT array_agg(seq) FROM vw_sequence);
279
+ ELSE
280
+ seq_criteria2 := seq_criteria;
281
+ END IF;
282
+
283
+ SELECT sql_drop_import_tables
284
+
285
+ END;
286
+ $function$ LANGUAGE plpgsql;
287
+
288
+
258
289
-- Maintenance Functions
259
290
DROP FUNCTION IF EXISTS sql_truncate_storage_tables(boolean , int [], text );
260
291
CREATE FUNCTION sql_truncate_storage_tables (exec boolean = FALSE, seq_criteria int [] = ARRAY[- 1 ], actions text = ' em' ) RETURNS text AS $function$
0 commit comments