Changeset 4920 for TI01-discovery


Ignore:
Timestamp:
10/02/09 16:36:39 (11 years ago)
Author:
sdonegan
Message:

Incorporates more "delete" functionality for spatial and temporal tables -updated.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI01-discovery/tags/stable-TI01-ingestAutomation_Proglue_upgradesAndReporting/temp/database/ingest_procedures.sql

    r4913 r4920  
    4747        DECLARE 
    4848                db_id integer; 
     49                tdID integer; 
     50                sdID integer; 
    4951    BEGIN 
    5052        -- This deletes a document from the DB 
    5153 
    52         -- get temporal_data_id from spatial_temporal_data (SJD 090209) 
    53         tdID := SELECT temporal_data_id FROM SPATIAL_TEMPORAL_DATA WHERE original_document_id = original_document_id_in; 
     54        -- get temporal_data_id from spatial_temporal_data (SJD 090209) --NOTE can't mix SELECT and DELETE bits here!! 
     55        SELECT INTO tdID temporal_data_id FROM SPATIAL_TEMPORAL_DATA WHERE original_document_id = original_document_id_in; 
     56        SELECT INTO sdID spatial_data_id FROM SPATIAL_TEMPORAL_DATA WHERE original_document_id = original_document_id_in; 
     57         
     58        DELETE FROM spatial_data WHERE spatial_data_id = sdID; 
    5459        DELETE FROM temporal_data WHERE temporal_data_id = tdID; 
    55  
    56         --get spatial_data_id from spatial_temporal data (SJD 090209) 
    57         sdID := SELECT spatial_data_id FROM SPATIAL_TEMPORAL_DATA WHERE original_document_id = original_document_id_in; 
    58         DELETE FROM spatial_data WHERE spatial_data_id = sdID; 
    59  
    6060        DELETE FROM TRANSFORMED_DOCUMENT WHERE original_document_id = original_document_id_in; 
    6161        DELETE FROM SPATIAL_TEMPORAL_DATA WHERE original_document_id = original_document_id_in; 
Note: See TracChangeset for help on using the changeset viewer.