The following lines contain the word 'select', 'insert', 'update' or 'delete':
PROCEDURE Update_Calendar_Dimension
( p_Api_Version IN NUMBER
, p_Commit IN VARCHAR2
, p_Calendar_Record IN BSC_CALENDAR_PUB.Calendar_Type_Record
, x_Return_Status OUT NOCOPY VARCHAR2
, x_Msg_Count OUT NOCOPY NUMBER
, x_Msg_Data OUT NOCOPY VARCHAR2
);
PROCEDURE Update_Calendar
( p_Api_Version IN NUMBER
, p_Commit IN VARCHAR2
, p_Calendar_Record IN BSC_CALENDAR_PUB.Calendar_Type_Record
, x_Return_Status OUT NOCOPY VARCHAR2
, x_Msg_Count OUT NOCOPY NUMBER
, x_Msg_Data OUT NOCOPY VARCHAR2
)IS
l_Calendar_Record BSC_CALENDAR_PUB.Calendar_Type_Record;
SAVEPOINT UpdateCalendarPubSP;
SELECT fiscal_year
,start_month
,start_day
,name
INTO l_Fiscal_Year
,l_Start_Month
,l_Start_Day
,l_Calendar_Old_Name
FROM bsc_sys_calendars_vl
WHERE calendar_id = p_Calendar_Record.Calendar_Id;
, p_Action => BSC_PERIODS_UTILITY_PKG.C_UPDATE
, x_Return_Status => x_Return_Status
, x_Msg_Count => x_Msg_Count
, x_Msg_Data => x_Msg_Data
);
BSC_CALENDAR_PVT.Update_Calendar
( p_Api_Version => p_Api_Version
, p_Commit => p_Commit
, p_Calendar_Record => l_Calendar_Record
, x_Return_Status => x_Return_Status
, x_Msg_Count => x_Msg_Count
, x_Msg_Data => x_Msg_Data
);
BSC_CALENDAR_PUB.Update_Calendar_Dimension
( p_Api_Version => p_Api_Version
, p_Commit => p_Commit
, p_Calendar_Record => l_Calendar_Record
, x_Return_Status => x_Return_Status
, x_Msg_Count => x_Msg_Count
, x_Msg_Data => x_Msg_Data
);
BSC_CALENDAR_PVT.Update_PeriodNames_In_Calendar
( p_Calendar_Id => p_Calendar_Record.Calendar_Id
, x_Return_Status => x_Return_Status
, x_Msg_Count => x_Msg_Count
, x_Msg_Data => x_Msg_Data
);
BSC_CALENDAR_PUB.Update_Calendar_Post_Action
( p_Api_Version => p_Api_Version
, p_Commit => p_Commit
, p_Calendar_Record => l_Calendar_Record
, x_Return_Status => x_Return_Status
, x_Msg_Count => x_Msg_Count
, x_Msg_Data => x_Msg_Data
);
ROLLBACK TO UpdateCalendarPubSP;
ROLLBACK TO UpdateCalendarPubSP;
ROLLBACK TO UpdateCalendarPubSP;
x_msg_data := x_msg_data||' -> BSC_CALENDAR_PUB.Update_Calendar ';
x_msg_data := SQLERRM||' at BSC_CALENDAR_PUB.Update_Calendar ';
ROLLBACK TO UpdateCalendarPubSP;
x_msg_data := x_msg_data||' -> BSC_CALENDAR_PUB.Update_Calendar ';
x_msg_data := SQLERRM||' at BSC_CALENDAR_PUB.Update_Calendar ';
END Update_Calendar;
PROCEDURE Delete_Calendar
( p_Api_Version IN NUMBER
, p_Commit IN VARCHAR2
, p_Calendar_Record IN BSC_CALENDAR_PUB.Calendar_Type_Record
, x_Return_Status OUT NOCOPY VARCHAR2
, x_Msg_Count OUT NOCOPY NUMBER
, x_Msg_Data OUT NOCOPY VARCHAR2
)IS
CURSOR C_Periodicity_ShortNames IS
SELECT short_name
FROM bsc_sys_periodicities
WHERE calendar_id = p_Calendar_Record.Calendar_Id;
SELECT B.level_values_view_name
FROM bsc_sys_periodicities P,
bis_levels B
WHERE b.short_name = P.short_name
AND P.calendar_id = p_Calendar_Record.Calendar_Id
AND P.db_column_name IS NOT NULL;
SELECT short_name
FROM bsc_sys_calendars_b
WHERE calendar_id = p_Calendar_Record.Calendar_Id;
SAVEPOINT DeleteCalendarPubSP;
, p_Action => BSC_PERIODS_UTILITY_PKG.C_DELETE
, x_Return_Status => x_Return_Status
, x_Msg_Count => x_Msg_Count
, x_Msg_Data => x_Msg_Data
);
BSC_BIS_DIM_OBJ_PUB.Delete_Dim_Object
( p_commit => p_commit
, p_dim_obj_short_name => CPER.short_name
, x_return_status => x_Return_Status
, x_msg_count => x_Msg_Count
, x_msg_data => x_Msg_Data
);
BSC_BIS_DIMENSION_PUB.Delete_Dimension
( p_commit => p_commit
, p_dim_short_name => l_Calendar_ShortName
, x_return_status => x_Return_Status
, x_msg_count => x_Msg_Count
, x_msg_data => x_Msg_Data
);
BSC_CALENDAR_PVT.Delete_Calendar
( p_Api_Version => p_Api_Version
, p_Commit => p_Commit
, p_Calendar_Record => p_Calendar_Record
, x_Return_Status => x_Return_Status
, x_Msg_Count => x_Msg_Count
, x_Msg_Data => x_Msg_Data
);
ROLLBACK TO DeleteCalendarPubSP;
ROLLBACK TO DeleteCalendarPubSP;
ROLLBACK TO DeleteCalendarPubSP;
x_msg_data := x_msg_data||' -> BSC_CALENDAR_PUB.Delete_Calendar ';
x_msg_data := SQLERRM||' at BSC_CALENDAR_PUB.Delete_Calendar ';
ROLLBACK TO DeleteCalendarPubSP;
x_msg_data := x_msg_data||' -> BSC_CALENDAR_PUB.Delete_Calendar ';
x_msg_data := SQLERRM||' at BSC_CALENDAR_PUB.Delete_Calendar ';
END Delete_Calendar;
SELECT k.name
FROM bsc_kpis_vl K
WHERE K.calendar_id = p_Calendar_Record.Calendar_Id;
IF(p_Action = BSC_PERIODS_UTILITY_PKG.C_CREATE OR p_Action = BSC_PERIODS_UTILITY_PKG.C_UPDATE) THEN
IF(BIS_UTILITIES_PVT.Value_Missing_Or_Null(p_Calendar_Record.Name) = FND_API.G_TRUE) THEN
FND_MESSAGE.SET_NAME('BSC','BSC_CALENDAR_NAME_NULL');
SELECT COUNT(1)
INTO l_count
FROM bsc_sys_calendars_b
WHERE TRIM(calendar_id) = TRIM(p_Calendar_Record.Calendar_Id);
SELECT COUNT(1)
INTO l_count
FROM bsc_sys_calendars_vl
WHERE TRIM(NAME) = TRIM(p_Calendar_Record.Name);
SELECT COUNT(1)
INTO l_count
FROM bsc_sys_calendars_b
WHERE TRIM(short_name) = TRIM(p_Calendar_Record.Dim_Short_Name);
ELSIF(p_Action = BSC_PERIODS_UTILITY_PKG.C_UPDATE) THEN
IF(p_Calendar_Record.Fiscal_Year IS NULL) THEN
FND_MESSAGE.SET_NAME('BSC','BSC_FISCAL_YEAR_NULL');
SELECT COUNT(1)
INTO l_count
FROM BSC_SYS_CALENDARS_B
WHERE CALENDAR_ID <> p_Calendar_Record.Calendar_Id
AND TRIM(short_name) = TRIM(p_Calendar_Record.Dim_Short_Name);
ELSIF(p_Action = BSC_PERIODS_UTILITY_PKG.C_DELETE ) THEN
l_count := 0;
SELECT COUNT(1)
INTO l_count
FROM bsc_sys_calendars_b
WHERE calendar_id = p_Calendar_Record.Calendar_Id;
SELECT COUNT(K.INDICATOR)
INTO l_count
FROM BSC_KPI_PERIODICITIES K,
BSC_SYS_PERIODICITIES S
WHERE S.PERIODICITY_ID = K.PERIODICITY_ID
AND S.CALENDAR_ID = p_Calendar_Record.Calendar_Id;
SELECT name
INTO l_Calendar_Name
FROM bsc_sys_calendars_vl
WHERE calendar_id = p_Calendar_Record.Calendar_Id;
SELECT calendar_id
, edw_flag
, edw_calendar_id
, edw_calendar_type_id
, fiscal_year
, fiscal_change
, range_yr_mod
, current_year
, start_month
, start_day
, name
, help
, created_by
, creation_date
, last_updated_by
, last_update_date
, last_update_login
INTO x_Calendar_Record.Calendar_Id
, x_Calendar_Record.Edw_Flag
, x_Calendar_Record.Edw_Calendar_Id
, x_Calendar_Record.Edw_Calendar_Type_Id
, x_Calendar_Record.Fiscal_Year
, x_Calendar_Record.Fiscal_Change
, x_Calendar_Record.Range_Yr_Mod
, x_Calendar_Record.Current_Year
, x_Calendar_Record.Start_Month
, x_Calendar_Record.Start_Day
, x_Calendar_Record.Name
, x_Calendar_Record.Help
, x_Calendar_Record.Created_By
, x_Calendar_Record.Creation_Date
, x_Calendar_Record.Last_Updated_By
, x_Calendar_Record.Last_Update_Date
, x_Calendar_Record.Last_Update_Login
FROM bsc_sys_calendars_vl
WHERE calendar_id = p_Calendar_Record.Calendar_Id;
IF(p_Calendar_Record.Last_Update_Date IS NULL ) THEN
x_Calendar_Record.Last_Update_Date := SYSDATE;
x_Calendar_Record.Last_Update_Date := p_Calendar_Record.Last_Update_Date;
IF (p_Calendar_Record.Last_Updated_By IS NULL) THEN
x_Calendar_Record.Last_Updated_By := FND_GLOBAL.USER_ID;
x_Calendar_Record.Last_Updated_By := p_Calendar_Record.Last_Updated_By;
IF (p_Calendar_Record.Last_Update_Login IS NULL) THEN
x_Calendar_Record.Last_Update_Login := FND_GLOBAL.LOGIN_ID;
x_Calendar_Record.Last_Update_Login := p_Calendar_Record.Last_Update_Login;
BSC_UPDATE_UTIL.Populate_Calendar_Tables
( p_commit => p_Commit
, p_calendar_id => p_Calendar_Record.Calendar_Id
, x_return_status => x_Return_Status
, x_msg_count => x_Msg_Count
, x_msg_data => x_Msg_Data
);
PROCEDURE Update_Calendar_Post_Action
( p_Api_Version IN NUMBER
, p_Commit IN VARCHAR2
, p_Calendar_Record IN BSC_CALENDAR_PUB.Calendar_Type_Record
, x_Return_Status OUT NOCOPY VARCHAR2
, x_Msg_Count OUT NOCOPY NUMBER
, x_Msg_Data OUT NOCOPY VARCHAR2
)IS
l_System_Stage bsc_sys_init.property_value%TYPE;
SAVEPOINT UpdateCalendarPostActionSP;
SELECT property_value
INTO l_System_Stage
from bsc_sys_init
WHERE property_code = BSC_PERIODS_UTILITY_PKG.C_SYSTEM_STAGE;
BSC_CALENDAR_PVT.Update_Fiscal_Change
( p_Api_Version => p_Api_Version
, p_Commit => p_Commit
, p_Calendar_Id => p_Calendar_Record.Calendar_Id
, x_Return_Status => x_Return_Status
, x_Msg_Count => x_Msg_Count
, x_Msg_Data => x_Msg_Data
);
BSC_UPDATE_UTIL.Populate_Calendar_Tables
( p_commit => p_Commit
, p_calendar_id => p_Calendar_Record.Calendar_Id
, x_return_status => x_Return_Status
, x_msg_count => x_Msg_Count
, x_msg_data => x_Msg_Data
);
ROLLBACK TO UpdateCalendarPostActionSP;
ROLLBACK TO UpdateCalendarPostActionSP;
ROLLBACK TO UpdateCalendarPostActionSP;
x_msg_data := x_msg_data ||'BSC_CALENDAR_PUB.Update_Calendar_Post_Action ';
x_msg_data := SQLERRM || 'at BSC_CALENDAR_PUB.Update_Calendar_Post_Action ';
ROLLBACK TO UpdateCalendarPostActionSP;
x_msg_data := x_msg_data||' -> BSC_CALENDAR_PUB.Update_Calendar_Post_Action ';
x_msg_data := SQLERRM||' at BSC_CALENDAR_PUB.Update_Calendar_Post_Action ';
END Update_Calendar_Post_Action;
SELECT DISTINCT(K.indicator)
FROM bsc_kpi_periodicities K,
bsc_sys_periodicities S
WHERE S.periodicity_id = K.periodicity_id
AND S.calendar_id = p_Calendar_Id;
BSC_DESIGNER_PVT.ActionFlag_Change(CD.indicator,BSC_DESIGNER_PVT.G_ActionFlag.Update_Update);
h_tmp_array BSC_UPDATE_UTIL.t_array_of_number;
SELECT PERIODICITY_ID
FROM BSC_SYS_PERIODICITIES
WHERE CALENDAR_ID = p_calendar_id
AND CUSTOM_CODE < p_custom_code
ORDER BY PERIODICITY_ID;
SELECT PERIODICITY_ID,SOURCE
FROM BSC_SYS_PERIODICITIES
WHERE CALENDAR_ID = p_calendar_id
ORDER BY PERIODICITY_ID;
SELECT PERIODICITY_ID
FROM BSC_SYS_PERIODICITIES
WHERE CALENDAR_ID = p_calendar_id
AND PERIODICITY_TYPE = p_periodicity_type;
SELECT NULL
, num_of_periods
, source
, num_of_subperiods
, period_col_name
, subperiod_col_name
, yearly_flag
, edw_flag
, p_Calendar_Record.Calendar_Id
, edw_periodicity_id
, custom_code
, db_column_name
, periodicity_type
, name
INTO l_Periodicity_Record.Periodicity_Id
, l_Periodicity_Record.Num_Of_Periods
, l_Periodicity_Record.Source
, l_Periodicity_Record.Num_Of_Subperiods
, l_Periodicity_Record.Period_Col_Name
, l_Periodicity_Record.Subperiod_Col_Name
, l_Periodicity_Record.Yearly_Flag
, l_Periodicity_Record.Edw_Flag
, l_Periodicity_Record.Calendar_Id
, l_Periodicity_Record.Edw_Periodicity_Id
, l_Periodicity_Record.Custom_Code
, l_Periodicity_Record.Db_Column_Name
, l_Periodicity_Record.Periodicity_Type
, l_Periodicity_Record.Name
FROM bsc_sys_periodicities_vl
WHERE periodicity_id = CD.periodicity_id;
h_count := BSC_UPDATE_UTIL.Decompose_Numeric_List(cd_new_per.source,h_tmp_array,',');
UPDATE bsc_sys_periodicities
SET source = h_new_source
WHERE periodicity_id = cd_new_per.periodicity_id;
UPDATE bsc_sys_calendars_b
SET short_name = l_Short_Name
WHERE calendar_id = p_Calendar_Record.calendar_id;
PROCEDURE Update_Calendar_Dimension
( p_Api_Version IN NUMBER
, p_Commit IN VARCHAR2
, p_Calendar_Record IN BSC_CALENDAR_PUB.Calendar_Type_Record
, x_Return_Status OUT NOCOPY VARCHAR2
, x_Msg_Count OUT NOCOPY NUMBER
, x_Msg_Data OUT NOCOPY VARCHAR2
)IS
CURSOR C_comma_objNames IS
SELECT obj_short_name
FROM bsc_bis_dim_obj_by_dim_vl
WHERE dim_short_name = p_Calendar_Record.Dim_Short_Name;
BSC_BIS_DIMENSION_PUB.Update_Dimension
( p_commit => p_Commit
, p_dim_short_name => p_Calendar_Record.Dim_Short_Name
, p_display_name => p_Calendar_Record.Name
, p_description => p_Calendar_Record.Help
, p_application_id => p_Calendar_Record.Application_Id
, p_dim_obj_short_names => l_dim_obj_shortNames
, p_time_stamp => NULL
, x_return_status => x_return_status
, x_msg_count => x_msg_count
, x_msg_data => x_msg_data
);
x_msg_data := x_msg_data||' -> BSC_CALENDAR_PUB.Update_Calendar_Dimension ';
x_msg_data := SQLERRM||' at BSC_CALENDAR_PUB.Update_Calendar_Dimension ';
x_msg_data := x_msg_data||' -> BSC_CALENDAR_PUB.Update_Calendar_Dimension ';
x_msg_data := SQLERRM||' at BSC_CALENDAR_PUB.Update_Calendar_Dimension ';
END Update_Calendar_Dimension;
SELECT indicator, name, calendar_id
FROM bsc_kpis_vl
WHERE prototype_flag = 0
AND calendar_id = p_cal_id;
SELECT day30, MONTH
FROM bsc_db_calendar
WHERE calendar_id = p_calid
AND year = p_cyear
MINUS
SELECT day30, MONTH
FROM bsc_db_calendar
WHERE calendar_id = p_calid
AND year = p_pyear;
SELECT day365
INTO x_result
FROM bsc_db_calendar
WHERE calendar_id = p_calid
AND year = p_cyear
AND day30 = lday
AND MONTH = lmonth;