Changeset 3859


Ignore:
Timestamp:
07/05/08 13:00:10 (11 years ago)
Author:
cbyrom
Message:

Improve exception logging + correct return type for ingest stored procs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI01-discovery/branches/ingestAutomation-upgrade/database/ingest_procedures.sql

    r3851 r3859  
    4242 
    4343DROP FUNCTION update_document(original_document_id_in int, filename_in varchar(255),  
    44         discovery_id_in varchar(255), doc_type_in text, original_document_in text, scn_int int) CASCADE; 
     44        discovery_id_in varchar(255), doc_type_in text, original_document_in text, scn_in int) CASCADE; 
    4545CREATE FUNCTION update_document(original_document_id_in int, filename_in varchar(255),  
    46         discovery_id_in varchar(255), doc_type_in text, original_document_in text, scn_int int)  
    47         RETURNS integer AS  
     46        discovery_id_in varchar(255), doc_type_in text, original_document_in text, scn_in int)  
     47        RETURNS VOID AS  
    4848$$ 
    4949        DECLARE 
    50                 scn_current integer := 1; 
     50                scn_current integer; 
    5151    BEGIN 
    5252        -- This updates an existing document 
    53          
     53 
    5454                -- check the scn is valid before an update is done 
    5555                SELECT scn INTO scn_current FROM ORIGINAL_DOCUMENT WHERE  
    5656                        original_document_id = original_document_id_in; 
    5757                IF scn_in <> scn_current THEN 
    58                         RAISE EXCEPTION 'Invalid SCN specified (current scn=%, specified scn=%) - implies record has been changed during update - exiting...'; 
     58                        RAISE EXCEPTION 'Invalid SCN specified (current scn=%, specified scn=%) -  
     59                                implies record has been changed during update - exiting...', scn_current, scn_in; 
    5960                END IF; 
    6061 
Note: See TracChangeset for help on using the changeset viewer.