|
Sybernet / Supplied Packages Reference
Release 3.00 May 27, 2008 |
|
The PEOPLETOOLS package contains subprograms for interrogating employees. These are mostly functions that retrieve commonly referenced columns; for example, the MAILTO function returns an employee's e-mail address, and the MAIL_DROP function returns their location. All functions in this package accept (and require) an employee number (EMPLID). All values that depend on an effective date are retrieved relative to the current date and time.
Clearly you are asking yourself why you would even bother to use this package. Retrieving someone's name is pretty simple, and although retrieving the name of their department is only a little more complicated, there are times when all you are interested is just one of these values, and you're in no mood to trap exceptions such as no data found. All of these functions return NULL in this case. This package also takes care of the char vs varchar semantics so you don't have to worry about trimming or padding your requests.
| Subprogram | Description |
|---|---|
BUSINESS_TITLE |
Returns the job or business title for this employee. |
COMPANYNAME |
Return the long description of COMPANY. |
DEPARTMENTNAME |
Returns the department name of this employee. |
DEPTID |
Returns the department number for this employee. |
DIVISIONNAME |
Returns the division name of this employee. |
EFFDT |
Returns the last effective date for this employee. |
EMPL_STATUS |
Returns an employee's employment status. |
EMPL_TYPE |
Returns an employee's employment type. |
FIRST_NAME |
Returns an employee's first name. |
FULLNAME |
Returns an employee's full name. |
GROUPNAME |
Returns the group name of this employee |
LAST_NAME |
Returns an employee's last name. |
LOCATION |
Returns an employee's location. |
MAILTO |
Returns an employee's e-mail address |
MAIL_DROP |
Returns an employee's office location. |
MIDDLE_NAME |
Returns an employee's middle name. |
NAME |
Returns an employee's name. |
ORIG_HIRE_DT |
Returns an employee's hire date. |
PHONE |
Returns an employee's phone number. |
REG_TEMP |
Returns an employee's status. |
STD_HOURS |
Returns an employee's standard hours. |
SUPERVISOR_ID |
Returnes the employee number of this employee's supervisor. |
TERMINATION_DATE |
Returns an employee's termination date. |
USER_NAME |
Returns an employee's user name in the database. |
This function returns an employee's job title.
Function BUSINESS_TITLE
(
EMPLID VARCHAR2
)
RETURN VARCHAR2;
| Parameter | Description |
|---|---|
emplid |
An employee number. |
The following example illustrates how to call BUSINESS_TITLE:
DECLARE
EMPLID VARCHAR(11) := '99999';
BEGIN
HTTP.WRITELN(HTTP.PEOPLETOOLS.BUSINESS_TITLE(EMPLID));
END;
This function returns the company for this employee. Company names at SRI include SRI International and its subsidiaries. Contractors and consultants belong to one of the above even though they really work for another company.
Function COMPANYNAME
(
EMPLID VARCHAR2
)
RETURN VARCHAR2;
| Parameter | Description |
|---|---|
emplid |
An employee number. |
The following example illustrates how to call COMPANYNAME:
DECLARE
EMPLID VARCHAR(11) := '99999';
BEGIN
HTTP.WRITELN(HTTP.PEOPLETOOLS.COMPANYNAME(EMPLID));
END;
This function returns the name of the department that this employee works for. If you are really interested in the department number, you should call the function DEPTID.
Function DEPARTMENTNAME
(
EMPLID VARCHAR2
)
RETURN VARCHAR2;
| Parameter | Description |
|---|---|
emplid |
An employee number. |
The following example illustrates how to call DEPARTMENTNAME:
DECLARE
EMPLID VARCHAR(11) := '99999';
BEGIN
HTTP.WRITELN(HTTP.PEOPLETOOLS.DEPARTMENTNAME(EMPLID));
END;
This function returns the department number for this employee. If you are interested in the long description, you should call the function DEPARTMENTNAME.
Function DEPTID
(
EMPLID VARCHAR2
)
RETURN VARCHAR2;
| Parameter | Description |
|---|---|
emplid |
An employee number. |
The following example illustrates how to call DEPTID:
DECLARE
EMPLID VARCHAR(11) := '99999';
BEGIN
HTTP.WRITELN(HTTP.PEOPLETOOLS.DEPTID(EMPLID));
END;
This function returns the division name that this employee works for.
Function DIVISIONNAME
(
EMPLID VARCHAR2
)
RETURN VARCHAR2;
| Parameter | Description |
|---|---|
emplid |
An employee number. |
The following example illustrates how to call DIVISIONNAME:
DECLARE
EMPLID VARCHAR(11) := '99999';
BEGIN
HTTP.WRITELN(HTTP.PEOPLETOOLS.DIVISIONNAME(EMPLID));
END;
This function returns the current effective date for this employee. Effective date represents the last date a change was made to this employee.
Function EFFDT
(
EMPLID VARCHAR2
)
RETURN DATE;
| Parameter | Description |
|---|---|
emplid |
An employee number. |
The following example illustrates how to call EFFDT:
DECLARE
EMPLID VARCHAR(11) := '99999';
BEGIN
HTTP.WRITELN(HTTP.PEOPLETOOLS.EFFDT(EMPLID));
END;
This function returns an employee's employment status. Employment status can be one of
Function EMPL_STATUS
(
EMPLID VARCHAR2
)
RETURN VARCHAR2;
| Parameter | Description |
|---|---|
emplid |
An employee number. |
The following example illustrates how to call EMPL_STATUS:
DECLARE
EMPLID VARCHAR(11) := '99999';
BEGIN
IF HTTP.PEOPLETOOLS.EMPL_STATUS(EMPLID) IN ('A','L','P') THEN
HTTP.WRITELN(EMPLID || ' IS ACTIVE');
ELSE
HTTP.WRITELN(EMPLID || ' IS NOT ACTIVE');
END IF;
END;
This function returns an employee's employment type. Employment type can be one of
Function EMPL_TYPE
(
EMPLID VARCHAR2
)
RETURN VARCHAR2;
| Parameter | Description |
|---|---|
emplid |
An employee number. |
The following example illustrates how to call EMPL_TYPE:
DECLARE
EMPLID VARCHAR(11) := '99999';
BEGIN
IF HTTP.PEOPLETOOLS.REG_TEMP(EMPLID) || HTTP.PEOPLETOOLS.EMPL_TYPE(EMPLID) = 'TH' THEN
HTTP.WRITELN(EMPLID || ' IS TEMPORARY HOURLY');
END IF;
END;
This function returns an employee's first name.
Function FIRST_NAME
(
EMPLID VARCHAR2
)
RETURN VARCHAR2;
| Parameter | Description |
|---|---|
emplid |
An employee number. |
The following example illustrates how to call FIRST_NAME:
DECLARE
EMPLID VARCHAR(11) := '99999';
BEGIN
HTTP.WRITELN(HTTP.PEOPLETOOLS.FIRST_NAME(EMPLID));
END;
This function returns an employee's full name as first name followed by middle name followed by last name.
Function FULLNAME
(
EMPLID VARCHAR2
)
RETURN VARCHAR2;
| Parameter | Description |
|---|---|
emplid |
An employee number. |
The following example illustrates how to call FULLNAME:
DECLARE
EMPLID VARCHAR(11) := '99999';
BEGIN
HTTP.WRITELN(HTTP.PEOPLETOOLS.FULLNAME(EMPLID));
END;
This function returns the group name for this employee.
Function GROUPNAME
(
EMPLID VARCHAR2
)
RETURN VARCHAR2;
| Parameter | Description |
|---|---|
emplid |
An employee number. |
The following example illustrates how to call GROUPNAME:
DECLARE
EMPLID VARCHAR(11) := '99999';
BEGIN
HTTP.WRITELN(HTTP.PEOPLETOOLS.GROUPNAME(EMPLID));
END;
This function returns an employee's last name.
Function LAST_NAME
(
EMPLID VARCHAR2
)
RETURN VARCHAR2;
| Parameter | Description |
|---|---|
emplid |
An employee number. |
The following example illustrates how to call LAST_NAME:
DECLARE
EMPLID VARCHAR(11) := '99999';
BEGIN
HTTP.WRITELN(HTTP.PEOPLETOOLS.LAST_NAME(EMPLID));
END;
This function returns an employee's location. Location is not their office location. Location represents the site this employee works at; for example, all Menlo Park employees have a location of CA01. For office location use the function MAIL_DROP.
Function LOCATION
(
EMPLID VARCHAR2
)
RETURN VARCHAR2;
| Parameter | Description |
|---|---|
emplid |
An employee number. |
The following example illustrates how to call LOCATION:
DECLARE
EMPLID VARCHAR(11) := '99999';
BEGIN
HTTP.WRITELN(HTTP.PEOPLETOOLS.LOCATION(EMPLID));
END;
This function returns an employee's e-mail address.
Function MAILTO
(
EMPLID VARCHAR2
)
RETURN VARCHAR2;
| Parameter | Description |
|---|---|
emplid |
An employee number. |
The following example illustrates how to call MAILTO:
DECLARE
EMPLID VARCHAR(11) := '99999';
ROW_ID NUMBER;
BEGIN
ROW_ID:=HTTP.SENDMAIL
(
MAILTO=>HTTP.PEOPLETOOLS.MAILTO(EMPLID)
, SUBJECT=>'TEST'
, MESSAGE=>'HELLO'
) ;
END;
This function returns an employee's office location.
Function MAIL_DROP
(
EMPLID VARCHAR2
)
RETURN VARCHAR2;
| Parameter | Description |
|---|---|
emplid |
An employee number. |
The following example illustrates how to call MAIL_DROP:
DECLARE
EMPLID VARCHAR(11) := '99999';
BEGIN
HTTP.WRITELN(HTTP.PEOPLETOOLS.MAIL_DROP(EMPLID));
END;
This function returns an employee's middle name.
Function MIDDLE_NAME
(
EMPLID VARCHAR2
)
RETURN VARCHAR2;
| Parameter | Description |
|---|---|
emplid |
An employee number. |
The following example illustrates how to call MIDDLE_NAME:
DECLARE
EMPLID VARCHAR(11) := '99999';
BEGIN
HTTP.WRITELN(HTTP.PEOPLETOOLS.MIDDLE_NAME(EMPLID));
END;
This function returns an employee's name. Name is last name followed by a comma followed by first name followed by middle name.
Function NAME
(
EMPLID VARCHAR2
)
RETURN VARCHAR2;
| Parameter | Description |
|---|---|
emplid |
An employee number. |
The following example illustrates how to call NAME:
DECLARE
EMPLID VARCHAR(11) := '99999';
BEGIN
HTTP.WRITELN(HTTP.PEOPLETOOLS.NAME(EMPLID));
END;
This function returns an employee's hire date.
Function ORIG_HIRE_DT
(
EMPLID VARCHAR2
)
RETURN DATE;
| Parameter | Description |
|---|---|
emplid |
An employee number. |
The following example illustrates how to call ORIG_HIRE_DT:
DECLARE
EMPLID VARCHAR(11) := '99999';
BEGIN
HTTP.WRITELN(HTTP.PEOPLETOOLS.ORIG_HIRE_DT(EMPLID));
END;
This function returns an employee's telephone number.
Function PHONE
(
EMPLID VARCHAR2
)
RETURN VARCHAR2;
| Parameter | Description |
|---|---|
emplid |
An employee number. |
The following example illustrates how to call PHONE:
DECLARE
EMPLID VARCHAR(11) := '99999';
BEGIN
HTTP.WRITELN(HTTP.PEOPLETOOLS.PHONE(EMPLID));
END;
This function determines if this employee is a regular employee or a temporary employee. REG_TEMP returns on of the following:
Function REG_TEMP
(
EMPLID VARCHAR2
)
RETURN VARCHAR2;
| Parameter | Description |
|---|---|
emplid |
An employee number. |
The following example illustrates how to call REG_TEMP:
DECLARE
EMPLID VARCHAR(11) := '99999';
BEGIN
IF HTTP.PEOPLETOOLS.REG_TEMP(EMPLID) || HTTP.PEOPLETOOLS.EMPL_TYPE(EMPLID) = 'TH' THEN
HTTP.WRITELN(EMPLID || ' IS TEMPORARY HOURLY');
END IF;
END;
This function returns an employee's standard hours.
Function STD_HOURS
(
EMPLID VARCHAR2
)
RETURN NUMBER;
| Parameter | Description |
|---|---|
emplid |
An employee number. |
The following example illustrates how to call STD_HOURS:
DECLARE
EMPLID VARCHAR(11) := '99999';
BEGIN
HTTP.WRITELN(EMPLID || ' (FTE=' || TO_CHAR(HTTP.PEOPLETOOLS.STD_HOURS(EMPLID)/40,'0.0') || ')');
END;
This function returns the employee number of this employee's supervisor.
Function SUPERVISOR_ID
(
EMPLID VARCHAR2
)
RETURN NUMBER;
| Parameter | Description |
|---|---|
emplid |
An employee number. |
The following example illustrates how to call SUPERVISOR_ID:
DECLARE
EMPLID VARCHAR(11) := '99999';
BEGIN
HTTP.WRITELN(EMPLID || ' (SUPERVISOR_ID=' || HTTP.PEOPLETOOLS.SUPERVISOR_ID(EMPLID) || ')');
END;
The following example illustrates how to retrieve the supervisor ID (or manager ID) of this supervisor ID:
DECLARE
EMPLID VARCHAR(11) := '99999';
BEGIN
HTTP.WRITELN(EMPLID || ' (MANAGER_ID=' || HTTP.PEOPLETOOLS.SUPERVISOR_ID(HTTP.PEOPLETOOLS.SUPERVISOR_ID(EMPLID)) || ')');
END;
This function returns an employee's termination date. NULL is returned if this employee is not terminated.
Function TERMINATION_DATE
(
EMPLID VARCHAR2
)
RETURN DATE;
| Parameter | Description |
|---|---|
emplid |
An employee number. |
The following example illustrates how to call TERMINATION_DATE:
DECLARE
EMPLID VARCHAR(11) := '99999';
BEGIN
HTTP.WRITELN(HTTP.PEOPLETOOLS.TERMINATION_DATE(EMPLID));
END;
This function returns an employee's username in the database.
Function USER_NAME
(
EMPLID VARCHAR2
)
RETURN VARCHAR2;
| Parameter | Description |
|---|---|
emplid |
An employee number. |
The following example illustrates how to call USER_NAME:
DECLARE
EMPLID VARCHAR(11) := '99999';
BEGIN
HTTP.WRITELN(HTTP.PEOPLETOOLS.USER_NAME(EMPLID));
END;