Login
Register
Search
Home
Forums
Jobs
LawsonGuru
LawsonGuru Letter
LawsonGuru Blog
Worthwhile Reading
Infor Lawson News Feed
Store
Store FAQs
About
Forums
Integration / Customization
S3 Customization/Development
SQL for finding counts of employees reporting under supervisor
Home
Forums
Jobs
LawsonGuru
LawsonGuru Letter
LawsonGuru Blog
Worthwhile Reading
Infor Lawson News Feed
Store
Store FAQs
About
Who's On?
Membership:
Latest:
Chris Radcliffe
Past 24 Hours:
0
Prev. 24 Hours:
0
Overall:
5187
People Online:
Visitors:
265
Members:
0
Total:
265
Online Now:
New Topics
S3 Customization/Development
Cobol - Extract Current Time
4/24/2024 7:21 PM
How do you extract just the Current System Time in
Lawson Landmark
LPL INSTR Functions
4/5/2024 8:32 PM
I'm writing a simple report using the Create R
Infor SCM
Translating 856 to get the ~ REF^CN^ field
4/3/2024 8:24 PM
We are trying to get the tracking number which is
IPA/ProcessFlow
Sample XML file create Flow
4/3/2024 3:43 PM
Hello everyone, I am new to creating XML files
Lawson S3 HR/Payroll/Benefits
bn105 error message
3/26/2024 6:40 PM
I need to change some of the set ups in our Life I
IPA/ProcessFlow
IPA executing Job
3/13/2024 7:08 PM
New to the IPA world and was wondering, can an IPA
Lawson S3 HR/Payroll/Benefits
Life Age Reduction on benefits plans
3/12/2024 7:15 PM
For our optional life we have an age based coverag
Lawson S3 HR/Payroll/Benefits
BN53.1 Add-In
3/7/2024 3:31 PM
We are migrating to Solstice. They require a
Lawson Business Intelligence/Reporting/Crystal
Domain Name Change
3/5/2024 7:45 PM
Our domain name needs to change and was hoping I c
S3 Customization/Development
Cobol calling Shell Script
2/29/2024 1:27 PM
Has anyone created or modified a Lawson Cobol prog
Top Forum Posters
Name
Points
Greg Moeller
4184
David Williams
3349
JonA
3288
Kat V
2984
Woozy
1973
Jimmy Chiu
1883
Kwane McNeal
1437
Ragu Raghavan
1351
Roger French
1311
mark.cook
1244
Forums
Unanswered
Active Topics
Most Liked
Most Replies
Search Forums
Search
Advanced Search
Topics
Posts
Prev
Next
Forums
S3 Customization/Development
SQL for finding counts of employees reporting under supervisor
Sort:
Oldest First
Most Recent First
You are not authorized to post a reply.
Author
Messages
Shasidhar Vemireddy
Basic Member
Posts: 14
8/19/2007 4:33 PM
I am trying to develop a SQL logic that will fetch the counts of employees direct and indirect under supervisor across all levels in a company.I have hot wall with the PL/SQL logic. Can anyone tell me if such a logic was developed and how it was developed ?
John Henley
Senior Member
Posts: 3348
8/20/2007 12:01 AM
Shasidhar, for several clients I have used SQL (for SQL Server but not Oracle) to do hierarchical listings of employees up and down the supervisor chain. What I had to do was write everything into a temp table, using recursion to work up and down the chain, and then return the contents of the temp table as the resultset. It was indeed very difficult, but it was achievable.
Chris Martin
Veteran Member
Posts: 277
8/20/2007 1:14 PM
Check out the "START WITH...CONNECT BY" clause for hierarchical queries in Oracle.
Shasidhar Vemireddy
Basic Member
Posts: 14
8/20/2007 4:22 PM
Hi Chris,
I did get this query from our DBA, however i unable to use this query on the HRSUPER table. However this would work if i RECREATE the hierarchy in a temp table. Is this is the only option i have ? since if it is a temp table i have to write PL/SQL that is run daily to dynamically insert parent-child recs in the temp table.I am trying to find out if there is a way i could use HRSUPER to get the hierarchy because ultimatly i am only concerned about pulling the count of employees direct/indirect if they exist for each employee.
regards,
Shasi
John Henley
Senior Member
Posts: 3348
8/20/2007 4:30 PM
- I built the procedure to re-create, load, then remove the temp table each time the sproc ran.
- Are you looking for counts all the way down the hierarchy for a given employee, or just his/her direct/indirect reports?
Chris Martin
Veteran Member
Posts: 277
8/20/2007 5:00 PM
Are you using this as a datasource for a Crystal report?
Shasidhar Vemireddy
Basic Member
Posts: 14
8/20/2007 5:37 PM
John : I am looking for counts all the way down the hierarchy for a given employee. i have to loop through all active employees, if a employee is not a supervisor the count is 0.
Chris : You are absolutly correct, The logic i am trying to develop is to populate a field in a non-lawson table that will eventually be used by a Crystal report in LBI.
You are not authorized to post a reply.