The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT week_start_date
FROM bom_cal_week_start_dates
WHERE calendar_code = var_calendar_code
AND exception_set_id = var_exception_set_id
AND week_start_date >=
(SELECT max(week_start_date)
FROM bom_cal_week_start_dates
WHERE week_start_date <= TRUNC(arg_start_date)
AND calendar_code = var_calendar_code
AND exception_set_id = var_exception_set_id)
ORDER BY week_start_date;
SELECT period_start_date
FROM bom_period_start_dates
WHERE calendar_code = var_calendar_code
AND exception_set_id = var_exception_set_id
AND period_start_date >=
(SELECT max(period_start_date)
FROM bom_period_start_dates
WHERE period_start_date <= var_month_start_date
AND calendar_code = var_calendar_code
AND exception_set_id = var_exception_set_id)
ORDER BY period_start_date;
| Select calendar defaults |
+-------------------------------------------------------------------------*/
mrp_calendar.select_calendar_defaults(
arg_org_id,
var_calendar_code,
var_exception_set_id);
raise_application_error(-20000, 'Cannot select week');
| Insert a row for each week... |
+---------------------------------------------------------------------*/
INSERT INTO mrp_form_query
(query_id,
date1,
last_update_date,
last_updated_by,
creation_date,
created_by,
last_update_login)
VALUES (arg_query_id,
var_week_bucket_date,
SYSDATE,
arg_user_id,
SYSDATE,
arg_user_id,
-1);
SELECT min(period_start_date)
INTO var_month_start_date
FROM bom_period_start_dates
WHERE period_start_date > var_week_bucket_date
AND calendar_code = var_calendar_code
AND exception_Set_id = var_exception_set_id;
raise_application_error(-20001, 'Cannot select month');
| Insert a row for each week... |
+---------------------------------------------------------------------*/
INSERT INTO mrp_form_query
(query_id,
date1,
last_update_date,
last_updated_by,
creation_date,
created_by,
last_update_login)
VALUES (arg_query_id,
var_month_bucket_date,
SYSDATE,
arg_user_id,
SYSDATE,
arg_user_id,
-1);
UPDATE mrp_form_query q
SET date2 =
(SELECT MIN(q2.date1)
FROM mrp_form_query q2
WHERE q2.query_id = q.query_id
AND q2.date1 > q.date1)
WHERE q.query_id = arg_query_id;
DELETE FROM mrp_form_query
WHERE query_id = arg_query_id
AND date2 IS NULL;