DBA Data[Home] [Help]

APPS.BSC_KPI_PVT SQL Statements

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

Line: 19

 |                      This package Creates, Retrieve, Update, Delete                  |
 |                      for BSC KPI information.                                        |
 |                                                                                      |
 | History:                                                                             |
 |                                                                                      |
 | 04-MAR-2003 PAJOHRI  MLS Bug #2721899                                                |
 |                        1. Modified Update Query for  BSC_KPIS_TL, BSC_KPI_DEFAULTS_TL|
 |                        2. Modified Insert Query for  BSC_KPI_DEFAULTS_TL.            |
 |                        3. Changed nvl(.Bsc_Language, userenv('LANG'))   |
 |                           to userenv('LANG')                                         |
 | 20-MAR-03 PWALI for bug #2843082                                                     |
 |                      13-MAY-2003 PWALI  Bug #2942895, SQL BIND COMPLIANCE            |
 |                      24-JUL-2003 Adeulgao fixed bug#3047536                          |
 |                                  Granted access of KPIS to BSC_PMD_USER              |
 |                      14-NOV-2003 ADRAO  Modified for  Bug #3248729,                  |
 |                      02-MAR-2004 WLEUNG Modified for  Bug #3476004                   |
 |                                        new procedure Set_Default_Value_By_Option_ID  |
 |                      06-MAR-2004 kyadamak for the bug#3439029                        |
 |                      11-MAR-2004 PAJOHRI Bug #3500012                                |
 | 30-MAR-2003 PAJOHRI  Bug #3539639, modified closing of cursor c_old_option_id        |
 |   18-MAY-04          adrao Modified PL/SQL records and CRUD to accept SHORT_NAME     |
 |   18-JUN-04          adrao added BSC_KPI_ANALYSIS_GROUP.SHORT_NAME to PL/SQL APIs    |
 |                            Bug#3691035                                               |
 |   21-JUL-04          adrao made short_name nonunique. prototype_flag =2 Bug#3781764  |
 |   11-APR-05          adrao fixed API Create_Kpi_Analysis to pass appropriate name    |
 |                            for Bug#4294920                                           |
 |   27-APR-05          adrao Fixed Bug#4331964                                         |
 |   21-JUL-2005        ashankar Bug#4314386                                            |
 |   16-NOV-2006        ankgoel  Color By KPI enh#5244136                               |
 |   16-NOV-2006        vtulasi  Color By KPI enh#5244136                               |
 |     09-feb-2007 ashankar Simulation Tree Enhacement 5386112                          |
 +======================================================================================+
*/
G_PKG_NAME              CONSTANT        varchar2(30) := 'BSC_KPI_PVT';
Line: 82

    SELECT COUNT(1) INTO l_Count
    FROM   BSC_KPIS_B
    WHERE  INDICATOR = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 107

     SELECT COUNT(1) INTO l_Count
     FROM   BSC_KPIS_B
     WHERE  SHORT_NAME = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Short_Name
     AND    PROTOTYPE_FLAG <> BSC_KPI_PUB.DELETE_KPI_FLAG;
Line: 124

    select count(1) + 1
      into l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Display_Order
      from BSC_KPIS_B
     where ind_group_id = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Group_Id;
Line: 135

  if l_Bsc_Kpi_Entity_Rec.Last_Update_Date is null then
    l_Bsc_Kpi_Entity_Rec.Last_Update_Date := sysdate;
Line: 145

  insert into BSC_KPIS_B( INDICATOR
                         ,CSF_ID
                         ,IND_GROUP_ID
                         ,DISP_ORDER
                         ,PROTOTYPE_FLAG
                         ,INDICATOR_TYPE
                         ,CONFIG_TYPE
                         ,PERIODICITY_ID
                         ,BM_GROUP_ID
                         ,APPLY_COLOR_FLAG
                         ,PROTOTYPE_COLOR
                         ,SHARE_FLAG
                         ,SOURCE_INDICATOR
                         ,PUBLISH_FLAG
                         ,CREATED_BY
                         ,CREATION_DATE
                         ,LAST_UPDATED_BY
                         ,LAST_UPDATE_DATE
                         ,LAST_UPDATE_LOGIN
                         ,EDW_FLAG
                         ,CALENDAR_ID
                         ,SHORT_NAME
                         ,COLOR_ROLLUP_TYPE
                         ,PROTOTYPE_COLOR_ID
                         ,PROTOTYPE_TREND_ID
                         ,WEIGHTED_COLOR_METHOD)
                  values( l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id
                         ,l_Bsc_Kpi_Entity_Rec.Bsc_Csf_Id
                         ,l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Group_Id
                         ,l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Display_Order
                         ,l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Prototype_Flag
                         ,l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Indicator_Type
                         ,l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Config_Type
                         ,l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Periodicity_Id
                         ,l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Bm_Group_Id
                         ,l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Color_Flag
                         ,l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Prototype_Color
                         ,l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Share_Flag
                         ,l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Source_Ind
                         ,l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Publish_Flag
                         ,l_Bsc_Kpi_Entity_Rec.Created_By
                         ,sysdate
                         ,l_Bsc_Kpi_Entity_Rec.Last_Updated_By
                         ,sysdate
                         ,l_Bsc_Kpi_Entity_Rec.Last_Update_Login
                         ,l_Bsc_Kpi_Entity_Rec.Bsc_Edw_Flag
                         ,l_Bsc_Kpi_Entity_Rec.Bsc_Calendar_Id
                         ,l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Short_Name
                         ,l_Bsc_Kpi_Entity_Rec.Bsc_Color_Rollup_Type
                         ,l_Bsc_Kpi_Entity_Rec.Bsc_Prototype_Color_Id
                         ,l_Bsc_Kpi_Entity_Rec.Bsc_Prototype_Trend_Id
                         ,l_Bsc_Kpi_Entity_Rec.Bsc_Weighted_Color_Method);
Line: 201

  insert into BSC_KPIS_TL (
    INDICATOR,
    LANGUAGE,
    SOURCE_LANG,
    NAME,
    HELP
  ) select
      l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id,
      L.LANGUAGE_CODE,
      userenv('LANG'),
      l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Name,
      l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Help
  from FND_LANGUAGES L
  where L.INSTALLED_FLAG in ('I', 'B')
   and not exists
    (select NULL
       from BSC_KPIS_TL T
       where T.INDICATOR = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id
       and T.LANGUAGE = L.LANGUAGE_CODE);
Line: 225

  select count(indicator)
    into  l_count
    from bsc_kpis_b
    where indicator = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id ;
Line: 303

  SELECT DISTINCT  A.CSF_ID
                  ,A.IND_GROUP_ID
                  ,A.DISP_ORDER
                  ,A.PROTOTYPE_FLAG
                  ,A.INDICATOR_TYPE
                  ,A.CONFIG_TYPE
                  ,A.PERIODICITY_ID
                  ,A.BM_GROUP_ID
                  ,A.APPLY_COLOR_FLAG
                  ,A.PROTOTYPE_COLOR
                  ,A.SHARE_FLAG
                  ,A.SOURCE_INDICATOR
                  ,A.PUBLISH_FLAG
                  ,A.CREATED_BY
                  ,A.CREATION_DATE
                  ,A.LAST_UPDATED_BY
                  ,A.LAST_UPDATE_DATE
                  ,A.LAST_UPDATE_LOGIN
                  ,A.EDW_FLAG
                  ,A.CALENDAR_ID
                  ,A.SHORT_NAME
                  ,A.COLOR_ROLLUP_TYPE
                  ,A.PROTOTYPE_COLOR_ID
                  ,A.PROTOTYPE_TREND_ID
                  ,A.WEIGHTED_COLOR_METHOD
                  ,B.NAME
                  ,B.HELP
                  ,B.SOURCE_LANG
             INTO  x_Bsc_Kpi_Entity_Rec.Bsc_Csf_Id
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Group_Id
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Display_Order
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Prototype_Flag
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Indicator_Type
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Config_Type
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Periodicity_Id
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Bm_Group_Id
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Color_Flag
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Prototype_Color
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Share_Flag
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Source_Ind
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Publish_Flag
                  ,x_Bsc_Kpi_Entity_Rec.Created_By
                  ,x_Bsc_Kpi_Entity_Rec.Creation_Date
                  ,x_Bsc_Kpi_Entity_Rec.Last_Updated_By
                  ,x_Bsc_Kpi_Entity_Rec.Last_Update_Date
                  ,x_Bsc_Kpi_Entity_Rec.Last_Update_Login
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Edw_Flag
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Calendar_Id
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Short_Name
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Color_Rollup_Type
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Prototype_Color_Id
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Prototype_Trend_Id
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Weighted_Color_Method
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Name
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Help
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Source_Language
             FROM  BSC_KPIS_B A
                  ,BSC_KPIS_TL B
            WHERE A.INDICATOR = B.INDICATOR
              AND A.INDICATOR = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id
              AND B.LANGUAGE =  USERENV('LANG');
Line: 409

procedure Update_Kpi(
  p_commit              IN      varchar2 := FND_API.G_FALSE
 ,p_Bsc_Kpi_Entity_Rec  IN      BSC_KPI_PUB.Bsc_Kpi_Entity_Rec
 ,x_return_status       OUT NOCOPY     varchar2
 ,x_msg_count           OUT NOCOPY     number
 ,x_msg_data            OUT NOCOPY     varchar2
) is

l_Bsc_Kpi_Entity_Rec            BSC_KPI_PUB.Bsc_Kpi_Entity_Rec;
Line: 505

  if p_Bsc_Kpi_Entity_Rec.Last_Updated_By is not null then
    l_Bsc_Kpi_Entity_Rec.Last_Updated_By := p_Bsc_Kpi_Entity_Rec.Last_Updated_By;
Line: 508

  if p_Bsc_Kpi_Entity_Rec.Last_Update_Date is not null then
    l_Bsc_Kpi_Entity_Rec.Last_Update_Date := p_Bsc_Kpi_Entity_Rec.Last_Update_Date;
Line: 511

  if p_Bsc_Kpi_Entity_Rec.Last_Update_Login is not null then
    l_Bsc_Kpi_Entity_Rec.Last_Update_Login := p_Bsc_Kpi_Entity_Rec.Last_Update_Login;
Line: 540

  update BSC_KPIS_B
     set  csf_id = l_Bsc_Kpi_Entity_Rec.Bsc_Csf_Id
         ,ind_group_id = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Group_Id
         ,disp_order = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Display_Order
         ,prototype_flag = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Prototype_Flag
         ,indicator_type = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Indicator_Type
         ,config_type = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Config_Type
         ,periodicity_id = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Periodicity_Id
         ,bm_group_id = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Bm_Group_Id
         ,apply_color_flag = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Color_Flag
         ,prototype_color = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Prototype_Color
         ,share_flag = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Share_Flag
         ,source_indicator = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Source_Ind
         ,publish_flag = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Publish_Flag
         ,created_by = l_Bsc_Kpi_Entity_Rec.Created_By
         ,creation_date = l_Bsc_Kpi_Entity_Rec.Creation_Date
         ,last_updated_by = l_Bsc_Kpi_Entity_Rec.Last_Updated_By
         ,last_update_date = l_Bsc_Kpi_Entity_Rec.Last_Update_Date
         ,last_update_login = l_Bsc_Kpi_Entity_Rec.Last_Update_Login
         ,edw_flag = l_Bsc_Kpi_Entity_Rec.Bsc_Edw_Flag
         ,calendar_id = l_Bsc_Kpi_Entity_Rec.Bsc_Calendar_Id
         ,color_rollup_type = l_Bsc_Kpi_Entity_Rec.Bsc_Color_Rollup_Type
         ,prototype_color_id = l_Bsc_Kpi_Entity_Rec.Bsc_Prototype_Color_Id
         ,prototype_trend_id = l_Bsc_Kpi_Entity_Rec.Bsc_Prototype_Trend_Id
         ,weighted_color_method = l_Bsc_Kpi_Entity_Rec.Bsc_Weighted_Color_Method
   where indicator = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 567

  update BSC_KPIS_TL
     set  name = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Name
         ,help = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Help
         ,SOURCE_LANG       = userenv('LANG')
   where indicator = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id
     and userenv('LANG') IN (LANGUAGE, SOURCE_LANG);
Line: 604

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Update_Kpi ';
Line: 606

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Update_Kpi ';
Line: 614

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Update_Kpi ';
Line: 616

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Update_Kpi ';
Line: 620

end Update_Kpi;
Line: 625

procedure Delete_Kpi(
  p_commit              IN      varchar2 := FND_API.G_FALSE
 ,p_Bsc_Kpi_Entity_Rec  IN      BSC_KPI_PUB.Bsc_Kpi_Entity_Rec
 ,x_return_status       OUT NOCOPY     varchar2
 ,x_msg_count           OUT NOCOPY     number
 ,x_msg_data            OUT NOCOPY     varchar2
) is

l_count              number;
Line: 634

l_Delete_Kpi_b       BOOLEAN := TRUE;
Line: 662

     SELECT COUNT(INDICATOR)
     INTO   l_count
     FROM   BSC_KPI_DATA_TABLES
     WHERE  INDICATOR =  p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id
     AND    TABLE_NAME IS NOT NULL; -- need to check if actual KPI Tables are there
Line: 669

        l_Delete_Kpi_b := FALSE;
Line: 672

  IF l_Delete_Kpi_b THEN
       DELETE FROM BSC_KPIS_B
       WHERE  INDICATOR = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 676

       DELETE FROM BSC_KPIS_TL
       WHERE  INDICATOR = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 679

       UPDATE   BSC_KPIS_B
       SET      PROTOTYPE_FLAG = BSC_KPI_PUB.DELETE_KPI_FLAG
       WHERE    INDICATOR      = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 715

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Delete_Kpi ';
Line: 717

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Delete_Kpi ';
Line: 725

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Delete_Kpi ';
Line: 727

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Delete_Kpi ';
Line: 731

end Delete_Kpi;
Line: 985

procedure Update_Kpi_Defaults(
  p_commit              IN      varchar2 := FND_API.G_FALSE
 ,p_Bsc_Kpi_Entity_Rec  IN      BSC_KPI_PUB.Bsc_Kpi_Entity_Rec
 ,x_return_status       OUT NOCOPY     varchar2
 ,x_msg_count           OUT NOCOPY     number
 ,x_msg_data            OUT NOCOPY     varchar2
) is


begin
  FND_MSG_PUB.Initialize;
Line: 1026

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Update_Kpi_Defaults ';
Line: 1028

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Update_Kpi_Defaults ';
Line: 1035

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Update_Kpi_Defaults ';
Line: 1037

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Update_Kpi_Defaults ';
Line: 1041

end Update_Kpi_Defaults;
Line: 1046

procedure Delete_Kpi_Defaults(
  p_commit              IN      varchar2 := FND_API.G_FALSE
 ,p_Bsc_Kpi_Entity_Rec  IN      BSC_KPI_PUB.Bsc_Kpi_Entity_Rec
 ,x_return_status       OUT NOCOPY     varchar2
 ,x_msg_count           OUT NOCOPY     number
 ,x_msg_data            OUT NOCOPY     varchar2
) is

begin
  FND_MSG_PUB.Initialize;
Line: 1084

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Delete_Kpi_Defaults ';
Line: 1086

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Delete_Kpi_Defaults ';
Line: 1093

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Delete_Kpi_Defaults ';
Line: 1095

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Delete_Kpi_Defaults ';
Line: 1099

end Delete_Kpi_Defaults;
Line: 1140

  insert into BSC_KPI_PROPERTIES( indicator
                                 ,property_code
                                 ,property_value
                                 ,secondary_value)
                          values( p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id
                                 ,p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Property_Code
                                 ,p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Property_Value
                                 ,p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Secondary_Value);
Line: 1179

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Delete_Kpi_Defaults ';
Line: 1181

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Delete_Kpi_Defaults ';
Line: 1224

  select distinct  property_value
                  ,secondary_value
             into  x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Property_Value
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Secondary_Value
             from  BSC_KPI_PROPERTIES
            where indicator = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id
              and property_code = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Property_Code;
Line: 1276

procedure Update_Kpi_Properties(
  p_commit              IN      varchar2 := FND_API.G_FALSE
 ,p_Bsc_Kpi_Entity_Rec  IN      BSC_KPI_PUB.Bsc_Kpi_Entity_Rec
 ,x_return_status       OUT NOCOPY     varchar2
 ,x_msg_count           OUT NOCOPY     number
 ,x_msg_data            OUT NOCOPY     varchar2
) is

l_Bsc_Kpi_Entity_Rec            BSC_KPI_PUB.Bsc_Kpi_Entity_Rec;
Line: 1333

  update BSC_KPI_PROPERTIES
     set  property_value = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Property_Value
         ,secondary_value = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Secondary_Value
   where indicator = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id
     and property_code = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Property_Code;
Line: 1369

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Update_Kpi_Properties ';
Line: 1371

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Update_Kpi_Properties ';
Line: 1379

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Update_Kpi_Properties ';
Line: 1381

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Update_Kpi_Properties ';
Line: 1385

end Update_Kpi_Properties;
Line: 1390

procedure Delete_Kpi_Properties(
  p_commit              IN      varchar2 := FND_API.G_FALSE
 ,p_Bsc_Kpi_Entity_Rec  IN      BSC_KPI_PUB.Bsc_Kpi_Entity_Rec
 ,x_return_status       OUT NOCOPY     varchar2
 ,x_msg_count           OUT NOCOPY     number
 ,x_msg_data            OUT NOCOPY     varchar2
) is

l_count             number;
Line: 1422

  delete from BSC_KPI_PROPERTIES
   where indicator = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 1454

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Delete_Kpi_Properties ';
Line: 1456

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Delete_Kpi_Properties ';
Line: 1464

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Delete_Kpi_Properties ';
Line: 1466

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Delete_Kpi_Properties ';
Line: 1470

end Delete_Kpi_Properties;
Line: 1515

  insert into BSC_KPI_ANALYSIS_GROUPS( INDICATOR
                                      ,ANALYSIS_GROUP_ID
                                      ,NUM_OF_OPTIONS
                                      ,DEPENDENCY_FLAG
                                      ,PARENT_ANALYSIS_ID
                                      ,CHANGE_DIM_SET
                                      ,DEFAULT_VALUE
                                      ,SHORT_NAME)
                               values( p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id
                                      ,p_Bsc_Kpi_Entity_Rec.Bsc_Anal_Group_Id
                                      ,p_Bsc_Kpi_Entity_Rec.Bsc_Num_Options
                                      ,p_Bsc_Kpi_Entity_Rec.Bsc_Dependency_Flag
                                      ,p_Bsc_Kpi_Entity_Rec.Bsc_Parent_Anal_Id
                                      ,p_Bsc_Kpi_Entity_Rec.Bsc_Change_Dim_Set
                                      ,p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Default_Value
                                      ,p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Ana_Group_Short_Name);
Line: 1609

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Delete_Kpi_Properties ';
Line: 1611

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Delete_Kpi_Properties ';
Line: 1654

    select distinct  analysis_group_id
                    ,num_of_options
                    ,dependency_flag
                    ,parent_analysis_id
                    ,change_dim_set
                    ,default_value
                    ,short_name
               into  x_Bsc_Kpi_Entity_Rec.Bsc_Anal_Group_Id
                    ,x_Bsc_Kpi_Entity_Rec.Bsc_Num_Options
                    ,x_Bsc_Kpi_Entity_Rec.Bsc_Dependency_Flag
                    ,x_Bsc_Kpi_Entity_Rec.Bsc_Parent_Anal_Id
                    ,x_Bsc_Kpi_Entity_Rec.Bsc_Change_Dim_Set
                    ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Default_Value
                    ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Ana_Group_Short_Name
               from  BSC_KPI_ANALYSIS_GROUPS
              where indicator = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id
              and   analysis_group_id = p_Bsc_Kpi_Entity_Rec.Bsc_Anal_Group_Id;
Line: 1672

    select distinct  analysis_group_id
                    ,num_of_options
                    ,dependency_flag
                    ,parent_analysis_id
                    ,change_dim_set
                    ,default_value
                    ,short_name
               into  x_Bsc_Kpi_Entity_Rec.Bsc_Anal_Group_Id
                    ,x_Bsc_Kpi_Entity_Rec.Bsc_Num_Options
                    ,x_Bsc_Kpi_Entity_Rec.Bsc_Dependency_Flag
                    ,x_Bsc_Kpi_Entity_Rec.Bsc_Parent_Anal_Id
                    ,x_Bsc_Kpi_Entity_Rec.Bsc_Change_Dim_Set
                    ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Default_Value
                    ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Ana_Group_Short_Name
               from  BSC_KPI_ANALYSIS_GROUPS
              where indicator = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 1734

procedure Update_Kpi_Analysis(
  p_commit              IN      varchar2 := FND_API.G_FALSE
 ,p_Bsc_Kpi_Entity_Rec  IN      BSC_KPI_PUB.Bsc_Kpi_Entity_Rec
 ,x_return_status       OUT NOCOPY     varchar2
 ,x_msg_count           OUT NOCOPY     number
 ,x_msg_data            OUT NOCOPY     varchar2
) is

l_Bsc_Kpi_Entity_Rec            BSC_KPI_PUB.Bsc_Kpi_Entity_Rec;
Line: 1817

    update BSC_KPI_ANALYSIS_GROUPS
       set  analysis_group_id   = l_Bsc_Kpi_Entity_Rec.Bsc_Anal_Group_Id
           ,num_of_options      = l_Bsc_Kpi_Entity_Rec.Bsc_Num_Options
           ,dependency_flag     = l_Bsc_Kpi_Entity_Rec.Bsc_Dependency_Flag
           ,parent_analysis_id  = l_Bsc_Kpi_Entity_Rec.Bsc_Parent_Anal_Id
           ,change_dim_set      = l_Bsc_Kpi_Entity_Rec.Bsc_Change_Dim_Set
           ,default_value       = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Default_Value
           ,short_name          = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Ana_Group_Short_Name
     where indicator            = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id
     AND   analysis_group_id    = l_Bsc_Kpi_Entity_Rec.Bsc_Anal_Group_Id;
Line: 1828

    update BSC_KPI_ANALYSIS_GROUPS
       set  analysis_group_id   = l_Bsc_Kpi_Entity_Rec.Bsc_Anal_Group_Id
           ,num_of_options      = l_Bsc_Kpi_Entity_Rec.Bsc_Num_Options
           ,dependency_flag     = l_Bsc_Kpi_Entity_Rec.Bsc_Dependency_Flag
           ,parent_analysis_id  = l_Bsc_Kpi_Entity_Rec.Bsc_Parent_Anal_Id
           ,change_dim_set      = l_Bsc_Kpi_Entity_Rec.Bsc_Change_Dim_Set
           ,default_value       = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Default_Value
           ,short_name          = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Ana_Group_Short_Name
     where indicator            = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 1869

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Update_Kpi_Analysis ';
Line: 1871

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Update_Kpi_Analysis ';
Line: 1879

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Update_Kpi_Analysis ';
Line: 1881

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Update_Kpi_Analysis ';
Line: 1885

end Update_Kpi_Analysis;
Line: 1890

procedure Delete_Kpi_Analysis(
  p_commit              IN      varchar2 := FND_API.G_FALSE
 ,p_Bsc_Kpi_Entity_Rec  IN      BSC_KPI_PUB.Bsc_Kpi_Entity_Rec
 ,x_return_status       OUT NOCOPY     varchar2
 ,x_msg_count           OUT NOCOPY     number
 ,x_msg_data            OUT NOCOPY     varchar2
) is

l_count                         number;
Line: 1922

  DELETE
  FROM  bsc_kpi_analysis_groups
  WHERE indicator = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 1926

  DELETE
  FROM  bsc_kpi_analysis_options_b
  WHERE indicator = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 1930

  DELETE
  FROM  bsc_kpi_analysis_options_tl
  WHERE indicator = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 1934

  DELETE
  FROM  bsc_kpi_analysis_measures_b
  WHERE indicator = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 1938

  DELETE
  FROM  bsc_kpi_analysis_measures_tl
  WHERE indicator = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 1942

  DELETE
  FROM  bsc_kpi_analysis_opt_user
  WHERE indicator = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 1976

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Delete_Kpi_Analysis ';
Line: 1978

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Delete_Kpi_Analysis ';
Line: 1986

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Delete_Kpi_Analysis ';
Line: 1988

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Delete_Kpi_Analysis ';
Line: 1992

end Delete_Kpi_Analysis;
Line: 1997

procedure Delete_Objective_Color_Data(
  p_commit              IN      varchar2 := FND_API.G_FALSE
 ,p_Bsc_Kpi_Entity_Rec  IN      BSC_KPI_PUB.Bsc_Kpi_Entity_Rec
 ,x_return_status       OUT NOCOPY     varchar2
 ,x_msg_count           OUT NOCOPY     number
 ,x_msg_data            OUT NOCOPY     varchar2
) is

l_count                         number;
Line: 2029

    bsc_kpi_measure_props_pub.Delete_Obj_Kpi_Measure_Props (
       p_commit          =>   FND_API.G_FALSE
      ,p_objective_id    =>   p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id
      ,p_cascade_shared  =>   FALSE
      ,x_return_status   =>   x_return_status
      ,x_msg_count       =>   x_msg_count
      ,x_msg_data        =>   x_Msg_Data
    );
Line: 2041

    bsc_color_ranges_pub.Delete_Color_Prop_Ranges (
       p_commit          =>   FND_API.G_FALSE
      ,p_objective_id    =>   p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id
      ,p_kpi_measure_id  =>   NULL
      ,p_cascade_shared  =>   FALSE
      ,x_return_status   =>   x_return_status
      ,x_msg_count       =>   x_msg_count
      ,x_msg_data        =>   x_Msg_Data
    );
Line: 2092

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Delete_Objective_Color_Data ';
Line: 2094

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Delete_Objective_Color_Data ';
Line: 2101

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Delete_Objective_Color_Data ';
Line: 2103

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Delete_Objective_Color_Data ';
Line: 2106

end Delete_Objective_Color_Data;
Line: 2168

  select count(display_order)
    into l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Periodicity_Display
    from BSC_KPI_PERIODICITIES
   where indicator = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 2175

  insert into BSC_KPI_PERIODICITIES( indicator
                                    ,periodicity_id
                                    ,display_order
                                    ,previous_years
                                    ,num_of_years
                                    ,viewport_flag
                                    ,viewport_default_size
                                    ,user_level0
                                    ,user_level1
                                    ,user_level1_default
                                    ,user_level2
                                    ,user_level2_default
                                    ,current_period
                                    ,last_update_date)
                             values( l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id
                                    ,l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Periodicity_Id
                                    ,l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Periodicity_Display
                                    ,l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Previous_Years
                                    ,l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Num_Years
                                    ,l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Viewport_Flag
                                    ,l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Viewport_Default_Size
                                    ,l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_User_Level0
                                    ,l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_User_Level1
                                    ,l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_User_Level1_Default
                                    ,l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_User_Level2
                                    ,l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_User_Level2_Default
                                    ,l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Current_Period
                                    ,sysdate);
Line: 2278

  select distinct  display_order
                  ,previous_years
                  ,num_of_years
                  ,viewport_flag
                  ,viewport_default_size
                  ,user_level0
                  ,user_level1
                  ,user_level1_default
                  ,user_level2
                  ,user_level2_default
                  ,current_period
                  ,last_update_date
             into  x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Periodicity_Display
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Previous_Years
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Num_Years
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Viewport_Flag
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Viewport_Default_Size
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_User_Level0
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_User_Level1
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_User_Level1_Default
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_User_Level2
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_User_Level2_Default
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Current_Period
                  ,x_Bsc_Kpi_Entity_Rec.Last_Update_Date
             from  BSC_KPI_PERIODICITIES
            where indicator = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id
              and periodicity_id = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Periodicity_Id;
Line: 2350

procedure Update_Kpi_Periodicity(
  p_commit              IN      varchar2 := FND_API.G_FALSE
 ,p_Bsc_Kpi_Entity_Rec  IN      BSC_KPI_PUB.Bsc_Kpi_Entity_Rec
 ,x_return_status       OUT NOCOPY     varchar2
 ,x_msg_count           OUT NOCOPY     number
 ,x_msg_data            OUT NOCOPY     varchar2
) is

l_Bsc_Kpi_Entity_Rec            BSC_KPI_PUB.Bsc_Kpi_Entity_Rec;
Line: 2433

  if p_Bsc_Kpi_Entity_Rec.Last_Update_Date is not null then
    l_Bsc_Kpi_Entity_Rec.Last_Update_Date := p_Bsc_Kpi_Entity_Rec.Last_Update_Date;
Line: 2437

  update BSC_KPI_PERIODICITIES
     set  display_order = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Periodicity_Display
         ,previous_years = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Previous_Years
         ,num_of_years = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Num_Years
         ,viewport_flag = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Viewport_Flag
         ,viewport_default_size = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Viewport_Default_Size
         ,user_level0 = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_User_Level0
         ,user_level1 = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_User_Level1
         ,user_level1_default = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_User_Level1_Default
         ,user_level2 = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_User_Level2
         ,user_level2_default = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_User_Level2_Default
         ,current_period = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Current_Period
         ,last_update_date = l_Bsc_Kpi_Entity_Rec.Last_Update_Date
   where indicator = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id
     and periodicity_id = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Periodicity_Id;
Line: 2483

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Update_Kpi_Periodicity ';
Line: 2485

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Update_Kpi_Periodicity ';
Line: 2493

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Update_Kpi_Periodicity ';
Line: 2495

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Update_Kpi_Periodicity ';
Line: 2499

end Update_Kpi_Periodicity;
Line: 2504

procedure Delete_Kpi_Periodicity(
  p_commit              IN      varchar2 := FND_API.G_FALSE
 ,p_Bsc_Kpi_Entity_Rec  IN      BSC_KPI_PUB.Bsc_Kpi_Entity_Rec
 ,x_return_status       OUT NOCOPY     varchar2
 ,x_msg_count           OUT NOCOPY     number
 ,x_msg_data            OUT NOCOPY     varchar2
) is

l_count                         number;
Line: 2536

  delete from BSC_KPI_PERIODICITIES
   where indicator = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 2568

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Delete_Kpi_Periodicity ';
Line: 2570

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Delete_Kpi_Periodicity ';
Line: 2578

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Delete_Kpi_Periodicity ';
Line: 2580

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Delete_Kpi_Periodicity ';
Line: 2585

end Delete_Kpi_Periodicity;
Line: 2626

  insert into BSC_KPI_DATA_TABLES( indicator
                                  ,periodicity_id
                                  ,dim_set_id
                                  ,level_comb
                                  ,table_name
                                  ,filter_condition)
                           values( p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id
                                  ,p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Periodicity_Id
                                  ,p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Set_Id
                                  ,p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Level_Comb
                                  ,p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Table_Name
                                  ,p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Filter_Condition);
Line: 2712

  select distinct  level_comb
                  ,table_name
                  ,filter_condition
            into   x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Level_Comb
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Table_Name
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Filter_Condition
            from   BSC_KPI_DATA_TABLES
           where indicator = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id
             and dim_set_id = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Set_Id
             and periodicity_id = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Periodicity_Id;
Line: 2768

procedure Update_Kpi_Data_Tables(
  p_commit              IN      varchar2 := FND_API.G_FALSE
 ,p_Bsc_Kpi_Entity_Rec  IN      BSC_KPI_PUB.Bsc_Kpi_Entity_Rec
 ,x_return_status       OUT NOCOPY     varchar2
 ,x_msg_count           OUT NOCOPY     number
 ,x_msg_data            OUT NOCOPY     varchar2
) is

l_Bsc_Kpi_Entity_Rec            BSC_KPI_PUB.Bsc_Kpi_Entity_Rec;
Line: 2829

  update BSC_KPI_DATA_TABLES
     set level_comb = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Level_Comb
        ,table_name = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Table_Name
        ,filter_condition = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Filter_Condition
   where indicator = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id
     and dim_set_id = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Set_Id
     and periodicity_id = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Periodicity_Id;
Line: 2866

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Update_Kpi_Data_Tables ';
Line: 2868

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Update_Kpi_Data_Tables ';
Line: 2876

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Update_Kpi_Data_Tables ';
Line: 2878

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Update_Kpi_Data_Tables ';
Line: 2882

end Update_Kpi_Data_Tables;
Line: 2887

procedure Delete_Kpi_Data_Tables(
  p_commit              IN      varchar2 := FND_API.G_FALSE
 ,p_Bsc_Kpi_Entity_Rec  IN      BSC_KPI_PUB.Bsc_Kpi_Entity_Rec
 ,x_return_status       OUT NOCOPY     varchar2
 ,x_msg_count           OUT NOCOPY     number
 ,x_msg_data            OUT NOCOPY     varchar2
) is

l_count             number;
Line: 2896

l_Delete_Kpi_Data   BOOLEAN := TRUE;
Line: 2923

     SELECT COUNT(INDICATOR)
     INTO   l_count
     FROM   BSC_KPI_DATA_TABLES
     WHERE  INDICATOR = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id
     AND TABLE_NAME IS NOT NULL; -- need to check if actual KPI Tables are there
Line: 2930

        l_Delete_Kpi_Data := FALSE;
Line: 2936

  IF (l_Delete_Kpi_Data) THEN

     DELETE FROM BSC_KPI_DATA_TABLES
     WHERE  INDICATOR = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 2973

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Delete_Kpi_Data_Tables ';
Line: 2975

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Delete_Kpi_Data_Tables ';
Line: 2983

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Delete_Kpi_Data_Tables ';
Line: 2985

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Delete_Kpi_Data_Tables ';
Line: 2989

end Delete_Kpi_Data_Tables;
Line: 3030

  insert into BSC_KPI_CALCULATIONS( indicator
                                   ,calculation_id
                                   ,user_level0
                                   ,user_level1
                                   ,user_level1_default
                                   ,user_level2
                                   ,user_level2_default
                                   ,default_value)
                            values( p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id
                                   ,p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Calculation_Id
                                   ,p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_User_Level0
                                   ,p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_User_Level1
                                   ,p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_User_Level1_Default
                                   ,p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_User_Level2
                                   ,p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_User_Level2_Default
                                   ,p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Default_Value);
Line: 3119

  select distinct  user_level0
                  ,user_level1
                  ,user_level1_default
                  ,user_level2
                  ,user_level2_default
                  ,default_value
             into  x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_User_Level0
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_User_Level1
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_User_Level1_Default
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_User_Level2
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_User_Level2_Default
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Default_Value
             from  BSC_KPI_CALCULATIONS
            where indicator = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id
              and calculation_id = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Calculation_Id;
Line: 3179

procedure Update_Kpi_Calculations(
  p_commit              IN      varchar2 := FND_API.G_FALSE
 ,p_Bsc_Kpi_Entity_Rec  IN      BSC_KPI_PUB.Bsc_Kpi_Entity_Rec
 ,x_return_status       OUT NOCOPY     varchar2
 ,x_msg_count           OUT NOCOPY     number
 ,x_msg_data            OUT NOCOPY     varchar2
) is

l_Bsc_Kpi_Entity_Rec            BSC_KPI_PUB.Bsc_Kpi_Entity_Rec;
Line: 3265

  update BSC_KPI_CALCULATIONS
     set  user_level0 = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_User_Level0
         ,user_level1 = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_User_Level1
         ,user_level1_default = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_User_Level1_Default
         ,user_level2 = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_User_Level2
         ,user_level2_default = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_User_Level2_Default
         ,default_value = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Default_Value
   where indicator = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id
     and calculation_id = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Calculation_Id;
Line: 3304

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Update_Kpi_Calculations ';
Line: 3306

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Update_Kpi_Calculations ';
Line: 3314

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Update_Kpi_Calculations ';
Line: 3316

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Update_Kpi_Calculations ';
Line: 3320

end Update_Kpi_Calculations;
Line: 3325

procedure Delete_Kpi_Calculations(
  p_commit              IN      varchar2 := FND_API.G_FALSE
 ,p_Bsc_Kpi_Entity_Rec  IN      BSC_KPI_PUB.Bsc_Kpi_Entity_Rec
 ,x_return_status       OUT NOCOPY     varchar2
 ,x_msg_count           OUT NOCOPY     number
 ,x_msg_data            OUT NOCOPY     varchar2
) is

l_count             number;
Line: 3357

  DELETE
  FROM  bsc_kpi_calculations
  WHERE indicator = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 3361

  DELETE
  FROM  bsc_kpi_calculations_user
  WHERE indicator = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 3394

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Delete_Kpi_Calculations ';
Line: 3396

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Delete_Kpi_Calculations ';
Line: 3404

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Delete_Kpi_Calculations ';
Line: 3406

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Delete_Kpi_Calculations ';
Line: 3410

end Delete_Kpi_Calculations;
Line: 3452

  insert into BSC_USER_KPI_ACCESS( responsibility_id
                                  ,indicator
                                  ,creation_date
                                  ,created_by
                                  ,last_update_date
                                  ,last_updated_by
                                  ,last_update_login
                                  ,start_date
                                  ,end_date)
                           values( p_Bsc_Kpi_Entity_Rec.Bsc_Responsibility_Id
                                  ,p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id
                                  ,sysdate
                                  ,p_Bsc_Kpi_Entity_Rec.Created_By
                                  ,sysdate
                                  ,p_Bsc_Kpi_Entity_Rec.Last_Updated_By
                                  ,p_Bsc_Kpi_Entity_Rec.Last_Update_Login
                                  ,p_Bsc_Kpi_Entity_Rec.Bsc_Resp_Start_Date
                                  ,p_Bsc_Kpi_Entity_Rec.Bsc_Resp_End_Date);
Line: 3547

  select distinct  responsibility_id
                  ,creation_date
                  ,created_by
                  ,last_update_date
                  ,last_updated_by
                  ,last_update_login
                  ,start_date
                  ,end_date
             into  x_Bsc_Kpi_Entity_Rec.Bsc_Responsibility_Id
                  ,x_Bsc_Kpi_Entity_Rec.Creation_Date
                  ,x_Bsc_Kpi_Entity_Rec.Created_By
                  ,x_Bsc_Kpi_Entity_Rec.Last_Update_Date
                  ,x_Bsc_Kpi_Entity_Rec.Last_Updated_By
                  ,x_Bsc_Kpi_Entity_Rec.Last_Update_Login
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Resp_Start_Date
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Resp_End_Date
             from  BSC_USER_KPI_ACCESS
            where indicator = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id
              and responsibility_id = p_Bsc_Kpi_Entity_Rec.Bsc_Responsibility_Id;
Line: 3613

procedure Update_Kpi_User_Access(
  p_commit              IN      varchar2 := FND_API.G_FALSE
 ,p_Bsc_Kpi_Entity_Rec  IN      BSC_KPI_PUB.Bsc_Kpi_Entity_Rec
 ,x_return_status       OUT NOCOPY     varchar2
 ,x_msg_count           OUT NOCOPY     number
 ,x_msg_data            OUT NOCOPY     varchar2
) is

l_Bsc_Kpi_Entity_Rec            BSC_KPI_PUB.Bsc_Kpi_Entity_Rec;
Line: 3670

  if p_Bsc_Kpi_Entity_Rec.Last_Update_Date is not null then
    l_Bsc_Kpi_Entity_Rec.Last_Update_Date := p_Bsc_Kpi_Entity_Rec.Last_Update_Date;
Line: 3673

  if p_Bsc_Kpi_Entity_Rec.Last_Updated_By is not null then
    l_Bsc_Kpi_Entity_Rec.Last_Updated_By := p_Bsc_Kpi_Entity_Rec.Last_Updated_By;
Line: 3676

  if p_Bsc_Kpi_Entity_Rec.Last_Update_Login is not null then
    l_Bsc_Kpi_Entity_Rec.Last_Update_Login := p_Bsc_Kpi_Entity_Rec.Last_Update_Login;
Line: 3686

  update BSC_USER_KPI_ACCESS
     set  responsibility_id = l_Bsc_Kpi_Entity_Rec.Bsc_Responsibility_Id
         ,creation_date = l_Bsc_Kpi_Entity_Rec.Creation_Date
         ,created_by = l_Bsc_Kpi_Entity_Rec.Created_By
         ,last_update_date = l_Bsc_Kpi_Entity_Rec.Last_Update_Date
         ,last_updated_by = l_Bsc_Kpi_Entity_Rec.Last_Updated_By
         ,last_update_login = l_Bsc_Kpi_Entity_Rec.Last_Update_Login
         ,start_date = l_Bsc_Kpi_Entity_Rec.Bsc_Resp_Start_Date
         ,end_date = l_Bsc_Kpi_Entity_Rec.Bsc_Resp_End_Date
   where indicator = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 3726

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Update_Kpi_User_Access ';
Line: 3728

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Update_Kpi_User_Access ';
Line: 3736

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Update_Kpi_User_Access ';
Line: 3738

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Update_Kpi_User_Access ';
Line: 3742

end Update_Kpi_User_Access;
Line: 3747

procedure Delete_Kpi_User_Access(
  p_commit              IN      varchar2 := FND_API.G_FALSE
 ,p_Bsc_Kpi_Entity_Rec  IN      BSC_KPI_PUB.Bsc_Kpi_Entity_Rec
 ,x_return_status       OUT NOCOPY     varchar2
 ,x_msg_count           OUT NOCOPY     number
 ,x_msg_data            OUT NOCOPY     varchar2
) is

l_count             number;
Line: 3779

  delete from BSC_USER_KPI_ACCESS
   where indicator = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 3811

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Delete_Kpi_User_Access ';
Line: 3813

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Delete_Kpi_User_Access ';
Line: 3821

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Delete_Kpi_User_Access ';
Line: 3823

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Delete_Kpi_User_Access ';
Line: 3827

end Delete_Kpi_User_Access;
Line: 3878

  insert into BSC_KPI_DEFAULTS_B( tab_id
                               ,indicator
                               ,format_mask
                               ,color_method
                               ,dim_set_id
                               ,dim_level1_value
                               ,dim_level2_value
                               ,dim_level3_value
                               ,dim_level4_value
                               ,dim_level5_value
                               ,dim_level6_value
                               ,dim_level7_value
                               ,dim_level8_value
                               ,last_update_date
                               ,last_updated_by
                               ,creation_date
                               ,created_by
                               ,last_update_login
                               ,measure_source)
                        values( -1
                               ,l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id
                               ,l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Format_Mask
                               ,l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Color_Method
                               ,l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Set_Id
                               ,l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level1_Value
                               ,l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level2_Value
                               ,l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level3_Value
                               ,l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level4_Value
                               ,l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level5_Value
                               ,l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level6_Value
                               ,l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level7_Value
                               ,l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level8_Value
                               ,sysdate
                               ,l_Bsc_Kpi_Entity_Rec.Last_Updated_By
                               ,sysdate
                               ,l_Bsc_Kpi_Entity_Rec.Created_By
                               ,l_Bsc_Kpi_Entity_Rec.Last_Update_Login
                               ,l_Bsc_Kpi_Entity_Rec.Bsc_Measure_Source);
Line: 3919

  insert into BSC_KPI_DEFAULTS_TL( tab_id
                                  ,indicator
                                  ,language
                                  ,source_lang
                                  ,analysis_option0_name
                                  ,analysis_option1_name
                                  ,analysis_option2_name
                                  ,period_name
                                  ,series_name
                                  ,dim_level1_name
                                  ,dim_level2_name
                                  ,dim_level3_name
                                  ,dim_level4_name
                                  ,dim_level5_name
                                  ,dim_level6_name
                                  ,dim_level7_name
                                  ,dim_level8_name
                                  ,dim_level1_text
                                  ,dim_level2_text
                                  ,dim_level3_text
                                  ,dim_level4_text
                                  ,dim_level5_text
                                  ,dim_level6_text
                                  ,dim_level7_text
                                  ,dim_level8_text)
                             SELECT     -1
                                    ,   l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id
                                    ,   L.LANGUAGE_CODE
                                    ,   USERENV('LANG')
                                    ,   l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Anal_Opt0_Name
                                    ,   l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Anal_Opt1_Name
                                    ,   l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Anal_Opt2_Name
                                    ,   l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Period_Name
                                    ,   l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Series_Name
                                    ,   l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level1_Name
                                    ,   l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level2_Name
                                    ,   l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level3_Name
                                    ,   l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level4_Name
                                    ,   l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level5_Name
                                    ,   l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level6_Name
                                    ,   l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level7_Name
                                    ,   l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level8_Name
                                    ,   l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level1_Text
                                    ,   l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level2_Text
                                    ,   l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level3_Text
                                    ,   l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level4_Text
                                    ,   l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level5_Text
                                    ,   l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level6_Text
                                    ,   l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level7_Text
                                    ,   l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level8_Text
                                  FROM  FND_LANGUAGES L
                                  WHERE L.INSTALLED_FLAG IN ('I', 'B')
                                  AND   NOT EXISTS
                                  ( SELECT NULL
                                    FROM   BSC_KPI_DEFAULTS_TL T
                                    WHERE  T.indicator =  l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id
                                    AND    T.LANGUAGE  = L.LANGUAGE_CODE);
Line: 4050

  select distinct  a.tab_id
                  ,a.format_mask
                  ,a.color_method
                  ,a.dim_set_id
                  ,a.dim_level1_value
                  ,a.dim_level2_value
                  ,a.dim_level3_value
                  ,a.dim_level4_value
                  ,a.dim_level5_value
                  ,a.dim_level6_value
                  ,a.dim_level7_value
                  ,a.dim_level8_value
                  ,a.last_update_date
                  ,a.last_updated_by
                  ,a.creation_date
                  ,a.created_by
                  ,a.last_update_login
                  ,a.measure_source
                  ,b.analysis_option0_name
                  ,b.analysis_option1_name
                  ,b.analysis_option2_name
                  ,b.period_name
                  ,b.series_name
                  ,b.dim_level1_name
                  ,b.dim_level2_name
                  ,b.dim_level3_name
                  ,b.dim_level4_name
                  ,b.dim_level5_name
                  ,b.dim_level6_name
                  ,b.dim_level7_name
                  ,b.dim_level8_name
                  ,b.dim_level1_text
                  ,b.dim_level2_text
                  ,b.dim_level3_text
                  ,b.dim_level4_text
                  ,b.dim_level5_text
                  ,b.dim_level6_text
                  ,b.dim_level7_text
                  ,b.dim_level8_text
             into  x_Bsc_Kpi_Entity_Rec.Bsc_Tab_Id
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Format_Mask
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Color_Method
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Set_Id
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level1_Value
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level2_Value
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level3_Value
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level4_Value
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level5_Value
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level6_Value
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level7_Value
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level8_Value
                  ,x_Bsc_Kpi_Entity_Rec.Last_Update_Date
                  ,x_Bsc_Kpi_Entity_Rec.Last_Updated_By
                  ,x_Bsc_Kpi_Entity_Rec.Creation_Date
                  ,x_Bsc_Kpi_Entity_Rec.Created_By
                  ,x_Bsc_Kpi_Entity_Rec.Last_Update_Login
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Measure_Source
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Anal_Opt0_Name
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Anal_Opt1_Name
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Anal_Opt2_Name
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Period_Name
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Series_Name
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level1_Name
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level2_Name
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level3_Name
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level4_Name
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level5_Name
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level6_Name
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level7_Name
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level8_Name
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level1_Text
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level2_Text
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level3_Text
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level4_Text
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level5_Text
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level6_Text
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level7_Text
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level8_Text
             from  BSC_KPI_DEFAULTS_B a
                   ,BSC_KPI_DEFAULTS_TL b
            where a.indicator = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id
              and a.indicator = b.indicator
              and b.language = USERENV('LANG');
Line: 4179

procedure Update_Kpi_Default_Values(
  p_commit              IN      varchar2 := FND_API.G_FALSE
 ,p_Bsc_Kpi_Entity_Rec  IN      BSC_KPI_PUB.Bsc_Kpi_Entity_Rec
 ,x_return_status       OUT NOCOPY     varchar2
 ,x_msg_count           OUT NOCOPY     number
 ,x_msg_data            OUT NOCOPY     varchar2
) is

l_Bsc_Kpi_Entity_Rec            BSC_KPI_PUB.Bsc_Kpi_Entity_Rec;
Line: 4264

  if p_Bsc_Kpi_Entity_Rec.Last_Update_Date is not null then
    l_Bsc_Kpi_Entity_Rec.Last_Update_Date := p_Bsc_Kpi_Entity_Rec.Last_Update_Date;
Line: 4267

  if p_Bsc_Kpi_Entity_Rec.Last_Updated_By is not null then
    l_Bsc_Kpi_Entity_Rec.Last_Updated_By := p_Bsc_Kpi_Entity_Rec.Last_Updated_By;
Line: 4276

  if p_Bsc_Kpi_Entity_Rec.Last_Update_Login is not null then
    l_Bsc_Kpi_Entity_Rec.Last_Update_Login := p_Bsc_Kpi_Entity_Rec.Last_Update_Login;
Line: 4346

  update BSC_KPI_DEFAULTS_B
     set  tab_id = l_Bsc_Kpi_Entity_Rec.Bsc_Tab_Id
         ,format_mask = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Format_Mask
         ,color_method = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Color_Method
         ,dim_set_id = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Set_Id
         ,dim_level1_value = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level1_Value
         ,dim_level2_value = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level2_Value
         ,dim_level3_value = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level3_Value
         ,dim_level4_value = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level4_Value
         ,dim_level5_value = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level5_Value
         ,dim_level6_value = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level6_Value
         ,dim_level7_value = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level7_Value
         ,dim_level8_value = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level8_Value
         ,last_update_date = l_Bsc_Kpi_Entity_Rec.Last_Update_Date
         ,last_updated_by = l_Bsc_Kpi_Entity_Rec.Last_Updated_By
         ,creation_date = l_Bsc_Kpi_Entity_Rec.Creation_Date
         ,created_by = l_Bsc_Kpi_Entity_Rec.Created_By
         ,last_update_login = l_Bsc_Kpi_Entity_Rec.Last_Update_Login
         ,measure_source = l_Bsc_Kpi_Entity_Rec.Bsc_Measure_Source
  where indicator = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 4367

  update BSC_KPI_DEFAULTS_TL
     set  analysis_option0_name = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Anal_Opt0_Name
         ,analysis_option1_name = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Anal_Opt1_Name
         ,analysis_option2_name = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Anal_Opt2_Name
         ,period_name = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Period_Name
         ,series_name = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Series_Name
         ,dim_level1_name = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level1_Name
         ,dim_level2_name = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level2_Name
         ,dim_level3_name = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level3_Name
         ,dim_level4_name = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level4_Name
         ,dim_level5_name = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level5_Name
         ,dim_level6_name = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level6_Name
         ,dim_level7_name = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level7_Name
         ,dim_level8_name = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level8_Name
         ,dim_level1_text = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level1_Text
         ,dim_level2_text = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level2_Text
         ,dim_level3_text = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level3_Text
         ,dim_level4_text = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level4_Text
         ,dim_level5_text = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level5_Text
         ,dim_level6_text = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level6_Text
         ,dim_level7_text = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level7_Text
         ,dim_level8_text = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Dim_Level8_Text
         ,SOURCE_LANG     = userenv('LANG')
  where indicator = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id
  and userenv('LANG') IN (LANGUAGE, SOURCE_LANG);
Line: 4422

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Update_Kpi_Default_Values ';
Line: 4424

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Update_Kpi_Default_Values ';
Line: 4432

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Update_Kpi_Default_Values ';
Line: 4434

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Update_Kpi_Default_Values ';
Line: 4439

end Update_Kpi_Default_Values;
Line: 4444

procedure Delete_Kpi_Default_Values(
  p_commit              IN      varchar2 := FND_API.G_FALSE
 ,p_Bsc_Kpi_Entity_Rec  IN      BSC_KPI_PUB.Bsc_Kpi_Entity_Rec
 ,x_return_status       OUT NOCOPY     varchar2
 ,x_msg_count           OUT NOCOPY     number
 ,x_msg_data            OUT NOCOPY     varchar2
) is

l_count             number;
Line: 4476

  delete from BSC_KPI_DEFAULTS_B
   where indicator = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 4479

  delete from BSC_KPI_DEFAULTS_TL
   where indicator = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 4511

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Delete_Kpi_Default_Values ';
Line: 4513

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Delete_Kpi_Default_Values ';
Line: 4521

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Delete_Kpi_Default_Values ';
Line: 4523

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Delete_Kpi_Default_Values ';
Line: 4527

end Delete_Kpi_Default_Values;
Line: 4601

  select count(*)
    into l_count
    from BSC_TAB_IND_GROUPS_B
   where tab_id = l_Bsc_Kpi_Entity_Rec.Bsc_Tab_Id
     and ind_group_id = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Group_Id;
Line: 4632

    l_db_object := 'Update_Kpi_Group';
Line: 4641

    BSC_KPI_GROUP_PUB.Update_Kpi_Group( p_commit
                                       ,l_Bsc_Kpi_Group_Rec
                                       ,x_return_status
                                       ,x_msg_count
                                       ,x_msg_data);
Line: 4663

  insert into BSC_TAB_INDICATORS( tab_id
                                 ,indicator
                                 ,bsc_model_flag
                                 ,left_position
                                 ,top_position
                                 ,width
                                 ,height
                                 ,backcolor)
                          values( l_Bsc_Kpi_Entity_Rec.Bsc_Tab_Id
                                 ,l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id
                                 ,l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Model_Flag
                                 ,l_Bsc_Kpi_Entity_Rec.Bsc_Left_Position_In_Tab
                                 ,l_Bsc_Kpi_Entity_Rec.Bsc_Top_Position_In_Tab
                                 ,l_Bsc_Kpi_Entity_Rec.Bsc_Group_Width
                                 ,l_Bsc_Kpi_Entity_Rec.Bsc_Group_Height
                                 ,l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Backcolor);
Line: 4682

  Update_Kpi_In_Tab( p_commit
                    ,l_Bsc_Kpi_Entity_Rec
                    ,x_return_status
                    ,x_msg_count
                    ,x_msg_data);
Line: 4764

  select distinct  tab_id
                  ,bsc_model_flag
                  ,left_position
                  ,top_position
                  ,width
                  ,height
                  ,backcolor
             into  x_Bsc_Kpi_Entity_Rec.Bsc_Tab_Id
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Model_Flag
                  -- This is not KPI Group position and size
                  -- It is KPI position and Size for Stratege Map View
                  -- Not use yet it I-Builder
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Left_Position_In_Tab
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Top_Position_In_Tab
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Group_Width
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Group_Height
                  ,x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Backcolor
             from  BSC_TAB_INDICATORS
            where indicator = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 4830

procedure Update_Kpi_In_Tab(
  p_commit              IN      varchar2 := FND_API.G_FALSE
 ,p_Bsc_Kpi_Entity_Rec  IN      BSC_KPI_PUB.Bsc_Kpi_Entity_Rec
 ,x_return_status       OUT NOCOPY     varchar2
 ,x_msg_count           OUT NOCOPY     number
 ,x_msg_data            OUT NOCOPY     varchar2
) is

l_count             number;
Line: 4869

  update BSC_KPIS_B
     set prototype_flag = nvl(p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Prototype_Flag,7)
   where indicator = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id
     and decode(prototype_flag, 0, 8, prototype_flag) > 7;
Line: 4877

  update BSC_KPI_DEFAULTS_B
     set tab_id = p_Bsc_Kpi_Entity_Rec.Bsc_Tab_Id
   where indicator = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 4883

  update BSC_KPI_DEFAULTS_TL
     set tab_id = p_Bsc_Kpi_Entity_Rec.Bsc_Tab_Id
   where indicator = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 4890

  update BSC_KPI_DIM_LEVELS_B
     set default_value = 'T'
   where (default_value like 'D%')
     and indicator =  p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 4926

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Update_Kpi_In_Tab ';
Line: 4928

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Update_Kpi_In_Tab ';
Line: 4936

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Update_Kpi_In_Tab ';
Line: 4938

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Update_Kpi_In_Tab ';
Line: 4942

end Update_Kpi_In_Tab;
Line: 4948

procedure Delete_Kpi_In_Tab(
  p_commit              IN      varchar2 := FND_API.G_FALSE
 ,p_Bsc_Kpi_Entity_Rec  IN      BSC_KPI_PUB.Bsc_Kpi_Entity_Rec
 ,x_return_status       OUT NOCOPY     varchar2
 ,x_msg_count           OUT NOCOPY     number
 ,x_msg_data            OUT NOCOPY     varchar2
) is

l_count             number;
Line: 4980

  delete from BSC_TAB_INDICATORS
   where indicator = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 5014

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Delete_Kpi_In_Tab ';
Line: 5016

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Delete_Kpi_In_Tab ';
Line: 5024

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Delete_Kpi_In_Tab ';
Line: 5026

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Delete_Kpi_In_Tab ';
Line: 5031

end Delete_Kpi_In_Tab;
Line: 5036

procedure Update_Kpi_Time_Stamp(
  p_commit              IN      varchar2 := FND_API.G_FALSE
 ,p_Bsc_Kpi_Entity_Rec  IN      BSC_KPI_PUB.Bsc_Kpi_Entity_Rec
 ,x_return_status       OUT NOCOPY     varchar2
 ,x_msg_count           OUT NOCOPY     number
 ,x_msg_data            OUT NOCOPY     varchar2
) is

begin
  FND_MSG_PUB.Initialize;
Line: 5048

  update BSC_KPIS_B
     set last_update_date = sysdate
   where indicator = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 5081

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Update_Kpi_Time_Stamp ';
Line: 5083

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Update_Kpi_Time_Stamp ';
Line: 5091

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Update_Kpi_Time_Stamp ';
Line: 5093

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Update_Kpi_Time_Stamp ';
Line: 5097

end Update_Kpi_Time_Stamp;
Line: 5183

  Update_Kpi( p_commit
             ,l_Bsc_Kpi_Entity_Rec
             ,x_return_status
             ,x_msg_count
             ,x_msg_data);
Line: 5205

  update BSC_KPI_ANALYSIS_OPTIONS_B
    set USER_LEVEL1 = USER_LEVEL0
    where indicator = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 5346

      SELECT COUNT(1) INTO l_Count
      FROM   BSC_TAB_IND_GROUPS_B
      WHERE  IND_GROUP_ID = l_x_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Group_Id;
Line: 5425

  SELECT config_type,short_name
  INTO   l_config_type,l_short_name
  FROM   bsc_kpis_vl
  WHERE  indicator = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 5448

  select decode(property_value,1,1,3)
         into l_prototype_flag
    from bsc_sys_init
   where property_code = 'SYSTEM_STAGE';
Line: 5456

  update BSC_KPIS_B
     set  share_flag = 2
         ,prototype_flag = l_prototype_flag
         ,source_indicator = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id
   where indicator = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 5469

  update BSC_KPI_ANALYSIS_OPTIONS_B
    set USER_LEVEL1 = USER_LEVEL0
    where indicator = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 5474

  /* Delete Rows in BSC_KPI_DATA_TABLES for the Share KPI
    We can not use procedure Delete_Kpi_Data_tables because of the
    validation added when the KPI is deleting */

   DELETE FROM BSC_KPI_DATA_TABLES
   WHERE  INDICATOR = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 5486

  select responsibility_id
      into l_Bsc_Kpi_Entity_Rec.Bsc_Responsibility_Id
      from FND_RESPONSIBILITY
     where responsibility_key = 'BSC_Manager';
Line: 5493

  l_Bsc_Kpi_Entity_Rec.Last_Updated_By:= 0;
Line: 5494

  l_Bsc_Kpi_Entity_Rec.Last_Update_Login:= 0;
Line: 5495

  l_Bsc_Kpi_Entity_Rec.Last_Update_Login:= 0;
Line: 5509

  /*select responsibility_id
      into l_Bsc_Kpi_Entity_Rec.Bsc_Responsibility_Id
      from FND_RESPONSIBILITY
     where responsibility_key = 'BSC_PMD_USER';
Line: 5613

  l_sql := 'select distinct tab_id, tab_index ' ||
           '  from BSC_TABS_B ' ||
           ' where tab_index >= :1' ||
           '   and tab_id !=  :2' ||
           ' order by tab_index asc';
Line: 5630

    update BSC_TABS_B
       set tab_index = l_Bsc_Kpi_Entity_Tbl(i).Bsc_Tab_Index + 1
     where tab_id = l_Bsc_Kpi_Entity_Tbl(i).Bsc_Tab_Id;
Line: 5692

  select count(*)
    into l_count
    from BSC_TABS_TL
   where upper(name) = upper(p_Tab_Name);
Line: 5716

  select count(*)
    into l_count
    from BSC_TAB_IND_GROUPS_TL
   where upper(name) = upper(p_Kpi_Group_Name);
Line: 5740

  select count(*)
    into l_count
    from BSC_KPIS_TL
   where upper(name) = upper(p_Kpi_Name);
Line: 5777

CURSOR  c_Select_Indicator IS
SELECT  INDICATOR
FROM    BSC_KPIS_B
WHERE   SOURCE_INDICATOR = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_id
AND     PROTOTYPE_FLAG <> BSC_KPI_PUB.Delete_Kpi_Flag;
Line: 5791

  select count(*)
    into l_count
    from BSC_KPI_ANALYSIS_OPTIONS_B
   where indicator = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_id
     and analysis_group_id = 0
     and user_level1 = 1;
Line: 5801

     SELECT SHARE_FLAG, PROTOTYPE_FLAG
     INTO   l_share_flag, l_proto_flag
     FROM   BSC_KPIS_B
     WHERE  INDICATOR = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_id;
Line: 5806

    if ((l_share_flag = 1) and (l_proto_flag <> BSC_KPI_PUB.DELETE_KPI_FLAG)) then

      -- Second step is to set the default option (1) by selecting the first displayed
      -- option.  At this point all displayed options are flagged with 2.
      update BSC_KPI_ANALYSIS_OPTIONS_B
         set user_level1 = 1
       where indicator = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_id
         and analysis_group_id = 0
         and option_id = (select option_id
                            from BSC_KPI_ANALYSIS_OPTIONS_B
                           where indicator = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_id
                             and user_level1 = 2
                             and rownum < 2);
Line: 5821

      select option_id
        into l_def_option
        from BSC_KPI_ANALYSIS_OPTIONS_B
       where indicator = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_id
         and analysis_group_id = 0
         and user_level1 = 1;
Line: 5829

      update BSC_KPI_ANALYSIS_GROUPS
         set default_value = l_def_option
       where indicator = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_id;
Line: 5836

      FOR SrcInd IN c_Select_Indicator LOOP
          l_shared_kpi := SrcInd.INDICATOR;
Line: 5839

          UPDATE BSC_KPI_ANALYSIS_OPTIONS_B
          SET    USER_LEVEL1 = 2
          WHERE  INDICATOR = l_shared_kpi
          AND    ANALYSIS_GROUP_ID = 0
          AND    USER_LEVEL1 = 1;
Line: 5846

          UPDATE BSC_KPI_ANALYSIS_OPTIONS_B
          SET    USER_LEVEL1 = 1
          WHERE  INDICATOR = l_shared_kpi
          AND    ANALYSIS_GROUP_ID = 0
          AND    OPTION_ID = L_DEF_OPTION;
Line: 5853

          UPDATE BSC_KPI_ANALYSIS_GROUPS
          SET    DEFAULT_VALUE = l_def_option
          WHERE  INDICATOR = l_shared_kpi;
Line: 5859

    elsif ((l_share_flag = 2) and (l_proto_flag <> BSC_KPI_PUB.DELETE_KPI_FLAG)) then-- this is a shared indicator.

      -- Get the source indicator for this shared indicator.
      select source_indicator
        into l_shared_kpi
        from BSC_KPIS_B
       where indicator = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_id;
Line: 5868

      select default_value
        into l_def_option
        from BSC_KPI_ANALYSIS_GROUPS
       where indicator = l_shared_kpi
         and analysis_group_id = 0;
Line: 5874

      update BSC_KPI_ANALYSIS_OPTIONS_B
         set user_level1 = 1
       where indicator = l_Bsc_Kpi_Entity_Rec.Bsc_Kpi_id
         and analysis_group_id = 0
         and option_id = l_def_option;
Line: 5953

    SELECT  Option_Id, Parent_Option_Id, Grandparent_Option_Id
    FROM    BSC_KPI_ANALYSIS_OPTIONS_B
    WHERE   Indicator         = p_Kpi_Id
    AND     Analysis_Group_ID = p_group_Id
    AND     User_Level0 =  1;
Line: 5960

    SELECT  Dependency_Flag, Default_Value
    INTO    l_Dependency_Flag, l_Default_Value
    FROM    BSC_KPI_ANALYSIS_GROUPS
    WHERE   Indicator         = p_Kpi_Id
    AND     Analysis_Group_Id = p_group_Id;
Line: 5980

            UPDATE  BSC_KPI_ANALYSIS_OPTIONS_B
            SET     User_Level0        =  1
                 ,  User_Level1        =  1
            WHERE   Indicator          =  p_Kpi_Id
            AND     Analysis_Group_Id  =  p_group_Id
            AND     Option_Id          =  p_option_Id;
Line: 5987

            UPDATE  BSC_KPI_ANALYSIS_GROUPS
            SET     Default_Value     =   p_option_Id
            WHERE   Indicator         =   p_Kpi_Id
            AND     Analysis_Group_Id =   p_group_Id;
Line: 5993

            UPDATE  BSC_KPI_ANALYSIS_OPTIONS_B
            SET     User_Level0        =  2
                 ,  User_Level1        =  2
            WHERE   Indicator          =  p_Kpi_Id
            AND     Analysis_Group_Id  =  p_group_Id
            AND     Option_Id          =  l_old_option_id;
Line: 6007

                UPDATE  BSC_KPI_ANALYSIS_OPTIONS_B
                SET     User_Level0        =  1
                     ,  User_Level1        =  1
                WHERE   Indicator          =  p_Kpi_Id
                AND     Analysis_Group_Id  =  p_group_Id
                AND     Option_Id          =  p_option_Id;
Line: 6014

                UPDATE  BSC_KPI_ANALYSIS_GROUPS
                SET     Default_Value     =   p_option_Id
                WHERE   Indicator         =   p_Kpi_Id
                AND     Analysis_Group_Id =   p_group_Id;
Line: 6020

                UPDATE  BSC_KPI_ANALYSIS_OPTIONS_B
                SET     User_Level0        =  2
                 ,  User_Level1            =  2
                WHERE   Indicator          =  p_Kpi_Id
                AND     Analysis_Group_Id  =  p_group_Id
                AND     Option_Id          =  l_old_option_id;
Line: 6032

                UPDATE  BSC_KPI_ANALYSIS_OPTIONS_B
                SET     User_Level0        =  1
                     ,  User_Level1        =  1
                WHERE   Indicator          =  p_Kpi_Id
                AND     Analysis_Group_Id  =  p_group_Id
                AND     Option_Id          =  p_option_Id
                AND     Parent_Option_Id   =  p_Parent_Option_Id;
Line: 6040

                UPDATE  BSC_KPI_ANALYSIS_GROUPS
                SET     Default_Value     =   p_option_Id
                WHERE   Indicator         =   p_Kpi_Id
                AND     Analysis_Group_Id =   p_group_Id;
Line: 6046

                UPDATE  BSC_KPI_ANALYSIS_OPTIONS_B
                SET     User_Level0        =  2
                     ,  User_Level1        =  2
                WHERE   Indicator          =  p_Kpi_Id
                AND     Analysis_Group_Id  =  p_group_Id
                AND     Option_Id          =  l_old_option_Id
                AND     Parent_Option_Id   =  l_old_parent_option_Id;
Line: 6060

                UPDATE  BSC_KPI_ANALYSIS_OPTIONS_B
                SET     User_Level0            =  1
                     ,  User_Level1            =  1
                WHERE   Indicator              =  p_Kpi_Id
                AND     Analysis_Group_Id      =  p_group_Id
                AND     Option_Id              =  p_option_Id
                AND     Parent_Option_Id       =  p_Parent_Option_Id
                AND     Grandparent_Option_Id  =  p_Grand_Parent_Option_Id;
Line: 6069

                UPDATE  BSC_KPI_ANALYSIS_GROUPS
                SET     Default_Value     =   p_option_Id
                WHERE   Indicator         =   p_Kpi_Id
                AND     Analysis_Group_Id =   p_group_Id;
Line: 6075

                UPDATE  BSC_KPI_ANALYSIS_OPTIONS_B
                SET     User_Level0            =  2
                     ,  User_Level1            =  2
                WHERE   Indicator              =  p_Kpi_Id
                AND     Analysis_Group_Id      =  p_group_Id
                AND     Option_Id              =  l_old_option_Id
                AND     Parent_Option_Id       =  l_old_parent_option_Id
                AND     Grandparent_Option_Id  =  l_old_grandparent_option_Id;
Line: 6123

  SELECT Source_Indicator, Prototype_Flag
  INTO   l_source_kpi, l_proto_flag
  FROM   BSC_KPIS_B
  WHERE  INDICATOR = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 6128

  IF (l_proto_flag <> BSC_KPI_PUB.Delete_Kpi_Flag) THEN
      -- Get the number of analysis groups in this or in source kpi.
      select max(analysis_group_id)
        into l_group_count
        from BSC_KPI_ANALYSIS_GROUPS
       where indicator = l_source_kpi;
Line: 6136

      select default_value
        into l_default_option
        from BSC_KPI_ANALYSIS_GROUPS
       where indicator = l_source_kpi
         and analysis_group_id = 0;
Line: 6143

      update BSC_KPI_ANALYSIS_OPTIONS_B
         set user_level1 = 1
       where indicator = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id
         and analysis_group_id = 0
         and option_id = l_default_option;
Line: 6154

      select dependency_flag, default_value
        into l_dependency1_flag, l_default_option
        from BSC_KPI_ANALYSIS_GROUPS
       where indicator = l_source_kpi
         and analysis_group_id = 1;
Line: 6163

        update BSC_KPI_ANALYSIS_OPTIONS_B
           set user_level1 = 1
         where indicator = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id
           and analysis_group_id = 1
           and option_id = l_default_option;
Line: 6171

        select default_value
          into l_default_parent_option
          from BSC_KPI_ANALYSIS_GROUPS
         where indicator = l_source_kpi
           and analysis_group_id = 0;
Line: 6177

        update BSC_KPI_ANALYSIS_OPTIONS_B
           set user_level1 = 1
         where indicator = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id
           and analysis_group_id = 1
           and option_id = l_default_option
           and parent_option_id = l_default_parent_option;
Line: 6191

        select dependency_flag, default_value
          into l_dependency2_flag, l_default_option
          from BSC_KPI_ANALYSIS_GROUPS
         where indicator = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id
           and analysis_group_id = 2;
Line: 6200

          update BSC_KPI_ANALYSIS_OPTIONS_B
              set user_level1 = 1
            where indicator = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id
              and analysis_group_id = 2
              and option_id = l_default_option;
Line: 6208

          select default_value
            into l_default_parent_option
            from BSC_KPI_ANALYSIS_GROUPS
           where indicator = l_source_kpi
             and analysis_group_id = 1;
Line: 6214

           update BSC_KPI_ANALYSIS_OPTIONS_B
              set user_level1 = 1
            where indicator = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id
              and analysis_group_id = 2
              and option_id = l_default_option
              and parent_option_id = l_default_parent_option;
Line: 6226

            update BSC_KPI_ANALYSIS_OPTIONS_B
               set user_level1 = 1
             where indicator = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id
               and analysis_group_id = 2
               and option_id = l_default_option;
Line: 6234

            select default_value
              into l_default_parent_option
              from BSC_KPI_ANALYSIS_GROUPS
             where indicator = l_source_kpi
               and analysis_group_id = 1;
Line: 6240

            select default_value
              into l_default_grandparent_option
              from BSC_KPI_ANALYSIS_GROUPS
             where indicator = l_source_kpi
               and analysis_group_id = 0;
Line: 6246

            update BSC_KPI_ANALYSIS_OPTIONS_B
               set user_level1 = 1
             where indicator = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id
               and analysis_group_id = 2
               and option_id = l_default_option
               and parent_option_id = l_default_parent_option
               and grandparent_option_id = l_default_grandparent_option;
Line: 6354

  update BSC_KPI_ANALYSIS_OPTIONS_B
     set user_level1 = user_level0
     where indicator = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id
       and analysis_group_id = p_Bsc_kpi_Entity_Rec.Bsc_kpi_Group_Id
       and option_id = l_option_id
       and parent_option_id = l_parent_option_id
       and grandparent_option_id = l_grandparent_option_id;
Line: 6469

  update BSC_KPI_ANALYSIS_OPTIONS_B
     set user_level1 = 0
     where indicator = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id
       and analysis_group_id = p_Bsc_kpi_Entity_Rec.Bsc_kpi_Group_Id
       and option_id = l_option_id
       and parent_option_id = l_parent_option_id
       and grandparent_option_id = l_grandparent_option_id
       and user_level0 > 1;
Line: 6482

    select count(option_id)
      into l_count
      from BSC_KPI_ANALYSIS_OPTIONS_B
      where indicator = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id
        and analysis_group_id = p_Bsc_kpi_Entity_Rec.Bsc_kpi_Group_Id
        and parent_option_id = l_parent_option_id
        and grandparent_option_id = l_grandparent_option_id
        and user_level1 > 0;
Line: 6563

function Is_Analysis_Option_Selected(
 p_Bsc_kpi_Entity_Rec       IN      BSC_KPI_PUB.Bsc_kpi_Entity_Rec
 ,x_return_status           OUT NOCOPY     varchar2
 ,x_msg_count               OUT NOCOPY     number
 ,x_msg_data                OUT NOCOPY     varchar2
) return varchar2 IS

 l_option_id            number;
Line: 6604

  Select count(indicator)
     into l_count
     from BSC_KPI_ANALYSIS_OPTIONS_B
     where indicator = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id
       and analysis_group_id = p_Bsc_kpi_Entity_Rec.Bsc_kpi_Group_Id
       and option_id = l_option_id
       and parent_option_id = l_parent_option_id
       and grandparent_option_id = l_grandparent_option_id
       and user_level1 <> 0;
Line: 6634

      l_temp := Is_Analysis_Option_Selected(l_Bsc_kpi_Entity_Rec
                        ,x_return_status
                        ,x_msg_count
                        ,x_msg_data);
Line: 6668

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Is_Analysis_Option_Selected ';
Line: 6670

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Is_Analysis_Option_Selected ';
Line: 6677

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Is_Analysis_Option_Selected ';
Line: 6679

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Is_Analysis_Option_Selected ';
Line: 6683

end Is_Analysis_Option_Selected;
Line: 6737

    select count(ANALYSIS_GROUP_ID)
      into  l_count
      from BSC_KPI_ANALYSIS_GROUPS
        where indicator = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id
          and PARENT_ANALYSIS_ID = p_Bsc_kpi_Entity_Rec.Bsc_kpi_Group_Id;
Line: 6756

       select count(option_id)
         into l_count_child_options
     from BSC_KPI_ANALYSIS_OPTIONS_B
     where indicator = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id
           and analysis_group_id = l_child_analysis_Group
       and parent_option_id = l_option_id
       and grandparent_option_id = l_parent_option_id;
Line: 6826

 Name : Delete_Ind_Cause_Effect_Rels
 Description : This API deletes the cause and effect relationship
                of the current indicator.
 created by  : ashankar 20-JUL-2005
/********************************************************/

PROCEDURE Delete_Ind_Cause_Effect_Rels(
  p_commit              IN            VARCHAR2 := FND_API.G_FALSE
 ,p_Bsc_Kpi_Entity_Rec  IN            BSC_KPI_PUB.BSC_KPI_ENTITY_REC
 ,x_return_status       OUT NOCOPY    VARCHAR2
 ,x_msg_count           OUT NOCOPY    NUMBER
 ,x_msg_data            OUT NOCOPY    VARCHAR2
) IS

l_count                NUMBER;
Line: 6848

    SELECT COUNT(0)
    INTO   l_count
    FROM   bsc_kpis_b
    WHERE  indicator = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 6866

  DELETE
  FROM  bsc_kpi_cause_effect_rels
  WHERE cause_indicator =p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id
  AND   NVL(cause_level,BSC_KPI_PUB.c_IND_LEVEL)=BSC_KPI_PUB.c_IND_LEVEL
  AND   NVL(effect_level,BSC_KPI_PUB.c_IND_LEVEL)=BSC_KPI_PUB.c_IND_LEVEL;
Line: 6872

  DELETE
  FROM  bsc_kpi_cause_effect_rels
  WHERE effect_indicator =p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id
  AND   NVL(cause_level,BSC_KPI_PUB.c_IND_LEVEL)=BSC_KPI_PUB.c_IND_LEVEL
  AND   NVL(effect_level,BSC_KPI_PUB.c_IND_LEVEL)=BSC_KPI_PUB.c_IND_LEVEL;
Line: 6908

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Delete_Ind_Cause_Effect_Rels ';
Line: 6910

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Delete_Ind_Cause_Effect_Rels ';
Line: 6918

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Delete_Ind_Cause_Effect_Rels ';
Line: 6920

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Delete_Ind_Cause_Effect_Rels ';
Line: 6924

END Delete_Ind_Cause_Effect_Rels;
Line: 6928

 Name : Delete_Ind_Shell_Cmds
 Description : This API deletes shell cammand entries
               of the current indicator.
 created by  : ashankar 20-JUL-2005
/********************************************************/

PROCEDURE Delete_Ind_Shell_Cmds
(
  p_commit              IN            VARCHAR2 := FND_API.G_FALSE
 ,p_Bsc_Kpi_Entity_Rec  IN            BSC_KPI_PUB.BSC_KPI_ENTITY_REC
 ,x_return_status       OUT NOCOPY    VARCHAR2
 ,x_msg_count           OUT NOCOPY    NUMBER
 ,x_msg_data            OUT NOCOPY    VARCHAR2
) IS

l_count                NUMBER;
Line: 6948

  SAVEPOINT DeleteIndShellCmds;
Line: 6951

    SELECT COUNT(0)
    INTO   l_count
    FROM   bsc_kpis_b
    WHERE  indicator = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 6969

  DELETE
  FROM  bsc_kpi_shell_cmds_tl
  WHERE indicator = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 6973

  DELETE
  FROM  bsc_kpi_shell_cmds_user
  WHERE indicator = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 6984

        ROLLBACK TO DeleteIndShellCmds;
Line: 6994

        ROLLBACK TO DeleteIndShellCmds;
Line: 7004

        ROLLBACK TO DeleteIndShellCmds;
Line: 7007

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Delete_Ind_Shell_Cmds ';
Line: 7009

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Delete_Ind_Shell_Cmds ';
Line: 7014

        ROLLBACK TO DeleteIndShellCmds;
Line: 7017

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Delete_Ind_Shell_Cmds ';
Line: 7019

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Delete_Ind_Shell_Cmds ';
Line: 7023

END Delete_Ind_Shell_Cmds;
Line: 7027

 Name : Delete_Ind_MM_Controls
 Description : This API deletes multimedia entries
               of the current indicator.
 created by  : ashankar 20-JUL-2005
/********************************************************/

PROCEDURE Delete_Ind_MM_Controls
(
  p_commit              IN            VARCHAR2 := FND_API.G_FALSE
 ,p_Bsc_Kpi_Entity_Rec  IN            BSC_KPI_PUB.BSC_KPI_ENTITY_REC
 ,x_return_status       OUT NOCOPY    VARCHAR2
 ,x_msg_count           OUT NOCOPY    NUMBER
 ,x_msg_data            OUT NOCOPY    VARCHAR2
) IS

l_count                NUMBER;
Line: 7047

  SAVEPOINT DeleteIndMMControls;
Line: 7050

    SELECT COUNT(0)
    INTO   l_count
    FROM   bsc_kpis_b
    WHERE  indicator = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 7068

  DELETE
  FROM  bsc_kpi_mm_controls
  WHERE indicator = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 7079

        ROLLBACK TO DeleteIndMMControls;
Line: 7089

        ROLLBACK TO DeleteIndMMControls;
Line: 7099

        ROLLBACK TO DeleteIndMMControls;
Line: 7102

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Delete_Ind_MM_Controls ';
Line: 7104

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Delete_Ind_MM_Controls ';
Line: 7109

        ROLLBACK TO DeleteIndMMControls;
Line: 7112

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Delete_Ind_MM_Controls ';
Line: 7114

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Delete_Ind_MM_Controls ';
Line: 7118

END Delete_Ind_MM_Controls;
Line: 7121

 Name : Delete_Ind_Subtitles
 Description : This API deletes subtitle entries of the current indicator.
 created by  : ashankar 20-JUL-2005
/********************************************************/

PROCEDURE Delete_Ind_Subtitles
(
  p_commit              IN            VARCHAR2 := FND_API.G_FALSE
 ,p_Bsc_Kpi_Entity_Rec  IN            BSC_KPI_PUB.BSC_KPI_ENTITY_REC
 ,x_return_status       OUT NOCOPY    VARCHAR2
 ,x_msg_count           OUT NOCOPY    NUMBER
 ,x_msg_data            OUT NOCOPY    VARCHAR2
) IS

l_count                NUMBER;
Line: 7140

  SAVEPOINT DeleteIndSubtitles;
Line: 7143

    SELECT COUNT(0)
    INTO   l_count
    FROM   bsc_kpis_b
    WHERE  indicator = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 7161

  DELETE
  FROM  bsc_kpi_subtitles_tl
  WHERE indicator = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 7172

        ROLLBACK TO DeleteIndSubtitles;
Line: 7182

        ROLLBACK TO DeleteIndSubtitles;
Line: 7192

        ROLLBACK TO DeleteIndSubtitles;
Line: 7195

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Delete_Ind_Subtitles ';
Line: 7197

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Delete_Ind_Subtitles ';
Line: 7202

        ROLLBACK TO DeleteIndSubtitles;
Line: 7205

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Delete_Ind_Subtitles ';
Line: 7207

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Delete_Ind_Subtitles ';
Line: 7211

END Delete_Ind_Subtitles;
Line: 7215

 Name : Delete_Ind_SeriesColors
 Description : This API deletes series colors of the current indicator.
 created by  : ashankar 20-JUL-2005
/********************************************************/

PROCEDURE Delete_Ind_SeriesColors
(
  p_commit              IN            VARCHAR2 := FND_API.G_FALSE
 ,p_Bsc_Kpi_Entity_Rec  IN            BSC_KPI_PUB.BSC_KPI_ENTITY_REC
 ,x_return_status       OUT NOCOPY    VARCHAR2
 ,x_msg_count           OUT NOCOPY    NUMBER
 ,x_msg_data            OUT NOCOPY    VARCHAR2
) IS

l_count                NUMBER;
Line: 7234

  SAVEPOINT DeleteIndSeriesColors;
Line: 7237

    SELECT COUNT(0)
    INTO   l_count
    FROM   bsc_kpis_b
    WHERE  indicator = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 7255

  DELETE
  FROM  bsc_kpi_series_colors
  WHERE indicator = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 7266

        ROLLBACK TO DeleteIndSeriesColors;
Line: 7276

        ROLLBACK TO DeleteIndSeriesColors;
Line: 7286

        ROLLBACK TO DeleteIndSeriesColors;
Line: 7289

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Delete_Ind_SeriesColors ';
Line: 7291

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Delete_Ind_SeriesColors ';
Line: 7296

        ROLLBACK TO DeleteIndSeriesColors;
Line: 7299

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Delete_Ind_SeriesColors ';
Line: 7301

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Delete_Ind_SeriesColors ';
Line: 7305

END Delete_Ind_SeriesColors;
Line: 7309

 Name : DeleteIndImages
 Description : This API deletes all the images attached with the objective.
 created by  : ashankar 20-JUL-2005
/********************************************************/

PROCEDURE Delete_Ind_Images
(
  p_commit              IN            VARCHAR2 := FND_API.G_FALSE
 ,p_Bsc_Kpi_Entity_Rec  IN            BSC_KPI_PUB.BSC_KPI_ENTITY_REC
 ,x_return_status       OUT NOCOPY    VARCHAR2
 ,x_msg_count           OUT NOCOPY    NUMBER
 ,x_msg_data            OUT NOCOPY    VARCHAR2
) IS

l_count                NUMBER;
Line: 7328

  SAVEPOINT DeleteIndImages;
Line: 7331

    SELECT COUNT(0)
    INTO   l_count
    FROM   bsc_kpis_b
    WHERE  indicator = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 7349

  DELETE
  FROM  bsc_sys_images
  WHERE image_id IN (
                     SELECT image_id
                     FROM   bsc_kpi_graphs
                     WHERE  indicator =p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id
                    );
Line: 7357

  DELETE
  FROM  bsc_kpi_graphs
  WHERE indicator=p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 7361

  DELETE
  FROM  bsc_user_kpigraph_plugs
  WHERE indicator=p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 7371

        ROLLBACK TO DeleteIndImages;
Line: 7381

        ROLLBACK TO DeleteIndImages;
Line: 7391

        ROLLBACK TO DeleteIndImages;
Line: 7394

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Delete_Ind_Images ';
Line: 7396

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Delete_Ind_Images ';
Line: 7401

        ROLLBACK TO DeleteIndImages;
Line: 7404

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Delete_Ind_Images ';
Line: 7406

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Delete_Ind_Images ';
Line: 7410

END Delete_Ind_Images;
Line: 7414

 Name : Delete_Ind_Sys_Prop
 Description : This API deletes all the system level proeprties attached to the objective
 created by  : ashankar 20-JUL-2005
/********************************************************/

PROCEDURE Delete_Ind_Sys_Prop
(
  p_commit              IN            VARCHAR2 := FND_API.G_FALSE
 ,p_Bsc_Kpi_Entity_Rec  IN            BSC_KPI_PUB.BSC_KPI_ENTITY_REC
 ,x_return_status       OUT NOCOPY    VARCHAR2
 ,x_msg_count           OUT NOCOPY    NUMBER
 ,x_msg_data            OUT NOCOPY    VARCHAR2
) IS

l_count                NUMBER;
Line: 7433

  SAVEPOINT DeleteIndSysProp;
Line: 7436

    SELECT COUNT(0)
    INTO   l_count
    FROM   bsc_kpis_b
    WHERE  indicator = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 7454

  DELETE
  FROM  bsc_sys_files
  WHERE indicator=p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 7459

  DELETE
  FROM  bsc_sys_kpi_colors
  WHERE indicator=p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 7463

  DELETE
  FROM  bsc_sys_objective_colors
  WHERE indicator=p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 7467

  DELETE
  FROM  bsc_sys_labels_b
  WHERE source_type = BSC_KPI_PUB.c_IND_TYPE
  AND   source_code = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 7472

  DELETE
  FROM  bsc_sys_labels_tl
  WHERE source_type = BSC_KPI_PUB.c_IND_TYPE
  AND   source_code = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 7477

  DELETE
  FROM  bsc_sys_lines
  WHERE source_type = BSC_KPI_PUB.c_IND_TYPE
  AND   source_code = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 7482

  DELETE
  FROM  bsc_sys_user_options
  WHERE source_type = BSC_KPI_PUB.c_IND_TYPE
  AND   source_code = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 7493

        ROLLBACK TO DeleteIndSysProp;
Line: 7503

        ROLLBACK TO DeleteIndSysProp;
Line: 7513

        ROLLBACK TO DeleteIndSysProp;
Line: 7516

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Delete_Ind_Sys_Prop ';
Line: 7518

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Delete_Ind_Sys_Prop ';
Line: 7523

        ROLLBACK TO DeleteIndSysProp;
Line: 7526

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Delete_Ind_Sys_Prop ';
Line: 7528

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Delete_Ind_Sys_Prop ';
Line: 7532

END Delete_Ind_Sys_Prop;
Line: 7536

 Name : Delete_Ind_Sys_Prop
 Description : This API deletes objective comments
 created by  : ashankar 20-JUL-2005
/********************************************************/

PROCEDURE Delete_Ind_Comments
(
  p_commit              IN            VARCHAR2 := FND_API.G_FALSE
 ,p_Bsc_Kpi_Entity_Rec  IN            BSC_KPI_PUB.BSC_KPI_ENTITY_REC
 ,x_return_status       OUT NOCOPY    VARCHAR2
 ,x_msg_count           OUT NOCOPY    NUMBER
 ,x_msg_data            OUT NOCOPY    VARCHAR2
) IS

l_count                NUMBER;
Line: 7555

  SAVEPOINT DeleteIndComments;
Line: 7558

    SELECT COUNT(0)
    INTO   l_count
    FROM   bsc_kpis_b
    WHERE  indicator = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 7576

  DELETE
  FROM  bsc_kpi_comments
  WHERE indicator=p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 7587

        ROLLBACK TO DeleteIndComments;
Line: 7597

        ROLLBACK TO DeleteIndComments;
Line: 7607

        ROLLBACK TO DeleteIndComments;
Line: 7610

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Delete_Ind_Comments ';
Line: 7612

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Delete_Ind_Comments ';
Line: 7617

        ROLLBACK TO DeleteIndComments;
Line: 7620

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Delete_Ind_Comments ';
Line: 7622

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Delete_Ind_Comments ';
Line: 7626

END Delete_Ind_Comments;
Line: 7629

 Name : Delete_Ind_Tree_Nodes
 Description : This API deletes nodes of the objectives
 created by  : ashankar 20-JUL-2005
/********************************************************/

PROCEDURE Delete_Ind_Tree_Nodes
(
  p_commit              IN            VARCHAR2 := FND_API.G_FALSE
 ,p_Bsc_Kpi_Entity_Rec  IN            BSC_KPI_PUB.BSC_KPI_ENTITY_REC
 ,x_return_status       OUT NOCOPY    VARCHAR2
 ,x_msg_count           OUT NOCOPY    NUMBER
 ,x_msg_data            OUT NOCOPY    VARCHAR2
) IS

l_count                NUMBER;
Line: 7648

  SAVEPOINT DeleteIndTreeNodes;
Line: 7651

    SELECT COUNT(0)
    INTO   l_count
    FROM   bsc_kpis_b
    WHERE  indicator = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 7669

  DELETE
  FROM  bsc_kpi_tree_nodes_b
  WHERE indicator=p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 7673

  DELETE
  FROM  bsc_kpi_tree_nodes_tl
  WHERE indicator=p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 7684

        ROLLBACK TO DeleteIndTreeNodes;
Line: 7694

        ROLLBACK TO DeleteIndTreeNodes;
Line: 7704

        ROLLBACK TO DeleteIndTreeNodes;
Line: 7707

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Delete_Ind_Tree_Nodes ';
Line: 7709

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Delete_Ind_Tree_Nodes ';
Line: 7714

        ROLLBACK TO DeleteIndTreeNodes;
Line: 7717

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Delete_Ind_Tree_Nodes ';
Line: 7719

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Delete_Ind_Tree_Nodes ';
Line: 7723

END Delete_Ind_Tree_Nodes;
Line: 7727

 Name : Delete_Ind_User_Access
 Description : This API deletes nodes of the objectives
 created by  : ashankar 20-JUL-2005
/********************************************************/

PROCEDURE Delete_Ind_User_Access
(
  p_commit              IN            VARCHAR2 := FND_API.G_FALSE
 ,p_Bsc_Kpi_Entity_Rec  IN            BSC_KPI_PUB.BSC_KPI_ENTITY_REC
 ,x_return_status       OUT NOCOPY    VARCHAR2
 ,x_msg_count           OUT NOCOPY    NUMBER
 ,x_msg_data            OUT NOCOPY    VARCHAR2
) IS

l_count                NUMBER;
Line: 7746

  SAVEPOINT DeleteIndUserAccess;
Line: 7749

    SELECT COUNT(0)
    INTO   l_count
    FROM   bsc_kpis_b
    WHERE  indicator = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 7767

  DELETE
  FROM  bsc_user_kpi_access
  WHERE indicator=p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 7778

        ROLLBACK TO DeleteIndUserAccess;
Line: 7788

        ROLLBACK TO DeleteIndUserAccess;
Line: 7798

        ROLLBACK TO DeleteIndUserAccess;
Line: 7801

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Delete_Ind_User_Access ';
Line: 7803

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Delete_Ind_User_Access ';
Line: 7808

        ROLLBACK TO DeleteIndUserAccess;
Line: 7811

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Delete_Ind_User_Access ';
Line: 7813

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Delete_Ind_User_Access ';
Line: 7817

END Delete_Ind_User_Access;
Line: 7822

 Name : Delete_Sim_Tree_Data
 Description : This API deletes Simulation Tree Data
 created by  : ashankar 20-JUL-2005
/********************************************************/

PROCEDURE Delete_Sim_Tree_Data
(
  p_commit              IN            VARCHAR2 := FND_API.G_FALSE
 ,p_Bsc_Kpi_Entity_Rec  IN            BSC_KPI_PUB.BSC_KPI_ENTITY_REC
 ,x_return_status       OUT NOCOPY    VARCHAR2
 ,x_msg_count           OUT NOCOPY    NUMBER
 ,x_msg_data            OUT NOCOPY    VARCHAR2
) IS

l_count                NUMBER;
Line: 7841

SELECT  image_id
FROM    BSC_SYS_IMAGES
WHERE   image_id NOT IN
        (  SELECT DISTINCT(image_id)
           FROM   BSC_SYS_IMAGES_MAP_TL
        );
Line: 7851

  SAVEPOINT DeleteSimTreeData;
Line: 7854

    SELECT COUNT(0)
    INTO   l_count
    FROM   bsc_kpis_b
    WHERE  indicator = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 7873

  SELECT short_name
  INTO   l_short_name
  FROM   bsc_kpis_vl
  WHERE  indicator = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 7879

  DELETE
  FROM  bsc_kpi_tree_nodes_b
  WHERE indicator=p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 7883

  DELETE
  FROM  bsc_kpi_tree_nodes_tl
  WHERE indicator=p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 7887

  DELETE
  FROM    BSC_TAB_VIEW_LABELS_B
  WHERE   tab_id =BSC_KPI_PVT.c_SIM_TAB_ID
  AND     tab_view_id = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 7893

  DELETE
  FROM    BSC_TAB_VIEW_LABELS_TL
  WHERE   tab_id =BSC_KPI_PVT.c_SIM_TAB_ID
  AND     tab_view_id = p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id;
Line: 7899

  DELETE
  FROM    BSC_SYS_IMAGES_MAP_TL
  WHERE   SOURCE_TYPE =   2
  AND     SOURCE_CODE =   p_Bsc_Kpi_Entity_Rec.Bsc_Kpi_Id
  AND     TYPE        =   BSC_SIMULATION_VIEW_PUB.c_TYPE;
Line: 7911

    DELETE
    FROM   BSC_SYS_IMAGES
    WHERE  IMAGE_ID   = l_CustView_Rec.Bsc_Image_Id;
Line: 7921

  SELECT COUNT(0)
  INTO   l_count
  FROM   ak_regions
  WHERE  region_code =l_short_name;
Line: 7929

   BIS_FORM_FUNCTIONS_PUB.DELETE_FUNCTION_AND_MENU_ENT
   (
       p_function_name   => l_short_name
      ,x_return_status   => x_return_status
      ,x_msg_count       => x_msg_count
      ,x_msg_data        => x_msg_data
    );
Line: 7941

   BIS_AK_REGION_PUB.DELETE_REGION_AND_REGION_ITEMS
   (
      p_REGION_CODE            => l_short_name
     ,p_REGION_APPLICATION_ID  => 271
     ,x_return_status          => x_return_status
     ,x_msg_count              => x_msg_count
     ,x_msg_data               => x_msg_data
   );
Line: 7964

        ROLLBACK TO DeleteSimTreeData;
Line: 7974

        ROLLBACK TO DeleteSimTreeData;
Line: 7984

        ROLLBACK TO DeleteSimTreeData;
Line: 7987

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Delete_Ind_User_Access ';
Line: 7989

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Delete_Ind_User_Access ';
Line: 7994

        ROLLBACK TO DeleteSimTreeData;
Line: 7997

            x_msg_data      :=  x_msg_data||' -> BSC_KPI_PVT.Delete_Ind_User_Access ';
Line: 7999

            x_msg_data      :=  SQLERRM||' at BSC_KPI_PVT.Delete_Ind_User_Access ';
Line: 8003

END Delete_Sim_Tree_Data;