DBA Data[Home] [Help]

APPS.GMICDEP SQL Statements

The following lines contain the word 'select', 'insert', 'update' or 'delete':

Line: 32

  -252 Cost update to ic_perd_bal error.
  <-252 Oracle RDBMS Error.
  =============================================  */
  FUNCTION calc_costs(pwhse_code      VARCHAR2,
                      pprd_end_date   DATE,
                      pperiod         NUMBER,
                      pfiscal_year    VARCHAR2,
                      pop_code        NUMBER)
                      RETURN NUMBER IS

    /* Local Variable definitions and initialization:
    ============================================== */
    l_iret          NUMBER        := 0;
Line: 56

    CURSOR item_selection IS
      SELECT DISTINCT(item_id)
      FROM   ic_perd_bal
      WHERE  fiscal_year = UPPER(pfiscal_year)
      AND    period      = pperiod
      AND    whse_code = UPPER(pwhse_code)
      AND    loct_usage <> 0;
Line: 65

      SELECT orgn_code
      FROM   ic_whse_mst
      where  whse_code = UPPER(pwhse_code)
      AND    delete_mark = 0;
Line: 83

      OPEN item_selection;
Line: 84

      FETCH item_selection INTO
        l_item_id;
Line: 87

      IF(item_selection%NOTFOUND) THEN
        CLOSE item_selection;
Line: 93

      WHILE (item_selection%FOUND) LOOP

        /* Let's call the costing package
        and determine the items cost.
        ============================== */
        l_iret := 0;
Line: 116

        /* Now let's update the perpetual balance
        table for all occurances of the item.
        ====================================== */
        UPDATE ic_perd_bal
          SET    loct_value = (loct_usage * l_cost),
                 last_update_date = SYSDATE,
                 last_updated_by = pop_code
          WHERE  fiscal_year  = pfiscal_year
          AND    period       = pperiod
          AND    whse_code    = pwhse_code
          AND    item_id      = l_item_id
          AND    loct_usage  <> 0;
Line: 131

            RETURN DEP_COST_UPDATE_ERR;
Line: 134

        FETCH item_selection INTO
          l_item_id;
Line: 139

      CLOSE item_selection;