In transaction PA30 after you enter a Personnel Number and select Infotype 0024, it will display all the qualifications of that employee (if they have any).
I want to create a report with 3 parameters ('Qualification group', 'Name' , 'Proficency' ) and after the user inserts data, to display all employees that have those skills. If I access table PA0024, it has no entries, so my question is:
In which table (or where) can I find all employees with their qualifications?
Any other suggestions on how to make this report would help.
As I recall, some qualifications can be stored in the PD tables.
Qualifications are objets type 'Q' stored in HRP1000.
Relations between an employee and its qualifications are stored into HRP1001. The field ADATANR of this relation is the key for an entry in table HRPAD31 (I think) which contains the rating of this employee for this qualification.
Others tables are T77TS (holds the Qualification IDs and text) and T77TP (holds the Qualification Scale IDs and Texts)
There are also function module in the function group "RHPP", such as RHPP_Q_PROFILE_READ (using P objects in the OBJECTS parameter)
Using the learner as input, you can execute LSO_LEARNER_GET_CPROFILE_C to get the different qualifications.
Related
To create a many-to-many relationship, I have three tables:
tblEmployee, contains employees
tlkpPermission, contains 11 different possible permission groups an employee can be part of
tblEmployeeXPermission, combines the EmployeeID with one or more PermissionID
What I’m trying to create is a query that shows what permission groups an employee is NOT part of.
So, if EmployeeID 12345 is associated with PermissionID 1,2,3,4,5, but NOT 6,7,8,9,10,11 (in the EmployeeXPermission table) then I want the query to show EmployeeID 12345 is not part of PermissionID 6,7,8,9,10,11.
Of all the JOINs and query options, I can only get a query to show which PermissionIDs an employee is associated with, but not the PermissionIDs the employee is not associated with.
Any help would be appreciated.
Thanks
You need to start with all combinations of employees and permissions, and this type of join is CROSS JOIN, but MsAccess SQL does not have it in the new SQL syntax. You can use the old syntax of listing your tables in the FROM clause, comma separated, and provide the join condition, if any, in the WHERE clause:
SELECT
EmployeeId,
PermissionID
FROM
tblEmployee as E,
tlkpPermission as P
where not exists (
select 1
from tblEmployeeXPermission X
where X.EmployeeId=E.EmployeeId
and X.PermissionId=P.PermissionId
)
Here the part up to the WHERE clause would give you all employee - permission combinations, and the WHERE clause removes those occuring in the tblEmployeeXPermission, leaving you with the ones you want.
SELECT C1.CERT_ANNOUNCEMENT
FROM EMPLOYEE C1, TEACHER C1, TEACHER_CERT_INT C1, CERTIFICATION C1
ORDER BY EMP_LNAME, EMP_FNAME;
Write a query and save it as a view to create announcement text for all teachers in the database that have
obtained certifications. The attribute you create should be named as below and the string you create must look
exactly as in the solution for full credit. Order by last name then first name.
It is supposed to be named CERT_ANNOUNCEMENT but this is not an attribute in the ER DIAGRAM.
Don't know how to create it exactly because when I run this it say invalid identifier. Any help is appreciated.
You should use unique alias for each table and use on clause to do joins and avoid full cartesian product, and also elaborate better your questions on SO.
The assignment asks you to create a view so you need to use the CREATE VIEW syntax.
The view uses data from several tables. You need to use join conditions to ensure that records are linked meaningfully. This usually means joining primary keys to foreign keys.
Give each table a unique alias to avoid compilation errors.
The view is supposed to show a message for all the teachers who have been awarded certificates. You need to form this announcement by concatenating columns from the tables with boilerplate text. Give this message a column alias of cert_announcement.
You not have posted any table structures so I have guessed what your tables' columns are called. Likewise the actual text of the announcement. So you need to figure out the precise details for yourself. At least that way you'll have earned some of the marks you'll get.
create or replace view full_credit_please as
select 'Teacher '
||emp.emp_fname||' '||emp.emp_lname
||' was awarded '||cert.certifcate_name
||' on '|| to_char(cert.award_date, 'DD-MON-YYYY')
as cert_announcement
from employee emp
join teacher tch
on tch.emp_id = emp.emp_id
join teacher_cert_int tc
on tc.tch_id = tch.tch_id
join certification cert
on cert.cert_id = tc.cert_id
order by emp.emp_lname, emp.emp_fname;
If I have three tables, one called Person, one called Owner and the other called Tenant. All three have SSN as one of the fields. What I want to do is compare the SSN from Person (that's the whole list) to see which ones do not show up in either OWner or Tenant so I can see which people in the database have never owned a unit or leased a unit. Then i would like to be able to delete these people out of the person table.
Thanks
One easy way to do this is using not in:
select p.*
from persons as p
where p.ssn not in (select ssn from owner) and
p.ssn not in (select ssn from tenant);
My table IncomingLetter has a foreign key to a table Department, which has an ID and a column Short_Name.
I'm using this query to count the incoming letters assigned to a department.
SELECT COUNT(DocumentNumber) AS TotalNumberIncomingLetters
FROM IncomingLetter
WHERE Assigned_To_Department=1;
Whereas this works I want to make a query based upon the short name and not based upon the ID.
SELECT COUNT(DocumentNumber) AS TotalNumberIncomingLetters
FROM IncomingLetter
WHERE Assigned_To_Department.Short_Name="My Department Name";
This does not work, whereas I found examples that are using this syntax. However, it is probably important to notice, that I m using this query in MS access.
You should use
SELECT COUNT(il.DocumentNumber) AS TotalNumberIncomingLetters
FROM IncomingLetter il
INNER JOIN Department d on d.ID = il.Assigned_To_Department
WHERE d.Short_Name="My Department Name";
The "My Department Name" text is actually stored in the Departments table, and only the number (1) is stored in the IncomingLetter table, in the field Assigned_To_Department.
Asking for Assigned_To_Department.Short_Name basically asks the number 1 to get it's Short_Name field, that does not make sense.
You need to tell the database engine two things in these scenarios:
which tables are connected - IncomingLetter and Departments in this case (the inner join part)
how they are connected - by setting their Assigned_To_Department and ID fields respecively (the on ... part
I am new to SQL server, thus looking for some quick help on writing stored procedure:
brief about what I am doing:
employee says he is expert (type) in different domains (industries) and willing to work in countries of choice (mycountries) and my sal (minsal)and my native country (orgcountry)
Employer says he need so and so expert in the his choice of domain (industries) in the countries where openings are there and with sal range.
employee table has lots of records with columns like this:
name, email, myindustries, mycountries, mytype,minsal
employer table has lots of records with columns like:
expertneed, inindustries, incountries, sal-from, sal-to
now when employee logs in, he/she should get all the records of matching employers
when employer logs in, he/she also get all the records of matching employees.
can some one help in writing sp for this? appreciate any help
If you're storing comma-separated ids then you'll need a function to split a string into multiple rows. This is how you would use it:
SELECT DISTINCT employee.name [employee], employer.name [employer]
FROM employee
OUTER APPLY dbo.split(employee.myindustries) myi (industry)
OUTER APPLY dbo.split(employee.mycountries) myc (country)
JOIN employer
OUTER APPLY dbo.split(employer.inindustries) ini (industry)
OUTER APPLY dbo.split(employer.incountries) inc (country)
WHERE employer.expertneed = employee.type
AND ini.inindustries = myi.industry
AND inc.incountries = myc.country
AND employee.minsal BETWEEN employer.[sal-from] AND employer.[sal-to]