Humble Trader

Saturday, September 16, 2006

Country Dimension - Process M_S2S_COUNTRIES Specification

  • Package: m_s2s_countries
  • Description: .
    • Procedure: map (Overload 1)
      • Description: Wrapper to do mapping with housekeeping.
      • Parameters: None.
      • Action:
        • Run initialise mapping with parameters p_mapping = 'M_S2S_COUNTRIES', run_no = local variable to capture the run number.
        • Run map (overload 2) with parameter p_run_no = the captured run number.
        • Run finalise mapping with parameter run_no = the captured run number.
    • Procedure: map (Overload 2)
      • Description: Map PARSED_HTML to STA.S_COUNTRIES.
      • Parameters:
        • p_run_no:
          • Datatype: NUMBER
          • Direction: IN
          • Description: Run number of this map run.
        • Action:
          • Initialise the data sequence counter to zero.
          • Delete all data from S_COUNTRIES - discarding the previous run.
          • Use extract_html_data.extract_table with the parameters p_table_num = 4, p_web_page = 'COUNTRIES' to capture the raw HTML from the most recent fetch and parse into a PL/SQL table.
          • For each row in the PL/SQL table - excluding the first which contains column header information...
            • Increment the data sequence counter.
            • Count the number of fields in the PL/SQL table row. There are a maximum of eight but null data in any particular row drops the field completely.
            • If there are less than eight fields...
              • For each missing field...
                • Generate missing fields as 'NULL'.
              • End; For each missing field.
            • End; If there are less than eight fields.
            • Create an insert statement containing the corrected PL/SQL row and audit data.
            • Run the insert statement to insert the data into S_COUNTRIES.
          • End; For each row in the PL/SQL table.

0 Comments:

Post a Comment

<< Home