IHSD
.IHS_2023
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
IHS_2023.PR_CLEAN_STG_TABLES
Parameters
Name
Type
Mode
Definition
procedure pr_clean_stg_tables -- use AUTHID CURRENT_USER to execute with the privileges and -- schema context of the calling user AUTHID CURRENT_USER AS begin --empty all the staging tables to handle no header and no record incoming data files EXECUTE IMMEDIATE 'truncate table STG_ANALYTICSEVENTS_EMAILNOTIFICATIONSENT'; EXECUTE IMMEDIATE 'truncate table STG_ANALYTICSEVENTS_NOTIFICATIONSENT'; EXECUTE IMMEDIATE 'truncate table STG_ANALYTICSEVENTS_PUSHNOTIFICATIONOPENED'; EXECUTE IMMEDIATE 'truncate table STG_ANALYTICSEVENTS_PUSHNOTIFICATIONRECEIVED'; EXECUTE IMMEDIATE 'truncate table STG_ANALYTICSEVENTS_PUSHNOTIFICATIONSENT'; EXECUTE IMMEDIATE 'truncate table STG_ANALYTICSEVENTS_SURVEYSTEPVIEWED'; EXECUTE IMMEDIATE 'truncate table STG_AUXILIARYDATA'; EXECUTE IMMEDIATE 'truncate table STG_COMPETITIONS'; EXECUTE IMMEDIATE 'truncate table STG_FITBITACTIVITYLOGS'; EXECUTE IMMEDIATE 'truncate table STG_FITBITDAILYDATA'; EXECUTE IMMEDIATE 'truncate table STG_FITBITDEVICES'; EXECUTE IMMEDIATE 'truncate table STG_FITBITRESTINGHEARTRATES'; EXECUTE IMMEDIATE 'truncate table STG_FITBITSLEEPLOGDETAILS'; EXECUTE IMMEDIATE 'truncate table STG_FITBITSLEEPLOGS'; EXECUTE IMMEDIATE 'truncate table STG_FITBIT_HEARTRATE'; EXECUTE IMMEDIATE 'truncate table STG_FITBIT_STEPS'; EXECUTE IMMEDIATE 'truncate table STG_HEALTHKITACTIVITYSUMMARIES'; EXECUTE IMMEDIATE 'truncate table STG_HEALTHKITSAMPLES_APPLEEXERCISETIME'; EXECUTE IMMEDIATE 'truncate table STG_HEALTHKITSAMPLES_APPLEEXERCISETIME_DELETED'; EXECUTE IMMEDIATE 'truncate table STG_HEALTHKITSAMPLES_HEARTRATE'; EXECUTE IMMEDIATE 'truncate table STG_HEALTHKITSAMPLES_HEARTRATEVARIABILITY'; EXECUTE IMMEDIATE 'truncate table STG_HEALTHKITSAMPLES_HEARTRATEVARIABILITY_DELETED'; EXECUTE IMMEDIATE 'truncate table STG_HEALTHKITSAMPLES_HEARTRATE_DELETED'; EXECUTE IMMEDIATE 'truncate table STG_HEALTHKITSAMPLES_RESTINGHEARTRATE'; EXECUTE IMMEDIATE 'truncate table STG_HEALTHKITSAMPLES_RESTINGHEARTRATE_DELETED'; EXECUTE IMMEDIATE 'truncate table STG_HEALTHKITSAMPLES_SLEEPANALYSISINTERVAL'; EXECUTE IMMEDIATE 'truncate table STG_HEALTHKITSAMPLES_SLEEPANALYSISINTERVAL_DELETED'; EXECUTE IMMEDIATE 'truncate table STG_HEALTHKITSAMPLES_STEPS'; EXECUTE IMMEDIATE 'truncate table STG_HEALTHKITSAMPLES_STEPS_DELETED'; EXECUTE IMMEDIATE 'truncate table STG_HEALTHKITSTATISTICS_DAILYSTEPS'; EXECUTE IMMEDIATE 'truncate table STG_MANIFEST'; EXECUTE IMMEDIATE 'truncate table STG_NOTIFICATIONS'; EXECUTE IMMEDIATE 'truncate table STG_STUDYPARTICIPANTS'; EXECUTE IMMEDIATE 'truncate table STG_SURVEYCONSENTSIGNATURERESULTS'; EXECUTE IMMEDIATE 'truncate table STG_SURVEYDEFINITIONS'; EXECUTE IMMEDIATE 'truncate table STG_SURVEYQUESTIONRESULTS'; EXECUTE IMMEDIATE 'truncate table STG_SURVEYRESULTS'; EXECUTE IMMEDIATE 'truncate table STG_SURVEYSTEPRESULTS'; EXECUTE IMMEDIATE 'truncate table STG_SURVEYTASKS'; end;