0% found this document useful (0 votes)
174 views14 pages

Dbfeeds Project)

This document contains code snippets and function definitions for creating temporary partitions, getting process and message IDs, and storing temporary partition data in Oracle databases. Functions are defined to create a temporary partition based on a process ID and table name, get the current or next value of a sequence, and insert data from a temporary partition into a target table.

Uploaded by

api-26304852
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
174 views14 pages

Dbfeeds Project)

This document contains code snippets and function definitions for creating temporary partitions, getting process and message IDs, and storing temporary partition data in Oracle databases. Functions are defined to create a temporary partition based on a process ID and table name, get the current or next value of a sequence, and insert data from a temporary partition into a target table.

Uploaded by

api-26304852
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 14

CREATE TMP PARTITION(SP used in s_start_process)

FUNCTION F_CREATE_TMP_PARTITION ( pPrcProcessId INTEGER
         ,pTableName VARCHAR2
          ) RETURN INTEGER IS
 lSqlStatement VARCHAR2(800);
BEGIN
   IF pPrcProcessId = 0 THEN
    RAISE_APPLICATION_ERROR( ­20011 , 'INTERNAL_ERROR : Wrong input 
parameter: PrcProcessId='||pPrcProcessId, TRUE );
  ELSE
    lSqlStatement := 'ALTER TABLE '||pTableName || ' ADD PARTITION 
PROCESS_'||pPrcProcessId
             || ' VALUES ('||pPrcProcessId||')';
  END IF;
  EXECUTE IMMEDIATE lSqlStatement;
  RETURN 1;
EXCEPTION
   WHEN OTHERS THEN
        RAISE_APPLICATION_ERROR( ­20011 , 'INTERNAL_ERROR : '||SQLCODE 
||': '||SQLERRM , TRUE );
END F_CREATE_TMP_PARTITION;

GET PROCESSID(SP used in s_start_process)

FUNCTION F_GET_PROCESS_ID(pType VARCHAR2) RETURN INTEGER IS
   lPrcProcessId INTEGER;
BEGIN
  IF upper(pType) = 'CURRENT' THEN
   SELECT SEQ_GW_PROCESS_ID.CURRVAL INTO lPrcProcessId FROM DUAL;
  ELSE
   SELECT SEQ_GW_PROCESS_ID.NEXTVAL INTO lPrcProcessId FROM DUAL;
  END IF;
  RETURN lPrcProcessId;
EXCEPTION
   WHEN OTHERS THEN
        RAISE_APPLICATION_ERROR( ­20011 , 'INTERNAL_ERROR : '||SQLCODE 
||': '||SQLERRM , TRUE );
END;

GET MESSAGEID

FUNCTION F_GET_MESSAGE_ID (pType VARCHAR2) RETURN INTEGER IS
   lMssgId INTEGER;
BEGIN
  IF upper(pType) = 'CURRENT' THEN
   SELECT SEQ_GW_MESSAGE.CURRVAL INTO lMssgId FROM DUAL;
  ELSE
   SELECT SEQ_GW_MESSAGE.NEXTVAL INTO lMssgId FROM DUAL;
  END IF;
  RETURN lMssgId;
EXCEPTION
   WHEN OTHERS THEN
        RAISE_APPLICATION_ERROR( ­20011 , 'INTERNAL_ERROR : '||SQLCODE 
||': '||SQLERRM , TRUE );
END;

STORE TMP PARTITION DATA

FUNCTION F_STORE_TMP_PARTITION_DATA (   pPrcProcessId INTEGER
               ,pTableName VARCHAR2
             ) RETURN INTEGER IS
   lSystemId INTEGER;
   lInterfaceId INTEGER;
   lTemplateId INTEGER;
   lSqlStatement VARCHAR2(800);
BEGIN
  SELECT SYSTEM_ID, INTERFACE_ID, TEMPLATE_ID INTO lSystemId, 
lInterfaceId, lTemplateId
     FROM T_GW_PRC_PROCESS WHERE PRC_PROCESS_ID=pPrcProcessId;

  lSqlStatement := 'INSERT INTO T_GW_ARC_'||lSystemId||'_'||
lInterfaceId||'_'||lTemplateId||' SELECT * FROM '||pTableName||' WHERE 
PRC_PROCESS_ID = '||pPrcProcessId;
  ­­ Commented out for the TEST purposes
  ­­ EXECUTE IMMEDIATE lSqlStatement;
  return 1;
  ­­ RETURN F_DROP_TMP_PARTITION (pPrcProcessId, pTableName );

EXCEPTION
   WHEN OTHERS THEN
        RAISE_APPLICATION_ERROR( ­20011 , 'INTERNAL_ERROR : '||SQLCODE 
||': '||SQLERRM , TRUE );
END;

wf_Start_FeedName
m_StartProcess:

m_CreateFeedParamFiles
Validation Mappings

m_B3.3.1_CORE_ALL:

m_B3.3.2_APAC_ALL:
m_B3.3.4_CORE_ALL:
m_B3.3.5_APAC_ALL:

mplt_GENERATE_PROCESSING_INFO:
mplt_ERROR_HANDLING

CODING BLOCK DERIVATION MAPPINGS:


m_B4.2.1.1_CORE_ALL:

m_B4.2.1.2_CORE_ALL

m_B4.2.2.2_APAC_ALL:
GDS DERIVATION MAPPINGS:

m_B4.3.1_CORE_ALL:

m_B4.3.2_APAC_ALL:
LDS DERIVATION MAPPINGS:

m_B4.4.1_APAC_ALL

m_B4.5.1_APAC_ALL
m_B4.5.4_APAC_DW_ACC

m_B4.5.5_APAC_ALL
wf_FEEDNAME(wf_IDMS_

m_B6.1_CORE_ALL

m_Hard_Error_Check
m_B9.4_APAC_ALL

m_B9.4_APAC_ALL_UPLOAD
m_PORTAL_CM_ERROR_FILE_MOVE_SAC

m_PORTAL_CM_PUBLISHER_SAC

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy