Skip to content

Commit

Permalink
refactor(gw_fct_check_fprocess, gw_fct_om_check_data): clean up loggi…
Browse files Browse the repository at this point in the history
…ng and enhance temp table creation

- Removed unnecessary RAISE NOTICE statements in gw_fct_check_fprocess to streamline the function.
- Added dynamic execution of log table creation in gw_fct_om_check_data for better handling of temporary tables based on fid.
- Improved overall clarity and maintainability of the SQL functions.
  • Loading branch information
danimarinBG committed Jan 16, 2025
1 parent 3dad6ba commit a025dc4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
3 changes: 0 additions & 3 deletions utils/fct/gw_fct_check_fprocess.sql
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,13 @@ BEGIN
v_process_except_level
FROM sys_fprocess WHERE fid = v_check_fid;

RAISE NOTICE 'v_process_query_text ANTES:::::::: %',v_process_query_text;

-- replace variables (usando COALESCE para evitar NULLs)
v_exceptable_id = concat(replace (v_process_except_table, 'anl_', ''), '_id');
v_exceptable_catalog = concat(replace (v_process_except_table, 'anl_', ''), 'cat_id');
v_process_query_text = COALESCE(replace(v_process_query_text, 'v_graphClass', COALESCE(v_graphClass, '')), v_process_query_text);
v_process_info_msg = COALESCE(replace(v_process_info_msg, 'v_graphClass', COALESCE(v_graphClass, '')), v_process_info_msg);
v_process_except_msg = COALESCE(replace(v_process_except_msg, 'v_graphClass', COALESCE(v_graphClass, '')), v_process_except_msg);

RAISE NOTICE 'v_process_query_text DESPUÉS:::::::: %',v_process_query_text;

-- manage query count
IF v_process_query_text ILIKE '%string_agg%' AND v_process_fid <> 317 THEN
Expand Down
1 change: 1 addition & 0 deletions utils/fct/gw_fct_om_check_data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ BEGIN

-- create temp tables
IF v_fid = 125 THEN
EXECUTE 'SELECT gw_fct_create_logtables($${"data":{"parameters":{"fid":'||v_fid||'}}}$$::json)';
EXECUTE 'SELECT gw_fct_create_querytables($${"data":{"verifiedExceptions":'||COALESCE(v_verified_exceptions, 'false')||',"selectionMode":"'||COALESCE(v_selection_mode, 'userSelectors')||'", "checkPsectors":"'||COALESCE(v_checkpsectors, 'false')||'"}}$$::json)';
END IF;

Expand Down

0 comments on commit a025dc4

Please sign in to comment.