sql
This commit is contained in:
@@ -25,50 +25,77 @@ __lead_trim_columns text;
|
||||
__Dots_3 text;
|
||||
__inverted_comma text;
|
||||
__underscore text;
|
||||
__hashvalue text;
|
||||
begin
|
||||
loop
|
||||
exit when __n=53;
|
||||
__n := __n+1;
|
||||
|
||||
__na_sql := 'update staging1.staging_generic_table set '|| concat('column',__n)||' =null
|
||||
where '||concat('column',__n)||'=''NA'' and file_syspk=' ||filesyspk;
|
||||
|
||||
__space_sql := 'update staging1.staging_generic_table set '|| concat('column',__n)||' =null
|
||||
where '||concat('column',__n)||'='''' and file_syspk=' ||filesyspk;
|
||||
|
||||
__div_sql := 'update staging1.staging_generic_table set '|| concat('column',__n)||' =null
|
||||
where '||concat('column',__n)||'=''#REF!'' and file_syspk=' ||filesyspk;
|
||||
|
||||
__ref_sql := 'update staging1.staging_generic_table set '|| concat('column',__n)||' =null
|
||||
where '||concat('column',__n)||'=''#DIV/0!'' and file_syspk=' ||filesyspk;
|
||||
|
||||
__hyphen_sql := 'update staging1.staging_generic_table set '|| concat('column',__n)||' =null
|
||||
where '||concat('column',__n)||'=''-'' and file_syspk=' ||filesyspk;
|
||||
|
||||
__hyphen_3_sql := 'update staging1.staging_generic_table set '|| concat('column',__n)||' =null
|
||||
where '||concat('column',__n)||'=''---'' and file_syspk=' ||filesyspk;
|
||||
|
||||
__not_applicable := 'update staging1.staging_generic_table set '|| concat('column',__n)||' =null
|
||||
where '||concat('column',__n)||'=''Not Applicable '' and file_syspk=' ||filesyspk;
|
||||
|
||||
__NR := 'update staging1.staging_generic_table set '|| concat('column',__n)||' =null
|
||||
where '||concat('column',__n)||'=''NR'' and file_syspk=' ||filesyspk;
|
||||
|
||||
__Dots_1 := 'update staging1.staging_generic_table set '|| concat('column',__n)||' =null
|
||||
where '||concat('column',__n)||'=''u..'' and file_syspk=' ||filesyspk;
|
||||
|
||||
__Dots_2 := 'update staging1.staging_generic_table set '|| concat('column',__n)||' =null
|
||||
where '||concat('column',__n)||'=''u.'' and file_syspk=' ||filesyspk;
|
||||
|
||||
__Dots_3 := 'update staging1.staging_generic_table set '|| concat('column',__n)||' =null
|
||||
where '||concat('column',__n)||'=''.'' and file_syspk=' ||filesyspk;
|
||||
|
||||
__inverted_comma := 'update staging1.staging_generic_table set '|| concat('column',__n)||' =null
|
||||
where '||concat('column',__n)||'=''`'' and file_syspk=' ||filesyspk;
|
||||
__trail_trim_columns:='update staging1.staging_generic_table set '|| concat('column',__n)||' = trim(trailing from '|| concat('column',__n)||')';
|
||||
__lead_trim_columns:='update staging1.staging_generic_table set '|| concat('column',__n)||' = trim(leading from '|| concat('column',__n)||')';
|
||||
|
||||
__trail_trim_columns:='update staging1.staging_generic_table set '|| concat('column',__n)||' = trim(trailing from '|| concat('column',__n)||')
|
||||
where file_syspk=' ||filesyspk;
|
||||
|
||||
__lead_trim_columns:='update staging1.staging_generic_table set '|| concat('column',__n)||' = trim(leading from '|| concat('column',__n)||')
|
||||
where file_syspk=' ||filesyspk;
|
||||
|
||||
__underscore := 'update staging1.staging_generic_table set '|| concat('column',__n)||' =null
|
||||
where '||concat('column',__n)||'=''_'' and file_syspk=' ||filesyspk;
|
||||
execute __na_sql;
|
||||
|
||||
__hashvalue := 'update staging1.staging_generic_table set '|| concat('column',__n)||' =null
|
||||
where '||concat('column',__n)||'=''#VALUE!'' and file_syspk=' ||filesyspk;
|
||||
|
||||
|
||||
execute __na_sql;
|
||||
execute __space_sql;
|
||||
execute __div_sql;
|
||||
execute __ref_sql;
|
||||
execute __hyphen_sql;
|
||||
execute __hyphen_3_sql;
|
||||
execute __not_applicable;
|
||||
execute __NR;
|
||||
execute __Dots_1;
|
||||
execute __Dots_2;
|
||||
execute __Dots_3;
|
||||
execute __trail_trim_columns;
|
||||
execute __lead_trim_columns;
|
||||
execute __underscore;
|
||||
execute __hashvalue;
|
||||
execute __space_sql;
|
||||
end loop;
|
||||
end;
|
||||
$function$
|
||||
Reference in New Issue
Block a user