Appendix A: Examples of Documentated Code


EXAMPLES: SQL # 1

/* NAME: pidms_entering_studs.sql
  CREATED FOR: Database Systems
  SUPPORTED BY: Registrar's Office
  DATE: 5/2/00,mwh
  PURPOSE: pidm list of all entering students for IS for their use in account deletion/creation. Use this list to create pins too.
  OTHER INFO: User is prompted for the Fall term.
Produces a list file called pidms2_entering_studs.lis

PERSON DATE COMMENTS
mwh 5/2/00 initial implementation */

set pages 0

set timing off

etc.....

spool pidms2_entering_studs.lis

SELECT sgbstdn_pidm

FROM sgbstdn,wcvclas

WHERE sgbstdn_term_code_admit = '&FALLTERM'

etc.....

AND sgbstdn_pidm = wcvclas_pidm

/

spool off

EXAMPLES: SQL # 2

/* NAME: set_disp.sql
  CREATED FOR: Payroll Office
  SUPPORTED BY: Database Systems
  PURPOSE: Allows DBSystems to set active payrolls back to previous dispositions
  OTHER INFO: This script prompts for the desired new payroll disposition, current payroll year, current payroll type (pict_code), current pay number (payno), and current dispostition.

  PERSON DATE COMMENTS
  stb 1/15/95 initial creation

mw 10/15/98 change to accept prompting */

/* First Update Payroll History*/

UPDATE PHRHIST

SET PHRHIST_DISP = &&new_disp

WHERE PHRHIST_YEAR = &&year

etc.....

AND PHRHIST_DISP = &&current_disp;

/* Now Update Job Table */

UPDATE PHRJOBS

SET PHRJOBS_DISP = &&new_disp

WHERE PHRJOBS_YEAR = &&year

etc......

AND PHRJOBS_DISP = &&current_disp;

/

 EXAMPLE: PL/SQL # 1

 CREATE OR REPLACE

Package gyf_ADDR

IS

-- #DM#PACKAGE_NAME -> GYF_ADDR

-- #DM#PACKAGE_TYPE -> Package of functions

-- #DM#PACKAGE_PURPOSE -> Creates functions used to create GEN_ADDR and GEN_ADDR_R

-- #DM#PACKAGE_DATA -> Functions related to all Banner address information

-- #DM#PACKAGE_LOAD ->

-- CREATED FOR: General Datamart Module

-- SUPPORTED BY: Database Systems

-- MODIFICATIONS

-- Person Date Comments

-- --------- ------ ------------------------------------------

-- JAP 04/17/2000 Initial implementation

-- JAP 04/21/2000 Added Club and Region description functions

-- MLS 10/25/2000 Added state description function

-- MLS 11/14/2000 Added activity date to address record type

-- JAP 11/24/2000 Added tags for online documentation

-- JAP 12/04/2000 Renamed Package to GYF_ADDR

-- JAP 01/04/2000 Added ADDRESS_LABEL function package

-- Variable Name Data Type

v_package_txt VARCHAR2(30) := 'GYF_ADDR';

-- Global Package Variables

today DATE := SYSDATE;

-- Address Type Default Values

busi_atyp_code spraddr.spraddr_atyp_code%type := 'B1';

home_atyp_code spraddr.spraddr_atyp_code%type := 'MA';

seas_atyp_code spraddr.spraddr_atyp_code%type := 'VA';

pref_atyp_code spraddr.spraddr_atyp_code%type;

-- Address Record Type

TYPE addr_type_rec IS RECORD

(pidm spraddr.spraddr_pidm%type,

atyp spraddr.spraddr_atyp_code%type,

etc.....

activity_date spraddr.spraddr_activity_date%type);

/*******************************************************************/

FUNCTION address --#DM#DATA_ELEMENT -> Returns all address information, as a record, using passed parameters

( a_pidm_in IN spriden.spriden_pidm%type, -- pidm

a_atyp_in IN spraddr.spraddr_atyp_code%type) -- address type

RETURN addr_type_rec;

PRAGMA restrict_references(address, wnds, wnps);

FUNCTION geo_code --#DM#DATA_ELEMENT -> Returns the club code using passed parameters

( a_type_in IN sorgeor.sorgeor_type%type, -- type of geo code

etc.....

RETURN VARCHAR2;

PRAGMA restrict_references(geo_code, wnds, wnps);

CREATE OR REPLACE

Package Body gyf_addr

IS

pvg_version_txt VARCHAR(30) := '20000610.1';

lv_package_txt VARCHAR(30) := 'GYF_ADDR';

/******************************************************************/

 



Back to Dbsystems