hxc_timestore_deposit.DELETE_TIMECARD ( p_time_building_block_id => l_timecard_to_delete,);
p_time_building_block_id The id of the Time Building Block
Tuesday, February 14, 2012
Tuesday, February 7, 2012
Query to Get OTL Template information for particular user from Database
SELECT ProjectNumber,
TaskNumber,
attribute1,
attribute2,
attribute3,
MAX (monday) AS monday,
MAX (tuesday) AS tuesday,
MAX (wednesday) AS wednesday,
MAX (thursday) AS thursday,
MAX (friday) AS friday,
MAX (saturday) AS saturday,
MAX (sunday) AS sunday
FROM ( SELECT ProjectNumber,
start_time,
TaskNumber,
attribute1,
attribute2,
attribute3,
DECODE (TRIM (day_of_week), 'Monday', measure, NULL) AS monday,
DECODE (TRIM (day_of_week), 'Tuesday', measure, NULL)
AS tuesday,
DECODE (TRIM (day_of_week), 'Wednesday', measure, NULL)
AS wednesday,
DECODE (TRIM (day_of_week), 'Thursday', measure, NULL)
AS thursday,
DECODE (TRIM (day_of_week), 'Friday', measure, NULL) AS friday,
DECODE (TRIM (day_of_week), 'Saturday', measure, NULL)
AS saturday,
DECODE (TRIM (day_of_week), 'Sunday', measure, NULL) AS sunday
FROM (SELECT day_week.day_of_week,
Project_Id,
ProjectNumber,
measure,
start_time,
TaskNumber,
attribute1,
attribute2,
attribute3
FROM ( SELECT TRIM (TO_CHAR (SYSDATE + rown, 'Day'))
AS day_of_week
FROM (SELECT ROWNUM rown
FROM all_objects
WHERE ROWNUM < 8)
ORDER BY DECODE (
TRIM (TO_CHAR (SYSDATE + rown, 'Day')),
'Monday', 1),
DECODE (
TRIM (TO_CHAR (SYSDATE + rown, 'Day')),
'Tuesday', 2),
DECODE (
TRIM (TO_CHAR (SYSDATE + rown, 'Day')),
'Wednesday', 3),
DECODE (
TRIM (TO_CHAR (SYSDATE + rown, 'Day')),
'Thursday', 4),
DECODE (
TRIM (TO_CHAR (SYSDATE + rown, 'Day')),
'Friday', 5),
DECODE (
TRIM (TO_CHAR (SYSDATE + rown, 'Day')),
'Saturday', 6),
DECODE (
TRIM (TO_CHAR (SYSDATE + rown, 'Day')),
'Sunday', 7)) day_week,
(SELECT DISTINCT pop.project_id,
pop.project_number ProjectNumber,
details.measure,
days.start_time,
pot.task_number TaskNumber,
ta.attribute1,
ta.attribute2,
ta.attribute3
FROM hxc_time_attributes ta,
hxc_time_attribute_usages tau,
hxc_time_building_blocks days,
hxc_time_building_blocks details,
pa_online_projects_v pop,
pa_online_tasks_v pot,
pa_projects_all p,
pa_tasks t
WHERE details.resource_id = :1 --Resource_id(Person_id from per_all_people_f table)
-- AND ABS (days.start_time - TO_DATE (:2, 'YYYY/MM/DD')) <= 21
AND days.scope = 'DAY'
AND DAYS.PARENT_building_block_id =:2 --33983243 --Template_id from hxc_template_summary---37272687
AND days.date_to = hr_general.end_of_time
AND details.scope = 'DETAIL'
AND details.date_to = hr_general.end_of_time
AND details.parent_building_block_id =
days.time_building_block_id
AND details.parent_building_block_ovn =
days.object_version_number
AND tau.time_building_block_id =
details.time_building_block_id
AND tau.time_building_block_ovn =
details.object_version_number
AND tau.time_attribute_id =
ta.time_attribute_id
AND ta.attribute_category = 'PROJECTS'
AND TO_NUMBER (ta.attribute1) = pop.project_id
AND TO_NUMBER (ta.attribute2) = pot.task_id
AND pop.project_id = p.project_id
AND pot.task_id = t.task_id) QRSLT
WHERE TRIM (TO_CHAR (QRSLT.start_time(+), 'Day')) =
day_week.day_of_week)
ORDER BY projectnumber, start_time)
GROUP BY ProjectNumber,
TaskNumber,
attribute1,
attribute2,
attribute3
TaskNumber,
attribute1,
attribute2,
attribute3,
MAX (monday) AS monday,
MAX (tuesday) AS tuesday,
MAX (wednesday) AS wednesday,
MAX (thursday) AS thursday,
MAX (friday) AS friday,
MAX (saturday) AS saturday,
MAX (sunday) AS sunday
FROM ( SELECT ProjectNumber,
start_time,
TaskNumber,
attribute1,
attribute2,
attribute3,
DECODE (TRIM (day_of_week), 'Monday', measure, NULL) AS monday,
DECODE (TRIM (day_of_week), 'Tuesday', measure, NULL)
AS tuesday,
DECODE (TRIM (day_of_week), 'Wednesday', measure, NULL)
AS wednesday,
DECODE (TRIM (day_of_week), 'Thursday', measure, NULL)
AS thursday,
DECODE (TRIM (day_of_week), 'Friday', measure, NULL) AS friday,
DECODE (TRIM (day_of_week), 'Saturday', measure, NULL)
AS saturday,
DECODE (TRIM (day_of_week), 'Sunday', measure, NULL) AS sunday
FROM (SELECT day_week.day_of_week,
Project_Id,
ProjectNumber,
measure,
start_time,
TaskNumber,
attribute1,
attribute2,
attribute3
FROM ( SELECT TRIM (TO_CHAR (SYSDATE + rown, 'Day'))
AS day_of_week
FROM (SELECT ROWNUM rown
FROM all_objects
WHERE ROWNUM < 8)
ORDER BY DECODE (
TRIM (TO_CHAR (SYSDATE + rown, 'Day')),
'Monday', 1),
DECODE (
TRIM (TO_CHAR (SYSDATE + rown, 'Day')),
'Tuesday', 2),
DECODE (
TRIM (TO_CHAR (SYSDATE + rown, 'Day')),
'Wednesday', 3),
DECODE (
TRIM (TO_CHAR (SYSDATE + rown, 'Day')),
'Thursday', 4),
DECODE (
TRIM (TO_CHAR (SYSDATE + rown, 'Day')),
'Friday', 5),
DECODE (
TRIM (TO_CHAR (SYSDATE + rown, 'Day')),
'Saturday', 6),
DECODE (
TRIM (TO_CHAR (SYSDATE + rown, 'Day')),
'Sunday', 7)) day_week,
(SELECT DISTINCT pop.project_id,
pop.project_number ProjectNumber,
details.measure,
days.start_time,
pot.task_number TaskNumber,
ta.attribute1,
ta.attribute2,
ta.attribute3
FROM hxc_time_attributes ta,
hxc_time_attribute_usages tau,
hxc_time_building_blocks days,
hxc_time_building_blocks details,
pa_online_projects_v pop,
pa_online_tasks_v pot,
pa_projects_all p,
pa_tasks t
WHERE details.resource_id = :1 --Resource_id(Person_id from per_all_people_f table)
-- AND ABS (days.start_time - TO_DATE (:2, 'YYYY/MM/DD')) <= 21
AND days.scope = 'DAY'
AND DAYS.PARENT_building_block_id =:2 --33983243 --Template_id from hxc_template_summary---37272687
AND days.date_to = hr_general.end_of_time
AND details.scope = 'DETAIL'
AND details.date_to = hr_general.end_of_time
AND details.parent_building_block_id =
days.time_building_block_id
AND details.parent_building_block_ovn =
days.object_version_number
AND tau.time_building_block_id =
details.time_building_block_id
AND tau.time_building_block_ovn =
details.object_version_number
AND tau.time_attribute_id =
ta.time_attribute_id
AND ta.attribute_category = 'PROJECTS'
AND TO_NUMBER (ta.attribute1) = pop.project_id
AND TO_NUMBER (ta.attribute2) = pot.task_id
AND pop.project_id = p.project_id
AND pot.task_id = t.task_id) QRSLT
WHERE TRIM (TO_CHAR (QRSLT.start_time(+), 'Day')) =
day_week.day_of_week)
ORDER BY projectnumber, start_time)
GROUP BY ProjectNumber,
TaskNumber,
attribute1,
attribute2,
attribute3
Subscribe to:
Posts (Atom)