Per_pos_structure_elements
select ppf.employee_number , ABA.absence_days from
PER_ABSENCE_ATTENDANCES ABA,
apps.PER_ALL_PEOPLE_F ppf
where
ppf.person_id = aba.person_id
i need to get All employees numbers and absence days under specified parent_position_id
e.g parent_position_id=12450
I need to integrate this query with table(per_pos_structure_elements)
do you want the exact query?
Similar Messages
-
TWO ERRO ORA-01427: single-row subquery returns more than one row
Hi,
I have a procedure which contains a cursor. If i run the select statement in the cursor separetly, it returns only value and works fine. But the same select statement in the cursor of a procedure throws me the error as below:
TWO ERRO ORA-01427: single-row subquery returns more than one row
Not sure what going on...any help appreciated.
Below is the select statement:
SELECT DISTINCT PSE.PARENT_POSITION_ID,
(SELECT DISTINCT PPD1.SEGMENT2
FROM PER_POSITION_DEFINITIONS PPD1,
HR_ALL_POSITIONS_F HAPF2,
PER_POS_STRUCTURE_ELEMENTS PSE2
WHERE TRUNC(SYSDATE) BETWEEN
HAPF2.EFFECTIVE_START_DATE AND
HAPF2.EFFECTIVE_END_DATE
AND PPD1.POSITION_DEFINITION_ID =
HAPF2.POSITION_DEFINITION_ID
AND
HAPF2.POSITION_ID = PSE2.PARENT_POSITION_ID
AND PSE2.PARENT_POSITION_ID =
PSE.PARENT_POSITION_ID
AND ROWNUM = 1) SEGMENT2,
(SELECT DISTINCT PAPF1.FIRST_NAME || ' ' ||
PAPF1.LAST_NAME CHIEF_NAME
FROM PER_ALL_PEOPLE_F PAPF1,
PER_ALL_ASSIGNMENTS_F PAAF1
WHERE TRUNC(SYSDATE) BETWEEN
PAPF1.EFFECTIVE_START_DATE AND
PAPF1.EFFECTIVE_END_DATE
AND TRUNC(SYSDATE) BETWEEN
PAAF1.EFFECTIVE_START_DATE AND
PAAF1.EFFECTIVE_END_DATE
AND PAAF1.POSITION_ID = PSE.PARENT_POSITION_ID
AND PAPF1.PERSON_ID = PAAF1.PERSON_ID
AND ROWNUM = 1) CHIEF_NAME
FROM PER_POS_STRUCTURE_ELEMENTS PSE,
HR_ALL_POSITIONS_F HAPF,
PER_POSITION_DEFINITIONS PPD
WHERE PSE.SUBORDINATE_POSITION_ID = 52744
AND TRUNC(SYSDATE) BETWEEN HAPF.EFFECTIVE_START_DATE AND
HAPF.EFFECTIVE_END_DATE
AND HAPF.POSITION_ID = PSE.SUBORDINATE_POSITION_ID
AND HAPF.POSITION_DEFINITION_ID = PPD.POSITION_DEFINITION_ID;
Thanks
PK
Edited by: user539616 on Jun 30, 2009 6:30 PMHi,
The cursor has a different parameter? Maybe the query is not exactly the same. Could you check this?
This is your query (formatted):
SELECT DISTINCT PSE.PARENT_POSITION_ID,
(SELECT DISTINCT PPD1.SEGMENT2
FROM PER_POSITION_DEFINITIONS PPD1,
HR_ALL_POSITIONS_F HAPF2,
PER_POS_STRUCTURE_ELEMENTS PSE2
WHERE TRUNC(SYSDATE) BETWEEN HAPF2.EFFECTIVE_START_DATE AND
HAPF2.EFFECTIVE_END_DATE
AND PPD1.POSITION_DEFINITION_ID = HAPF2.POSITION_DEFINITION_ID
AND HAPF2.POSITION_ID = PSE2.PARENT_POSITION_ID
AND PSE2.PARENT_POSITION_ID = PSE.PARENT_POSITION_ID
AND ROWNUM = 1) SEGMENT2,
(SELECT DISTINCT PAPF1.FIRST_NAME || ' ' || PAPF1.LAST_NAME CHIEF_NAME
FROM PER_ALL_PEOPLE_F PAPF1,
PER_ALL_ASSIGNMENTS_F PAAF1
WHERE TRUNC(SYSDATE) BETWEEN PAPF1.EFFECTIVE_START_DATE AND
PAPF1.EFFECTIVE_END_DATE
AND TRUNC(SYSDATE) BETWEEN PAAF1.EFFECTIVE_START_DATE AND
PAAF1.EFFECTIVE_END_DATE
AND PAAF1.POSITION_ID = PSE.PARENT_POSITION_ID
AND PAPF1.PERSON_ID = PAAF1.PERSON_ID
AND ROWNUM = 1) CHIEF_NAME
FROM PER_POS_STRUCTURE_ELEMENTS PSE,
HR_ALL_POSITIONS_F HAPF,
PER_POSITION_DEFINITIONS PPD
WHERE PSE.SUBORDINATE_POSITION_ID = 52744
AND TRUNC(SYSDATE) BETWEEN HAPF.EFFECTIVE_START_DATE AND HAPF.EFFECTIVE_END_DATE
AND HAPF.POSITION_ID = PSE.SUBORDINATE_POSITION_ID
AND HAPF.POSITION_DEFINITION_ID = PPD.POSITION_DEFINITION_ID;Tips: To put formatted code you must use {noformat}{noformat} tags, start tag and end tag are the same,you don't need to put '/' in the close tag.
Regards, -
'Exists in Hierarchy' column and table name
Hi All
In Position hierarchy form .we all find exists in hierarchy flag ..when checking for
hierarchies , can any one help me ..what is the table and column name which will tell whether position exists in hierarchy or notHi,
I doubt where the exists flag is stored.
But you can derive it very easily by checking the position_id exists in (SUBORDINATE_POSITION_IS or PARENT_POSITION_ID) in table PER_POS_STRUCTURE_ELEMENTS for given structure_id.
Hope it helps.
Thanks,
Sanjay -
Hi friends,
I need urgent help. I have tried that Position Hierarchy query. If i give Bottom position id and Top position id , it should display that particular root only.
This is my query.
SELECT posname, subordinate_position_id, parent_position_id
FROM (
SELECT SYS_CONNECT_BY_PATH (pse.subordinate_position_id, '/') posname,
pse.subordinate_position_id, parent_position_id
FROM (SELECT NAME, position_id
FROM hr_all_positions_f_tl
WHERE LANGUAGE = USERENV ('LANG')) hap,
(SELECT NAME, position_id
FROM hr_all_positions_f_tl
WHERE LANGUAGE = USERENV ('LANG')) has,
per_pos_structure_elements pse
WHERE pse.business_group_id = 0
AND hap.position_id = pse.parent_position_id
AND has.position_id = pse.subordinate_position_id
START WITH pse.parent_position_id = 63--:parent_posid
CONNECT BY PRIOR pse.subordinate_position_id = pse.parent_position_id
AND PRIOR pse.pos_structure_version_id = pse.pos_structure_version_id
WHERE subordinate_position_id = 362--:subposid
Output coming like this :
Posname SUBORDINATE_POSITION_ID PARENT_POSITION_ID
/81/55/161/135/188/141/101/362 *362 101*
It returns one row only
i need Like this
subordinate positiond_id Parent_position_id
362 101
101 141
141 188
188 135
135 161
161 55
55 81
81 63.
How to achieve this.. Please help.
Thanks in advance.
KaviTry this
SELECT null posname, subordinate_position_id, parent_position_id, level_num
FROM (
SELECT distinct
--SYS_CONNECT_BY_PATH (pse.subordinate_position_id, '/') posname, --uncomment this line if necessary
level level_num,
pse.subordinate_position_id, parent_position_id
FROM (SELECT NAME, position_id
FROM hr_all_positions_f_tl
WHERE LANGUAGE = USERENV ('LANG')) hap,
(SELECT NAME, position_id
FROM hr_all_positions_f_tl
WHERE LANGUAGE = USERENV ('LANG')) has,
per_pos_structure_elements pse
WHERE pse.business_group_id = 0
AND hap.position_id = pse.parent_position_id
AND has.position_id = pse.subordinate_position_id
START WITH pse.parent_position_id = 63--:parent_posid
CONNECT BY PRIOR pse.subordinate_position_id = pse.parent_position_id
AND PRIOR pse.pos_structure_version_id = pse.pos_structure_version_id
WHERE subordinate_position_id = 362--:subposid
order by level_numMake sure that the you are using the correct values for the 3 IDs.
Hope this helps,
Sandeep Gandhi -
3113: Activity 'XXPONIT/233480' is missing a function reference.
Hello All,
I have designed a workflow in which i have to call workflow for n number of times.
In this workflow i have taken one notification and one function . when user submits workflow, its reached to user's parent level(1). If it approves then forwarded to function. it will check whether for that parent level(1) parent is found or not. if parent is found then it will identify the parent level(2) and sets into Attribute level(1) .
and forwarded back to notification.
when i am trying to run this workflow am getting the *(3113: Activity 'XXPONIT/233480' is missing a function reference.) error.
Eg. ____________Yes_______
| |
v Approve | No
Start---> Notification ------------------> function ------------------> End
| ^
|_____________________________________|
Reject
I am pasting pl/sql code here: Suggest me where i am wrong:
create or replace package body XXPO_WF_NIT_APPROVAL_PKG is
v_user_id number;
v_user_name VARCHAR2(15);
v_flag_parent_exist varchar2(1);
v_item_key NUMBER;
PROCEDURE WF_START_PROCESS(p_user_id NUMBER) IS
v_initiator varchar2(15);
BEGIN
/*To generate Unique Value for item key*/
SELECT XXPO_NIT_SEQ.nextval INTO v_item_key FROM dual;
dbms_output.put_line('item key ' ||v_item_key);
/* To create Workflow Process*/
wf_engine.CreateProcess(itemtype => 'XXPONIT',
itemkey => v_item_key,
process => 'NIT_PROC');
/* For Getting Initiator name who has initiated workflow*/
SELECT fu.user_name INTO v_initiator
FROM fnd_user fu
where user_id = p_user_id;
/*for getting next approver level user name and user Id*/
SELECT fu1.user_name,fu1.user_id INTO v_user_name,v_user_id
FROM per_all_assignments_f paaf1,
fnd_user fu1
WHERE paaf1.person_id = fu1.employee_id
AND paaf1.position_id IN (SELECT ppse.parent_position_id
FROM per_position_structures pps,
per_pos_structure_elements ppse
WHERE pps.position_structure_id = ppse.pos_structure_version_id
AND pps.position_structure_id = 4061 /*PO Test NIT Heirarchy*/
AND ppse.subordinate_position_id IN (SELECT DISTINCT paaf.position_id
FROM Per_All_Assignments_f paaf
WHERE paaf.position_id IS NOT NULL
AND paaf.person_id IN (SELECT papf.person_id
FROM per_all_people_f papf,
fnd_user fu
WHERE fu.employee_id = papf.person_id
AND papf.current_employee_flag = 'Y'
AND trunc(SYSDATE) BETWEEN papf.effective_start_date
AND papf.EFFECTIVE_END_DATE
AND fu.user_id = p_user_id/*1547*/ )));
wf_engine.SetItemAttrText(itemtype => 'XXPONIT',
itemkey => v_item_key,
aname => 'INITIATOR',
avalue => v_initiator);
dbms_output.put_line(v_initiator);
wf_engine.SetItemAttrText(itemtype => 'XXPONIT',
itemkey => v_item_key,
aname => 'ATR_LEVEL1',
avalue => v_user_name);
dbms_output.put_line('6');
wf_engine.StartProcess(itemtype => 'XXPONIT',
itemkey => v_item_key);
COMMIT;
EXCEPTION
WHEN NO_DATA_FOUND THEN
dbms_output.put_line('In WF_START_PROCESS' ||SQLCODE || ':No data found' || SQLERRM);
WHEN DUP_VAL_ON_INDEX THEN
dbms_output.put_line('In WF_START_PROCESS' ||SQLCODE || ':Duplicate values found' || SQLERRM);
WHEN OTHERS THEN
dbms_output.put_line('In WF_START_PROCESS' ||SQLCODE || ':Other Exception' || SQLERRM);
END WF_START_PROCESS;
--====================End of WF_Start procedure================
procedure is_comment_null(itemtype IN VARCHAR2,
itemkey IN VARCHAR2,
actid IN NUMBER,
funcmode IN VARCHAR2,
resultout OUT VARCHAR2) is
v_comments_fst_level varchar2(200);
v_result_fst varchar2(100);
v_count number;
BEGIN
v_comments_fst_level := WF_NOTIFICATION.GetAttrText(WF_ENGINE.CONTEXT_NID,
'COMMENT_FST');
v_result_fst := WF_NOTIFICATION.GETATTRTEXT(WF_ENGINE.CONTEXT_NID,
'RESULT');
dbms_output.put_line(v_result_fst);
IF( FUNCMODE = 'RESPOND') THEN
IF (v_result_fst = 'REJECTED') THEN
IF v_comments_fst_level IS NULL THEN
RESULTOUT :='ERROR: Comment is required while rejecting the request';
RETURN;
END IF;
END IF;
END IF;
dbms_output.put_line(SQLCODE || ':No data found' || SQLERRM);
EXCEPTION
WHEN NO_DATA_FOUND THEN
dbms_output.put_line('is_comment_null'|| SQLCODE || ':No data found' || SQLERRM);
WHEN DUP_VAL_ON_INDEX THEN
dbms_output.put_line('is_comment_null' || SQLCODE || ':Duplicate values found' || SQLERRM);
WHEN OTHERS THEN
dbms_output.put_line('is_comment_null'|| SQLCODE || ':Other Exception' || SQLERRM);
END is_comment_null;
--===================================
PROCEDURE Next_approver(ITEMTYPE IN VARCHAR2,
ITEMKEY IN VARCHAR2,
ACTID IN NUMBER,
FUNCMODE IN VARCHAR2,
RESULTOUT OUT NOCOPY VARCHAR2)
IS
v_count number;
BEGIN
--==============To initiate next approval workflow================
IF( FUNCMODE = 'RUN') THEN
SELECT count(fu1.user_name) INTO v_count
FROM per_all_assignments_f paaf1,
fnd_user fu1
WHERE paaf1.person_id = fu1.employee_id
AND paaf1.position_id IN (SELECT ppse.parent_position_id
FROM per_position_structures pps,
per_pos_structure_elements ppse
WHERE pps.position_structure_id = ppse.pos_structure_version_id
AND pps.position_structure_id = 4061
AND ppse.subordinate_position_id IN (SELECT DISTINCT paaf.position_id
FROM Per_All_Assignments_f paaf
WHERE paaf.position_id IS NOT NULL
AND paaf.person_id IN (SELECT papf.person_id
FROM per_all_people_f papf,
fnd_user fu
WHERE fu.employee_id = papf.person_id
AND papf.current_employee_flag = 'Y'
AND trunc(SYSDATE) BETWEEN papf.effective_start_date
AND papf.EFFECTIVE_END_DATE
AND fu.user_id = v_user_id)));
IF v_count > 0 THEN
v_flag_parent_exist := 'Y';
/* To get next approver name */
SELECT fu1.user_name INTO v_user_name
FROM per_all_assignments_f paaf1,
fnd_user fu1
WHERE paaf1.person_id = fu1.employee_id
AND paaf1.position_id IN (SELECT ppse.parent_position_id
FROM per_position_structures pps,
per_pos_structure_elements ppse
WHERE pps.position_structure_id = ppse.pos_structure_version_id
AND pps.position_structure_id = 4061
AND ppse.subordinate_position_id IN (SELECT DISTINCT paaf.position_id
FROM Per_All_Assignments_f paaf
WHERE paaf.position_id IS NOT NULL
AND paaf.person_id IN (SELECT papf.person_id
FROM per_all_people_f papf,
fnd_user fu
WHERE fu.employee_id = papf.person_id
AND papf.current_employee_flag = 'Y'
AND trunc(SYSDATE) BETWEEN papf.effective_start_date
AND papf.EFFECTIVE_END_DATE
AND fu.user_id = v_user_id)));
--WF_START_PROCESS(v_user_id);
wf_engine.SetItemAttrText(itemtype => 'XXPONIT',
itemkey => v_item_key,
aname => 'ATR_LEVEL1',
avalue => v_user_name);
ELSE
v_flag_parent_exist := 'N';
END IF;
END IF;
IF v_flag_parent_exist = 'Y' THEN
RESULTOUT := 'Y';
ELSE IF v_flag_parent_exist = 'N' THEN
RESULTOUT := 'N';
END IF;
END IF;
END Next_approver;
end XXPO_WF_NIT_APPROVAL_PKG;
Thanks,
sheetal MittalHI
I believe the document that you are looking for can be found in the following location. This help file describes the NI-DAQmx Library functions, which you can use with National Instruments data acquisition and switch devices to develop instrumentation, acquisition, and control applications.
Message Edited by jaced on 11-05-2007 12:18 PM
JaceD
Signal Sources Product Support Engineer
National Instruments
Attachments:
NI-DAQmx C help.jpg 98 KB
Maybe you are looking for
-
Using ALEKS with Mac (math class review for college)
Hi. I'm taking a math review class for college, and it's online. They want me to do it through something called ALEKS. Has anyone used this before? I've paid for the class, and tried downloading what they wanted me to download, but I got this error m
-
Airport Network Options Problem
Hi All I have just upgraded from 10.3 to 10.4.5 and have found a problem with the Airport Network prefs pane which I can't fix. Originally the interface to the Airport Networks pane was not showing correctly and was still setup as in 10.3. I only not
-
Viewing Threads Offline - Needs To Be Sorted
When browsing offline, the threads seem to be sorted by "start" date and not last post. We have at the moment for example, two very "hot" threads in the T-Series message board; T61p Graphic and T61 With Advanced Dock. If threads were, for offline bro
-
Changes not reflected in portal after successful import
Hello, I am having trouble with some transports in NWDI. I made some changes to the ESS Address Details dynpro and tested them in the development portal. I then imported them into CONS and the import ran successfully. However I cannot see the changes
-
Missing Event Viewer VM Manager Log after ugrade from SCVMM 2012 SP1 to R2
We recently upgraded from SCVMM 2012 SP1 to SCVMM 2012 R2. After the upgrade, I noticed that the VM Manager log, in the Event Viewer, is missing. I've tried to peruse all of the logs to see if it has been moved/renamed, with no luck. I highly doubt a