Changeset c256764571a55858b9a8db0f8905c297ec481926

Show
Ignore:
Timestamp:
10/14/08 19:00:42 (6 years ago)
Author:
Denish Patel <denish@omniti.com>
git-committer:
Denish Patel <denish@omniti.com> 1224010842 +0000
git-parent:

[8616a88b8cde694176cb6e7c524b479f12474b60]

git-author:
Denish Patel <denish@omniti.com> 1224010842 +0000
Message:

updated remove_metric function

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sql/reconnoiter_ddl_dump.sql

    r9e9c974 rc256764  
    13851385deleted_t INT; 
    13861386deleted_tc INT; 
     1387deleted_ct INT; 
    13871388deleted_n INT; 
    13881389deleted_5 INT; 
     
    13921393deleted_12h INT; 
    13931394deleted_sum INT; 
     1395deleted_tags INT; 
    13941396 
    13951397BEGIN 
     
    14151417-- Check of Text or Numeric Type 
    14161418IF v_del_metric_type ='text' THEN 
    1417  -- Delete from Metrix Tex table  
     1419 -- Delete from Metric Tex table  
    14181420  DELETE FROM stratcon.loading_dock_metric_text_s WHERE sid=v_del_sid AND name=v_del_metric_name; 
    14191421     GET DIAGNOSTICS deleted_t = ROW_COUNT; 
    14201422     IF v_debug = 'DEBUG' THEN 
    1421            RAISE NOTICE 'DELELTED ROWS FROM loading_dock_metric_text_s : %',deleted
     1423           RAISE NOTICE 'DELELTED ROWS FROM loading_dock_metric_text_s : %',deleted_t
    14221424     END IF; 
    1423  -- Delete from Metrix Change Log table  
     1425 -- Delete from Metric Change Log table  
    14241426  DELETE FROM stratcon.loading_dock_metric_text_s_change_log WHERE sid=v_del_sid AND name=v_del_metric_name; 
    14251427     GET DIAGNOSTICS deleted_tc = ROW_COUNT; 
    14261428     IF v_debug = 'DEBUG' THEN 
    1427           RAISE NOTICE 'DELELTED ROWS FROM loading_dock_metric_text_s_change_log : %',deleted
     1429          RAISE NOTICE 'DELELTED ROWS FROM loading_dock_metric_text_s_change_log : %',deleted_tc
    14281430     END IF; 
     1431  -- Delete from current_metric_text table  
     1432  DELETE FROM stratcon.current_metric_text WHERE sid=v_del_sid AND name=v_del_metric_name; 
     1433     GET DIAGNOSTICS deleted_ct = ROW_COUNT; 
     1434     IF v_debug = 'DEBUG' THEN 
     1435          RAISE NOTICE 'DELELTED ROWS FROM current_metric_text : %',deleted_ct; 
     1436     END IF;      
    14291437 ELSE 
    14301438  -- Delete from Metrix Numeric table 
     
    14321440   GET DIAGNOSTICS deleted_n = ROW_COUNT; 
    14331441     IF v_debug = 'DEBUG' THEN 
    1434          RAISE NOTICE 'DELELTED ROWS FROM loading_dock_metric_numeric_s : %',deleted
     1442         RAISE NOTICE 'DELELTED ROWS FROM loading_dock_metric_numeric_s : %',deleted_n
    14351443     END IF; 
    14361444  -- Delete from Rollup tables 
     
    14381446   GET DIAGNOSTICS deleted_5 = ROW_COUNT;    
    14391447     IF v_debug = 'DEBUG' THEN 
    1440          RAISE NOTICE 'DELELTED ROWS FROM rollup_matrix_numeric_5m : %',deleted
     1448         RAISE NOTICE 'DELELTED ROWS FROM rollup_matrix_numeric_5m : %',deleted_5
    14411449     END IF; 
    14421450   DELETE FROM stratcon.rollup_matrix_numeric_20m WHERE sid=v_del_sid AND name=v_del_metric_name; 
    14431451      GET DIAGNOSTICS deleted_20= ROW_COUNT;       
    14441452        IF v_debug = 'DEBUG' THEN 
    1445             RAISE NOTICE 'DELELTED ROWS FROM rollup_matrix_numeric_20m : %',deleted
     1453            RAISE NOTICE 'DELELTED ROWS FROM rollup_matrix_numeric_20m : %',deleted_20
    14461454        END IF; 
    14471455   DELETE FROM stratcon.rollup_matrix_numeric_60m WHERE sid=v_del_sid AND name=v_del_metric_name; 
    14481456      GET DIAGNOSTICS deleted_60 = ROW_COUNT;       
    14491457        IF v_debug = 'DEBUG' THEN 
    1450             RAISE NOTICE 'DELELTED ROWS FROM rollup_matrix_numeric_60m : %',deleted
     1458            RAISE NOTICE 'DELELTED ROWS FROM rollup_matrix_numeric_60m : %',deleted_60
    14511459        END IF; 
    14521460   DELETE FROM stratcon.rollup_matrix_numeric_6hours WHERE sid=v_del_sid AND name=v_del_metric_name; 
    14531461      GET DIAGNOSTICS deleted_6h = ROW_COUNT;       
    14541462        IF v_debug = 'DEBUG' THEN 
    1455             RAISE NOTICE 'DELELTED ROWS FROM rollup_matrix_numeric_6hours : %',deleted
     1463            RAISE NOTICE 'DELELTED ROWS FROM rollup_matrix_numeric_6hours : %',deleted_6h
    14561464        END IF; 
    14571465   DELETE FROM stratcon.rollup_matrix_numeric_12hours WHERE sid=v_del_sid AND name=v_del_metric_name; 
    14581466      GET DIAGNOSTICS deleted_12h = ROW_COUNT;       
    14591467        IF v_debug = 'DEBUG' THEN 
    1460             RAISE NOTICE 'DELELTED ROWS FROM rollup_matrix_numeric_12hours : %',deleted
     1468            RAISE NOTICE 'DELELTED ROWS FROM rollup_matrix_numeric_12hours : %',deleted_12h
    14611469        END IF; 
    14621470END IF; 
    1463   -- Delete from metrix summary table 
    1464    DELETE FROM stratcon.metrix_name_summary WHERE sid=v_del_sid AND metric_name=v_del_metric_name; 
     1471  -- Delete from metric summary table 
     1472   DELETE FROM stratcon.metric_name_summary WHERE sid=v_del_sid AND metric_name=v_del_metric_name; 
    14651473      GET DIAGNOSTICS deleted_sum= ROW_COUNT;      
    14661474        IF v_debug = 'DEBUG' THEN 
    1467             RAISE NOTICE 'DELELTED ROWS FROM metric_name_summary : %',deleted
     1475            RAISE NOTICE 'DELELTED ROWS FROM metric_name_summary : %',deleted_sum
    14681476        END IF;  
    1469  v_out:='Deleted Rows for Metric_Text, Metrix_Text_change_log,Metric_Numeric,Rollup_5m,Rollup_20m,Rollup_1hour,Rollup_6hours,Rollup_12hours,Metric_Summary:'||deleted_t||','||deleted_tc||','||deleted_n||','||deleted_5||','||deleted_20||','||deleted_60||','||deleted_6h||','||deleted_12h||','||deleted_sum; 
    1470 RETURN; 
     1477   
     1478  -- Delete from metric tags table 
     1479   DELETE FROM stratcon.metric_tags WHERE sid=v_del_sid AND metric_name=v_del_metric_name; 
     1480      GET DIAGNOSTICS deleted_tags= ROW_COUNT;      
     1481        IF v_debug = 'DEBUG' THEN 
     1482            RAISE NOTICE 'DELELTED ROWS FROM metric_tags : %',deleted_tags; 
     1483        END IF;  
     1484         
     1485 v_out:='Deleted Rows for Metric_Text, Metric_Text_change_log,Metric_Numeric,Rollup_5m,Rollup_20m,Rollup_1hour,Rollup_6hours,Rollup_12hours,Metric_Summary:'||deleted_t||','||deleted_tc||','||deleted_n||','||deleted_5||','||deleted_20||','||deleted_60||','||deleted_6h||','||deleted_12h||','||deleted_sum; 
     1486  
    14711487   EXCEPTION 
    14721488    WHEN RAISE_EXCEPTION THEN