Banner Technical. Object:Access Technical Training Workbook. July 2005.
Release 7. What can we help you achieve? HIGHER EDUCATION ...
Banner Technical Object:Access Technical Training Workbook
July 2005 Release 7
HIGHER EDUCATION
What can we help you achieve?
Confidential Business Information
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------This documentation is proprietary information of SunGard Higher Education and is not to be copied, reproduced, lent or disposed of, nor used for any purpose other than that for which it is specifically provided without the written permission of SunGard Higher Education. Prepared By:
SunGard Higher Education 4 Country View Road Malvern, Pennsylvania 19355 United States of America
© 2004-6 SunGard. All rights reserved. The unauthorized possession, use, reproduction, distribution, display or disclosure of this material or the information contained herein is prohibited. In preparing and providing this publication, SunGard Higher Education is not rendering legal, accounting, or other similar professional services. SunGard Higher Education makes no claims that an institution's use of this publication or the software for which it is provided will insure compliance with applicable federal or state laws, rules, or regulations. Each organization should seek legal, accounting and other similar professional services from competent providers of the organization’s own choosing. Without limitation, SunGard, the SunGard logo, Banner, Campus Pipeline, Luminis, PowerCAMPUS, Matrix, and Plus are trademarks or registered trademarks of SunGard Data Systems Inc. or its subsidiaries in the U.S. and other countries. Third-party names and marks referenced herein are trademarks or registered trademarks of their respective owners.
Table of Contents
Section A: Introduction ..............................................................................................................5 Overview ..................................................................................................................................5 Course Introduction..................................................................................................................6 Section B: Understanding Object:Access .................................................................................7 Overview ..................................................................................................................................7 What Object:Access Is Not ......................................................................................................8 What Object:Access Is... ..........................................................................................................9 ODBC .................................................................................................................................10 Object:Access Vs. Microsoft Access .....................................................................................11 Why Use Object:Access? .......................................................................................................12 Review .................................................................................................................................13 Self Check ..............................................................................................................................14 Self Check - Answer Key.......................................................................................................16 Section C: Components of Object:Access...............................................................................18 Overview ................................................................................................................................18 Object:Access Components....................................................................................................20 Data Model .............................................................................................................................21 Naming Conventions..............................................................................................................22 Oracle Functions.....................................................................................................................23 Concept Functions..................................................................................................................24 Access Functions....................................................................................................................26 Oracle Views ..........................................................................................................................28 View Design – Step 1 (View Data Identification) .................................................................29 Object:Access - What Keys? ..................................................................................................30 View Design – Step 2 (How is a View Created?) ..................................................................31 Oracle Views ..........................................................................................................................32 View Design – Step 3 (Introduction of Object:Access) .........................................................34 View Design – Step 4 (Object:Access Fully Utilized)...........................................................35 Oracle Views (Layered View Example) ................................................................................36 Oracle Views - Mandatory Conditions...................................................................................37 Oracle Views - Population Selection......................................................................................38 Review .................................................................................................................................39 Self Check ..............................................................................................................................40 Self Check - Answer Key.......................................................................................................43
Table of Contents (Continued)
Section D: Managing the Components of Object:Access ......................................................46 Overview ................................................................................................................................46 GTVSDAX Table...................................................................................................................48 GTVSDAX Fields - SQL Hierarchy Example .......................................................................51 GTVSDAX Fields - SQL Slotted Example............................................................................52 GTVSDAX - Parameter and Date Fields ...............................................................................55 Security .................................................................................................................................57 Review .................................................................................................................................59 Self Check ..............................................................................................................................60 Self Check - Answer Key.......................................................................................................62 Section E: Building an Object:Access Solution......................................................................64 Overview ................................................................................................................................64 Object:Access – Five-Step Solution.......................................................................................66 Step 1 – Analyze.....................................................................................................................67 Step 2 - Technical Evaluation ................................................................................................68 Step 3 – Build .........................................................................................................................69 Step 4 – Test ...........................................................................................................................70 Step 5 - Problem Resolution...................................................................................................71 Review .................................................................................................................................73 Self Check ..............................................................................................................................74 Self Check - Answer Key.......................................................................................................81 Section F: Wrap-up and Tidbits..............................................................................................91 Overview ................................................................................................................................91 Object:Access – Tidbits..........................................................................................................92 Object:Access - Example Functions with General.................................................................93
Section A: Introduction Lesson:
Overview
Workbook goal This course, targeted towards technical personnel, describes Banner Object:Access, which increases Banner's ad hoc reporting capabilities. Section contents Overview ..................................................................................................................................5 Course Introduction..................................................................................................................6
© SunGard 2004-2005
Object:Access Technical Training Page 5
Section A: Introduction Lesson:
Course Introduction
Course description The technical staff will build an Object:Access solution after it has received a lecture and system demonstration on the Object: Access product. To demonstrate proficiency with Object:Access, the participants will perform the four Object:Access scenario exercises. Objectives At the end of this course, participants will be able to: • Describe what Object:Access is and what it is not • Describe ODBC (Open Data Base Connectivity) • Discuss the four components of Object:Access • Explain the GTVSDAX table • Describe Banner security • Describe Oracle security • Perform the five steps that build an Object:Access solution Prerequisites Participants in this course are expected to have completed the Banner Navigation tutorial or must have equivalent experience navigating in the Banner System. Participants should be capable of performing the following tasks: SQL*Plus – Create views; perform multiple table joins; and execute views and function PL/SQL – Create stored functions; describe cursors, and use cursors Client responsibilities Before you set up the current module, the following elements must be defined in the Banner System: Reporting Data Model for Simplified Data Access If you are unable to complete these tasks before the course is scheduled, please contact your account consultant for assistance.
© SunGard 2004-2005
Object:Access Technical Training Page 6
Section B: Understanding Object:Access Lesson:
Overview
Introduction
Objectives At the end of this course, participants will be able to: • Describe what Object:Access is and what it is not • Describe ODBC (Open Data Base Connectivity) Prerequisites Participants in this course are expected to have completed the Banner Navigation tutorial or must have equivalent experience navigating in the Banner System. Participants should be capable of performing the following tasks: • SQL*Plus – Create views; perform multiple table joins; and execute views and function • PL/SQL – Create stored functions; describe cursors, and use cursors Section contents Overview ..................................................................................................................................7 What Object:Access Is Not ......................................................................................................8 What Object:Access Is... ..........................................................................................................9 ODBC .................................................................................................................................10 Object:Access Vs. Microsoft Access .....................................................................................11 Why Use Object:Access? .......................................................................................................12 Review .................................................................................................................................13 Self Check ..............................................................................................................................14 Self Check - Answer Key.......................................................................................................16
© SunGard 2004-2005
Object:Access Technical Training Page 7
Section B: Understanding Object:Access Lesson:
What Object:Access Is Not
What Object:Access is not • Object:Access is not "just" a set of views • Object:Access is not a reporting tool • Object:Access is not a complete data access solution • Object:Access is not a end user tool • Object:Access is not a "add-on" product • Object:Access is not a "end all", "do all" reporting solution • Object:Access is not a replacement for the Computer Center Staff
© SunGard 2004-2005
Object:Access Technical Training Page 8
Section B: Understanding Object:Access Lesson:
What Object:Access Is...
What Object:Access is… • Object:Access is a methodology • Object:Access is Oracle functions and views • Object:Access is utilizing common objects • Object:Access is eliminating the need for knowledge of the complexities of database relationships • Object:Access is consistency in data access • Object:Access is allowing data access to be handled in an easy and reportable format In short, Object:Access is Simplified Data Access.
© SunGard 2004-2005
Object:Access Technical Training Page 9
Section B: Understanding Object:Access Lesson:
ODBC
What is ODBC? • ODBC means Open Data Base Connectivity. • ODBC allows third party software to access an Oracle database. • In order to use ODBC, you must use Oracle's ODBC driver, not the ones delivered with the products (this is changing). • ODBC works in conjunction with a file called "TNSNAMES.ORA". Your TNSNAMES.ORA file contains accesses to various databases - see your DBA for details.
© SunGard 2004-2005
Object:Access Technical Training Page 10
Section B: Understanding Object:Access Lesson:
Object:Access Vs. Microsoft Access
Comparison Object:Access is a methodology that is part of the Banner baseline that prepares a layer of "logical" data. Microsoft Access is a reporting and data-updating tool that is available with the Microsoft Office Suite. Use MS Access to connect via an ODBC driver to the Banner database and retrieve data from an Object:Access view.
© SunGard 2004-2005
Object:Access Technical Training Page 11
Section B: Understanding Object:Access Lesson:
Why Use Object:Access?
Advantages • Dynamic Data Retrieval • Ease of Data Selection • Access Definition • Concept Definition • Concatenation of Like Information • Pre-organized Data Selection • Ease of Maintenance • Security
© SunGard 2004-2005
Object:Access Technical Training Page 12
Section B: Understanding Object:Access Lesson:
Review
Review • Object:Access is a methodology. • It is part of the Banner baseline products. • It is used to allow for simplified access of data. • It is used by MS Access, as well as tools such as: • Brio Query • Crystal Reports • FOCUS • Cognos Impromptu • Technical staff must have SQL*Plus knowledge to create and/or maintain Object:Access processes. • End Users only need permission to processes (details will be discussed later).
© SunGard 2004-2005
Object:Access Technical Training Page 13
Section B: Understanding Object:Access Lesson:
Self Check
Directions Use the information you have learned in this workbook to complete this self-check activity. Exercise 1 Describe the Ethnicity table STVETHN, the Ethnicity Category table STVETCT and the Person Demographic table SPBPERS.
Exercise 2 Write a SQL script to produce a report that lists each ethnicity category and the count of entries associated with that category.
Exercise 3 Compare the total of entries in the SPBPERS table to the totaled count of entries from the SQL script.
Is it the same or different? Why?
© SunGard 2004-2005
Object:Access Technical Training Page 14
Section B: Understanding Object:Access Lesson:
Self Check (Continued)
Exercise 4 Create a PL/SQL procedure and store it in the database to return the ethnicity category and the associated count using the approach above. The procedure needs to display the output within SQL*Plus using the following command: SQL> execute p_get_etct_category; • •
Do the results match those in Exercise 2? Why? Which is better, and why?
© SunGard 2004-2005
Object:Access Technical Training Page 15
Section B: Understanding Object:Access Lesson:
Self Check - Answer Key
Exercise 1 Describe the Ethnicity table STVETHN, the Ethnicity Category table STVETCT and the Person Demographic table SPBPERS. SQL> desc stvethn SQL> desc stvetct SQL> desc spbpers Exercise 2 Write a SQL script to produce a report that lists each ethnicity category and the count of entries associated with that category. SQL> compute sum of count(*) on report SQL> break on report SQL> select stvetct_desc Category, count(*) from stvetct, stvethn, spbpers SQL> where spbpers_ethn_code = stvethn_code SQL> and stvethn_etct_code = stvetct_code SQL> group by stvetct_desc; Exercise 3 Compare the total of entries in the SPBPERS table to the totaled count of entries from the SQL script. SQL> clear breaks SQL> select count(*) from spbpers; Is it the same or different? Why? Different, because the lack of outer join(s) prevents every row from being returned.
© SunGard 2004-2005
Object:Access Technical Training Page 16
Section B: Understanding Object:Access Lesson:
Self Check - Answer Key (Continued)
Exercise 4 Create a PL/SQL procedure and store it in the database to return the ethnicity category and the associated count using the approach above. The procedure needs to display the output within SQL*Plus using the following command: SQL> execute p_get_etct_category; • •
Do the results match those in Exercise 2? Why? Which is better, and why?
CREATE OR REPLACE PROCEDURE P_GET_ETCT_CATEGORY AS DESCRIP varchar2(30) := NULL; CNTR NUMBER := 0; TOT NUMBER := 0; CURSOR GET_IT IS SELECT STVETCT_DESC, COUNT(*) FROM STVETCT,STVETHN,SPBPERS WHERE SPBPERS_ETHN_CODE = STVETHN_CODE AND STVETHN_ETCT_CODE = STVETCT_CODE GROUP BY STVETCT_DESC; BEGIN OPEN GET_IT; DBMS_OUTPUT.PUT_LINE('ETHNICITY CATEGORY REPORT'); LOOP FETCH GET_IT INTO DESCRIP, CNTR; EXIT WHEN GET_IT%NOTFOUND; DBMS_OUTPUT.PUT_LINE(RPAD(DESCRIP,40,'.') ||LPAD(CNTR,4,'.')); TOT := TOT + CNTR; END LOOP; DBMS_OUTPUT.PUT_LINE(RPAD('TOTAL',36,'.') || LPAD(TOT,8,'.')); END;
© SunGard 2004-2005
Object:Access Technical Training Page 17
Section C: Components of Object:Access Lesson:
Overview
Introduction
Objectives At the end of this course, participants will be able to: • Discuss the four components of Object:Access Prerequisites Participants in this course are expected to have completed the Banner Navigation tutorial or must have equivalent experience navigating in the Banner System. Participants should be capable of performing the following tasks: • SQL*Plus – Create views; perform multiple table joins; and execute views and function • PL/SQL – Create stored functions; describe cursors, and use cursors
© SunGard 2004-2005
Object:Access Technical Training Page 18
Section C: Components of Object:Access Lesson:
Overview (Continued)
Section contents Overview ................................................................................................................................18 Object:Access Components....................................................................................................20 Data Model .............................................................................................................................21 Naming Conventions..............................................................................................................22 Oracle Functions.....................................................................................................................23 Concept Functions..................................................................................................................24 Access Functions....................................................................................................................26 Oracle Views ..........................................................................................................................28 View Design – Step 1 (View Data Identification) .................................................................29 Object:Access - What Keys? ..................................................................................................30 View Design – Step 2 (How is a View Created?) ..................................................................31 Oracle Views ..........................................................................................................................32 View Design – Step 3 (Introduction of Object:Access) .........................................................34 View Design – Step 4 (Object:Access Fully Utilized)...........................................................35 Oracle Views (Layered View Example) ................................................................................36 Oracle Views - Mandatory Conditions...................................................................................37 Oracle Views - Population Selection......................................................................................38 Review .................................................................................................................................39 Self Check ..............................................................................................................................40 Self Check - Answer Key.......................................................................................................43
© SunGard 2004-2005
Object:Access Technical Training Page 19
Section C: Components of Object:Access Lesson:
Object:Access Components
Components • Data Model • Naming Conventions • Oracle Functions • Oracle Views • Advanced Oracle Features o Oracle Procedures* o Oracle Triggers* o Oracle Snapshots* o Non-Banner Tables* * These features are part of the Reporting Services - primarily for data replication
© SunGard 2004-2005
Object:Access Technical Training Page 20
Section C: Components of Object:Access Lesson:
Data Model
Definition Data models are crucial to reporting success. A data model: • Defines relationships between users and views • Identifies data origination • Describes concept definitions • Defines mandatory/recommended conditions • Identifies purpose of view • Identifies uniqueness of rows returned No view should be created without an accompanying data model. Example
Functions
© SunGard 2004-2005
Object:Access Technical Training Page 21
Section C: Components of Object:Access Lesson:
Naming Conventions
Column attributes Column attributes have user-friendly names: • FIRST_NAME • LAST_NAME • ACCOUNT_BALANCE • AMOUNT_DUE View names View names are in form of a(x)_view_name, where (x) stands for product name: • • • • • • • •
AA_ AF_ AG_ AP_ AR_ AS_ AT_ AW_
Advancement Finance General Human Resources Financial Aid Student Accounts Receivable Institution Specific
Examples Banner Name APREXCL_DATE NBRJOBS_DFPR_CODE SORBCNT_NAME SFBETRM_AR_IND SPRADDR_ATYP_CODE
O:A Attribute Name EXCLUSION_DATE JOB_DEFERRED_PAY PRIMARY_SOURCE_CONTACT ENROLLMENT_AR_IND ADDRESS_TYPE1
Key attributes In a data model, key attributes are defined on the first page of the view description. In views, key attributes are defined as ATTRIBUTE_NAME_KEY: • PIDM_KEY • TERM_CODE_KEY • FISCAL_YEAR_KEY Key attributes define what information is returned from the view for a unique row. When all key attributes are selected in a view, a faster response is returned.
© SunGard 2004-2005
Object:Access Technical Training Page 22
Section C: Components of Object:Access Lesson:
Oracle Functions
Function storage Oracle functions are stored as PL/SQL blocks in the database. Creation scripts are stored in the DBPROCS directory. Types There are two primary types of Oracle functions: • Access • Concepts Their usage allows consistency in data access and in object definition. Functions can be utilized as a column or filtration criteria within SQL. Functions - Example of simplicity Select a name using the standard SQL approach: SELECT DECODE (spriden_mi, '', (spriden_last_name || ', ' || spriden_first_name), (spriden_last_name || ', ' || spriden_first_name || ' ' || SUBSTR(spriden_mi,1,1) || '.')) FROM spriden WHERE spriden_change_ind IS null; Let's look at this using an Object:Access approach: SELECT f_format_name(spriden_pidm,'FMIL') FROM spriden WHERE spriden_change_ind is null; Another Object:Access approach option is: f_format_name(spriden_pidm,'LFMI')
Which is easier?
© SunGard 2004-2005
Object:Access Technical Training Page 23
Section C: Components of Object:Access Lesson:
Concept Functions
Characteristics • Used to define an object concept: o "Enrolled" o "Salary" o "Out of Balance" • Most often used as an indicator • Always returns values of "Y" or "N" • Designed for user enhancement • Concepts designed to match Banner defaults where they exist • Concepts designed to be Banner defaults where none exist Example Concept function CREATE OR REPLACE FUNCTION F_LOST_AL_IND (PIDM NUMBER) RETURN VARCHAR2 AS IND VARCHAR2(1) := 'N'; CURSOR CHECK_IND IS SELECT 'N' FROM DUAL WHERE EXISTS (SELECT SPRADDR_PIDM FROM SPRADDR WHERE SPRADDR_PIDM = PIDM AND (((SPRADDR_TO_DATE >= SYSDATE) AND (SPRADDR_STATUS_IND = 'A' OR SPRADDR_STATUS_IND IS NULL)) OR ((SPRADDR_TO_DATE IS NULL) AND (SPRADDR_STATUS_IND = 'A' OR SPRADDR_STATUS_IND IS NULL)))); BEGIN OPEN CHECK_IND; FETCH CHECK_IND INTO IND; IF CHECK_IND%NOTFOUND THEN IND := 'Y'; END IF; CLOSE CHECK_IND; RETURN IND; END; /
© SunGard 2004-2005
Object:Access Technical Training Page 24
Section C: Components of Object:Access Lesson:
Concept Functions (Continued)
Example Concept function: Usage SELECT SPRIDEN_ID, F_FORMAT_NAME(SPRIDEN_PIDM, 'FMIL') Name FROM SPRIDEN WHERE SPRIDEN_CHANGE_IND IS NULL AND F_LOST_AL_IND(SPRIDEN_PIDM) = 'Y'; /
© SunGard 2004-2005
Object:Access Technical Training Page 25
Section C: Components of Object:Access Lesson:
Access Functions
Characteristics • Used to define data access methodology o Retrieving addresses o Retrieving "delimited" data o De-normalizing repeating data • Most often used to return ROWID • Designed for user modification • Available for user on any SQL application • Test confirm ROWID access fastest • Outer joins typically used • Access functions typically used in "where" clause Example Access function CREATE OR REPLACE FUNCTION F_GET_SPRINTL_ROWID (PIDM NUMBER) RETURN ROWID AS AROW ROWID := NULL; CURSOR GET_SPRINTL IS SELECT ROWID FROM SPRINTL WHERE SPRINTL_PIDM = PIDM ORDER BY SPRINTL_VISA_ISSUE_DATE DESC; BEGIN OPEN GET_SPRINTL; FETCH GET_SPRINTL INTO AROW; CLOSE GET_SPRINTL; RETURN AROW; END; /
© SunGard 2004-2005
Object:Access Technical Training Page 26
Section C: Components of Object:Access Lesson:
Access Functions (Continued)
Example Access function: Usage SELECT SPRIDEN_ID, F_FORMAT_NAME(SPRIDEN_PIDM, 'FMIL') Name, SPRINTL_VTYP_CODE_CURRENT, SPRINTL_VISA_NUMBER, SPRINTL_VISA_ISSUE_DATE, SPRINTL_VISA_EXPIRE_DATE FROM SPRINTL, SPRIDEN WHERE SPRIDEN_CHANGE_IND IS NULL AND SPRINTL.ROWID = F_GET_SPRINTL_ROWID (SPRIDEN_PIDM); /
© SunGard 2004-2005
Object:Access Technical Training Page 27
Section C: Components of Object:Access Lesson:
Oracle Views
Views Views provide a means to access data in a logical format. Creation scripts are stored in VIEWS directory. Characteristics Views: • Allow for de-normalization dynamically • Provide the ability to easily apply rules and security • Do not store data, therefore do not take up disk space • Provide the ability to use friendly names • Can be layered to provide "ease of maintenance" dependency Layered views Layered views are used when a single view is not appropriate • Data Expansion • Data Explosion • Dependencies When layered, views can be: • Base (Primary joins - Script name the same) • Intermediate (Data manipulation - Script name the same) • Top (User-friendly names - always created - synonym created) Existing Banner Application Security is typically applied at the base view level.
© SunGard 2004-2005
Object:Access Technical Training Page 28
Section C: Components of Object:Access Lesson:
View Design – Step 1 (View Data Identification)
Diagram
© SunGard 2004-2005
Object:Access Technical Training Page 29
Section C: Components of Object:Access Lesson:
Object:Access - What Keys?
SPRADDR Table SPRADDR_PIDM SPRADDR_ATYP_CODE SPRADDR_SEQNO SPRADDR_FROM_DATE SPRADDR_TO_DATE SPRADDR_STREET_LINE1 SPRADDR_STREET_LINE2 SPRADDR_STREET_LINE3 SPRADDR_CITY SPRADDR_STAT_CODE SPRADDR_ZIP SPRADDR_CNTY_CODE SPRADDR_NATN_CODE SPRADDR_PHONE_AREA SPRADDR_PHONE_NUMBER SPRADDR_PHONE_EXT SPRADDR_STATUS_IND SPRADDR_ACTIVITY_DATE
NOT NULL NOT NULL NOT NULL
NOT NULL
NOT NULL
NUMBER(8) VARCHAR2(2) NUMBER(2) DATE DATE VARCHAR2(30) VARCHAR2(30) VARCHAR2(30) VARCHAR2(20) VARCHAR2(3) VARCHAR2(10) VARCHAR2(5) VARCHAR2(5) VARCHAR2(3) VARCHAR2(7) VARCHAR2(4) VARCHAR2(1) DATE
SPRADDR Table with Keys SPRADDR_PIDM SPRADDR_ATYP_CODE SPRADDR_SEQNO SPRADDR_FROM_DATE SPRADDR_TO_DATE SPRADDR_STREET_LINE1 SPRADDR_STREET_LINE2 SPRADDR_STREET_LINE3 SPRADDR_CITY SPRADDR_STAT_CODE SPRADDR_ZIP SPRADDR_CNTY_CODE SPRADDR_NATN_CODE SPRADDR_PHONE_AREA SPRADDR_PHONE_NUMBER SPRADDR_PHONE_EXT SPRADDR_STATUS_IND SPRADDR_ACTIVITY_DATE
NOT NULL NOT NULL NOT NULL
NOT NULL
NOT NULL
© SunGard 2004-2005
NUMBER(8) VARCHAR2(2) NUMBER(2) DATE DATE VARCHAR2(30) VARCHAR2(30) VARCHAR2(30) VARCHAR2(20) VARCHAR2(3) VARCHAR2(10) VARCHAR2(5) VARCHAR2(5) VARCHAR2(3) VARCHAR2(7) VARCHAR2(4) VARCHAR2(1) DATE
Object:Access Technical Training Page 30
Section C: Components of Object:Access Lesson:
View Design – Step 2 (How is a View Created?)
Diagram
© SunGard 2004-2005
Object:Access Technical Training Page 31
Section C: Components of Object:Access Lesson:
Oracle Views
Questions • Can the preceding selection be easily coded in SQL? • Can the information be easily retrieved by users? • Can the information be easily retrieved by technicians? • Does the method of data retrieval need replication? • Are you sure it's coded correctly? Really sure? Let's compare and try for just one address...
© SunGard 2004-2005
Object:Access Technical Training Page 32
Section C: Components of Object:Access Lesson:
Oracle Views (Continued)
Example SELECT SPRIDEN FIELDS, SPRADDR FIELDS, SPBPERS FIELDS, DECODE(SPRIDEN_MI, '',(SPRIDEN_LAST_NAME || ', ' || SPRIDEN_FIRST_NAME) , (SPRIDEN_LAST_NAME || ', ' || SPRIDEN_FIRST_NAME || ' ' || SUBSTR(SPRIDEN_MI,1,1) || '.')) DECODE(SPBPERS_BIRTH_DATE,NULL,NULL, TRUNC((TRUNC(NVL(SPBPERS_DEAD_DATE,SYSDATE)) TRUNC(SPBPERS_BIRTH_DATE)) / 365.25)), STVETHN FIELDS FROM STVETHN, SPRADDR Y, SPBPERS, SPRIDEN WHERE SPRIDEN_CHANGE_IND IS NULL AND SPBPERS_PIDM(+) = SPRIDEN_PIDM AND STVETHN_CODE(+) = SPBPERS_ETHN_CODE AND Y.SPRADDR_PIDM = SPRIDEN_PIDM AND ((Y.SPRADDR_STATUS_IND IS NULL) OR (Y.SPRADDR_STATUS_IND = 'A')) AND Y.SPRADDR_ATYP_CODE = 'MA'……………. AND TRUNC(SYSDATE) BETWEEN TRUNC(NVL(Y.SPRADDR_FROM_DATE, NVL(Y.SPRADDR_TO_DATE,SYSDATE))) AND TRUNC(NVL(Y.SPRADDR_TO_DATE,SYSDATE)) AND Y.SPRADDR_SEQNO = (SELECT MIN(X.SPRADDR_SEQNO) FROM SPRADDR X WHERE X.SPRADDR_PIDM = SPRIDEN_PIDM AND X.SPRADDR_ATYP_CODE = Y.SPRADDR_ATYP_CODE AND ((X.SPRADDR_STATUS_IND IS NULL) OR (X.SPRADDR_STATUS_IND = 'A')) AND TRUNC(SYSDATE) BETWEEN TRUNC(NVL(Y.SPRADDR_FROM_DATE, NVL(Y.SPRADDR_TO_DATE,SYSDATE))) AND TRUNC(NVL(Y.SPRADDR_TO_DATE,SYSDATE)));
© SunGard 2004-2005
Object:Access Technical Training Page 33
Section C: Components of Object:Access Lesson:
View Design – Step 3 (Introduction of Object:Access)
Diagram
Example SELECT SPRIDEN FIELDS, SPRADDR FIELDS, SPBPERS FIELDS, F_FORMAT_NAME(SPRIDEN_PIDM, 'FMIL'), F_CALCULATE_AGE (NULL, SPBPERS_BIRTH_DATE, SPBPERS_DEAD_DATE), DECODE(SPBPERS_ETHN_CODE,NULL,NULL, F_GET_EEOC_DESC(SPBPERS_ETHN_CODE)) FROM SPRADDR, SPBPERS, SPRIDEN WHERE SPRIDEN_CHANGE_IND IS NULL AND SPBPERS_PIDM(+) = SPRIDEN_PIDM AND SPRADDR.ROWID = F_GET_ADDRESS_ROWID (SPRIDEN_PIDM, 'ENTYADDR','A', SYSDATE, 1, 'P', NULL);
© SunGard 2004-2005
Object:Access Technical Training Page 34
Section C: Components of Object:Access Lesson:
View Design – Step 4 (Object:Access Fully Utilized)
Diagram
Example SELECT SPRIDEN FIELDS, SPRADDR FIELDS, SPBPERS FIELDS, F_FORMAT_NAME(SPRIDEN_PIDM, 'FMIL'), F_CALCULATE_AGE (NULL, SPBPERS_BIRTH_DATE, SPBPERS_DEAD_DATE), DECODE(SPBPERS_ETHN_CODE,NULL,NULL, F_GET_EEOC_DESC(SPBPERS_ETHN_CODE)) FROM SPRADDR, SPBPERS, SPRIDEN WHERE SPRIDEN_CHANGE_IND IS NULL AND SPBPERS_PIDM(+) = SPRIDEN_PIDM AND SPRADDR.ROWID = F_GET_ADDRESS_ROWID (SPRIDEN_PIDM, 'ENTYADDR', 'A', SYSDATE, 1, 'P', NULL) AND F_SECURITY_CHECK(SPRIDEN_PIDM) = 'Y';
© SunGard 2004-2005
Object:Access Technical Training Page 35
Section C: Components of Object:Access Lesson:
Oracle Views (Layered View Example)
Diagram 1
Notice the functions being used as columns. Diagram 2
© SunGard 2004-2005
Object:Access Technical Training Page 36
Section C: Components of Object:Access Lesson:
Oracle Views - Mandatory Conditions
Conditions • Must be supplied at the time of building the query with the report writer • Lack of a mandatory condition may invalidate the data returned • Lack of mandatory condition(s) may cause view severe performance issues
© SunGard 2004-2005
Object:Access Technical Training Page 37
Section C: Components of Object:Access Lesson:
Oracle Views - Population Selection
Requirements Population Selection requires standard Banner naming conventions: • • •
Seven-character view name (XXXXXXX) Column names require view name prefix (XXXXXXX_column_name) PIDM columns require the value "PIDM" to be last (XXXXXXX_PIDM)
Layered views should use base (intermediate) with standard names. Function usage within views allows flexibility. Oracle views - Population selection example CREATE OR REPLACE VIEW GOVSDA1 AS SELECT SPRIDEN_PIDM GOVSDA1_PIDM, F_CALCULATE_AGE (SYSDATE, SPBPERS_BIRTH_DATE, SPBPERS_DEAD_DATE) GOVSDA1_AGE, F_PAYROLL_EMPLOYEE_IND (SPRIDEN_PIDM) GOVSDA1_EMPLOYEE_IND, SPBPERS_MRTL_CODE GOVSDA1_MARITAL_STATUS, SPBPERS_ETHN_CODE GOVSDA1_ETHNICITY_CODE FROM SPBPERS, SPRIDEN WHERE SPRIDEN_CHANGE_IND IS NULL AND SPBPERS_PIDM (+) = SPRIDEN_PIDM /
© SunGard 2004-2005
Object:Access Technical Training Page 38
Section C: Components of Object:Access Lesson:
Review
Review • Object:Access is made-up of Oracle views and functions • Functions can be used to define concepts for use as columns or filtration values • Functions can be used to simplify data access methods • Functions and views can be used to de-normalize data • Views can be layered to provide security/filtration
© SunGard 2004-2005
Object:Access Technical Training Page 39
Section C: Components of Object:Access Lesson:
Self Check
Directions Use the information you have learned in this workbook to complete this self-check activity. Exercise 1 Create a PL/SQL function and store it in the database to return the ethnicity category. The function should use the PIDM as its parameter.
Exercise 2 Create a SQL script to produce a report that lists each ethnicity category and the count of entries associated with the category using only the function and the SPBPERS table: Why or why not? Which is better and why?
Exercise 3 What methods could you use to ensure that "null" categories are displayed?
© SunGard 2004-2005
Object:Access Technical Training Page 40
Section C: Components of Object:Access Lesson:
Self Check (Continued)
Exercise 4 Find or create a function to format an entity's name into a single field based on a PIDM and format type parameters. (hint: ALL_OBJECTS view and ALL_SOURCE view)
Exercise 5 Create a view that joins the SPRIDEN and SPBPERS tables. The view should contain the columns and associated elements for the ID, PIDM_KEY, DOB (Date of birth), Deceased Date, Name (in the format of "FIRST M. LAST"), and Category (ethnicity category from the STVETCT table).
© SunGard 2004-2005
Object:Access Technical Training Page 41
Section C: Components of Object:Access Lesson:
Self Check (Continued)
Exercise 6 Bonus 1: Create a function to calculate age and incorporate in the above view.
Exercise 7 Bonus 2: Create a layered view of all people and their ages using the above view.
© SunGard 2004-2005
Object:Access Technical Training Page 42
Section C: Components of Object:Access Lesson:
Self Check - Answer Key
Exercise 1 Create a PL/SQL function and store it in the database to return the ethnicity category. The function should use the PIDM as its parameter. CREATE OR REPLACE FUNCTION F_GET_ETCT_CATEGORY (PIDM NUMBER) RETURN VARCHAR2 AS RETURN_FIELD STVETCT.STVETCT_DESC%TYPE := NULL; CURSOR GET_DATA IS SELECT STVETCT_DESC FROM STVETCT,STVETHN, SPBPERS WHERE SPBPERS_PIDM = PIDM AND SPBPERS_ETHN_CODE = STVETHN_CODE AND STVETHN_ETCT_CODE = STVETCT_CODE; BEGIN OPEN GET_DATA; FETCH GET_DATA INTO RETURN_FIELD; CLOSE GET_DATA; RETURN RETURN_FIELD; END;
Exercise 2 Create a SQL script to produce a report that lists each ethnicity category and the count of entries associated with the category using only the function and the SPBPERS table: Why or why not? Which is better and why? COMPUTE SUM OF COUNT(*) ON REPORT COLUMN CATEGORY FORMAT A30 SELECT F_GET_ETCT_CATEGORY(SPBPERS_PIDM) CATEGORY, COUNT(*)FROM SPBPERS GROUP BY F_GET_ETCT_CATEGORY(SPBPERS_PIDM);
Exercise 3 What methods could you use to ensure that "null" categories are displayed? NVL(F_GET_ETCT_CATEGORY(SPBPERS_PIDM) , 'No Ethnicity Reported')
© SunGard 2004-2005
Object:Access Technical Training Page 43
Section C: Components of Object:Access Lesson:
Self Check - Answer Key (Continued)
Exercise 4 Find or create a function to format an entity's name into a single field based on a PIDM and format type parameters. (hint: ALL_OBJECTS view and ALL_SOURCE view) SELECT FROM WHERE AND SELECT FROM WHERE
OBJECT_NAME ALL_OBJECTS OBJECT_TYPE = 'FUNCTION' OBJECT_NAME LIKE '%NAME%'; TEXT ALL_SOURCE NAME = 'F_FORMAT_NAME';
Exercise 5 Create a view that joins the SPRIDEN and SPBPERS tables. The view should contain the columns and associated elements for the ID, PIDM_KEY, DOB (Date of birth), Deceased Date, Name (in the format of "FIRST M. LAST"), and Category (ethnicity category from the STVETCT table). CREATE OR REPLACE VIEW GWVETCT AS SELECT SPRIDEN_PIDM PIDM_KEY, SPRIDEN_ID ID, SPBPERS_BIRTH_DATE DOB, SPBPERS_DEAD_DATE DEAD_DATE, SUBSTR(F_FORMAT_NAME(SPRIDEN_PIDM,'FMIL'),1,93) NAME, SUBSTR(F_GET_ETCT_CATEGORY(SPRIDEN_PIDM),1,30) CATEGORY, SPRIDEN_ENTITY_IND ENTITY_IND FROM SPBPERS, SPRIDEN WHERE SPRIDEN_CHANGE_IND IS NULL AND SPBPERS_PIDM (+) = SPRIDEN_PIDM;
© SunGard 2004-2005
Object:Access Technical Training Page 44
Section C: Components of Object:Access Lesson:
Self Check - Answer Key (Continued)
Exercise 6 Bonus 1: Create a function to calculate age and incorporate in the above view. CREATE OR REPLACE FUNCTION F_AGE (FROM_DATE DATE, BIRTH_DATE DATE, DEAD_DATE DATE) RETURN NUMBER AS AGE NUMBER(3); BEGIN IF BIRTH_DATE IS NOT NULL THEN AGE := TRUNC((TRUNC(NVL(DEAD_DATE,NVL (FROM_DATE,SYSDATE))) - TRUNC(BIRTH_DATE)) / 365.25); ELSE AGE := NULL; END IF; RETURN AGE; END;
Exercise 7 Bonus 2: Create a layered view of all people and their ages using the above view. CREATE OR REPLACE VIEW GWVPEOP AS SELECT PIDM_KEY, ID, DOB, NAME, CATEGORY, F_AGE (SYSDATE, DOB, DEAD_DATE) AGE FROM GWVETCT WHERE ENTITY_IND = 'P';
© SunGard 2004-2005
Object:Access Technical Training Page 45
Section D: Managing the Components of Object:Access Lesson:
Overview
Introduction
Objectives At the end of this course, participants will be able to: • • •
Explain the GTVSDAX table Describe Banner security Describe Oracle security
Prerequisites Participants in this course are expected to have completed the Banner Navigation tutorial or must have equivalent experience navigating in the Banner System. Participants should be capable of performing the following tasks: • SQL*Plus – Create views; perform multiple table joins; and execute views and function • PL/SQL – Create stored functions; describe cursors, and use cursors
© SunGard 2004-2005
Object:Access Technical Training Page 46
Section D: Managing the Components of Object:Access Lesson:
Overview (Continued)
Section contents Overview ................................................................................................................................46 GTVSDAX Table...................................................................................................................48 GTVSDAX Fields - SQL Hierarchy Example .......................................................................51 GTVSDAX Fields - SQL Slotted Example............................................................................52 GTVSDAX - Parameter and Date Fields ...............................................................................55 Security .................................................................................................................................57 Review .................................................................................................................................59 Self Check ..............................................................................................................................60 Self Check - Answer Key.......................................................................................................62
© SunGard 2004-2005
Object:Access Technical Training Page 47
Section D: Managing the Components of Object:Access Lesson:
GTVSDAX Table
Banner and Oracle Security GTVSDAX is a crosswalk/concept table: • Rule table that controls which values are returned • Defines repeating groups and their view relationships • Defines crosswalk between internal Banner codes and institution-specific values • Provides "parameters" (i.e., A/R aging slots, reporting dates) • Allows "hard coding" to be user driven • Control is maintained via functions that access GTVSDAX Note: Many views will not return all columns without accurate entries in GTVSDAX. GTVSDAX - Table layout Field Name
Datatype
GTVSDAX_EXTERNAL_CODE GTVSDAX_INTERNAL_CODE GTVSDAX_REPORTING_DATE GTVSDAX_TRANSLATION_CODE GTVSDAX_INTERNAL_CODE_SEQNO GTVSDAX_INTERNAL_CODE_GROUP GTVSDAX_DESC GTVSDAX_SYSREQ_IND
NOT NULL VARCHAR2(15) NOT NULL VARCHAR2(10) DATE VARCHAR2(15) NUMBER(2) NOT NULL VARCHAR2(20) NOT NULL VARCHAR2(30) VARCHAR2(1)
GTVSDAX_ACTIVITY_DATE
NOT NULL
DATE
GTVSDAX - Repeating group hierarchies A "hierarchy" selection process attempts to return data into a column until data is found or no hierarchy keys remain. These values dictate hierarchy relationships between views and data being retrieved. These are used to retrieve data that is required regardless of which key value is used to access it, and most typically used to select address information. Hierarchies are institution-specific.
© SunGard 2004-2005
Object:Access Technical Training Page 48
Section D: Managing the Components of Object:Access Lesson:
GTVSDAX Table (Continued)
GTVSDAX fields - Hierarchy usage GTVSDAX Field Name GTVSDAX_EXTERNAL_CODE GTVSDAX_INTERNAL_CODE GTVSDAX_REPORTING_DATE GTVSDAX_TRANSLATION_CODE GTVSDAX_INTERNAL_CODE_SEQNO GTVSDAX_INTERNAL_CODE_GROUP GTVSDAX_DESC GTVSDAX_SYSREQ_IND GTVSDAX_ACTIVITY_DATE GTVSDAX Field Name GTVSDAX_EXTERNAL_CODE GTVSDAX_INTERNAL_CODE GTVSDAX_REPORTING_DATE GTVSDAX_TRANSLATION_CODE GTVSDAX_INTERNAL_CODE_SEQNO GTVSDAX_INTERNAL_CODE_GROUP GTVSDAX_DESC GTVSDAX_SYSREQ_IND GTVSDAX_ACTIVITY_DATE GTVSDAX Field Name GTVSDAX_EXTERNAL_CODE GTVSDAX_INTERNAL_CODE GTVSDAX_REPORTING_DATE GTVSDAX_TRANSLATION_CODE GTVSDAX_INTERNAL_CODE_SEQNO GTVSDAX_INTERNAL_CODE_GROUP GTVSDAX_DESC GTVSDAX_SYSREQ_IND GTVSDAX_ACTIVITY_DATE
1st Entry MA ENTYADDR 1 ADDRESS Address Code 1 Y 17-JAN-96 1st Entry MA ENTYADDR
2nd Entry PR ENTYADDR
1 ADDRESS Address Code 1 Y 17-JAN-96
2 ADDRESS Address Code 2 Y 17-JAN-96
1st Entry MA ENTYADDR
2nd Entry PR ENTYADDR
1 ADDRESS Address Code 1 Y 17-JAN-96
2 ADDRESS Address Code 2 Y 17-JAN-96
© SunGard 2004-2005
Object:Access Technical Training Page 49
Section D: Managing the Components of Object:Access Lesson:
GTVSDAX Table (Continued)
Fields The external code field is changed by the user to match STVATYP codes for addresses for the internal code. The internal code is not changed by the user. The internal sequence number (seqno) defines the order of entries to be returned in the view. Internal group and description are not to be changed by user. Activity date is the system date. Create as many as you need.
© SunGard 2004-2005
Object:Access Technical Training Page 50
Section D: Managing the Components of Object:Access Lesson:
GTVSDAX Fields - SQL Hierarchy Example
SQL Statement WHERE SPRADDR.ROWID = ADDRESS_FUNCTION (PARAMS, 'HIERARCHY',PARAMS...)
PL/SQL Statements CREATE OR REPLACE FUNCTION ADDRESS_FUNCTION (PARAMS, HIERARCHY VARHCAR2, PARAMS…) RETURN ROWID ……. CURSOR GET_DATA_SDAX IS SELECT GTVSDAX_EXTERNAL_CODE FROM GTVSDAX WHERE GTVSDAX_INTERNAL_CODE = HIERARCHY AND GTVSDAX_INTERNAL_CODE_GROUP = 'ADDRESS' ORDER BY GTVSDAX_INTERNAL_CODE_SEQNO; ……. CURSOR GET_SPRADDR_DATA IS SELECT ROWID FROM SPRADDR WHERE SPRADDR_ATYP_CODE = GTVSDAX_EXTERNAL_CODE_VALUE
© SunGard 2004-2005
Object:Access Technical Training Page 51
Section D: Managing the Components of Object:Access Lesson:
GTVSDAX Fields - SQL Slotted Example
GTVSDAX - Repeating group slots A "slotted" selection process attempts to return data into a column until data is found for that key for that position within the view. These values dictate "slotted" relationships between views and data being retrieved, and are used to retrieve data that is required based on which key value is used to access it. These are most typically used to select repeating information that is dissimilar other than type. Slotted entries are institution-specific.
© SunGard 2004-2005
Object:Access Technical Training Page 52
Section D: Managing the Components of Object:Access Lesson:
GTVSDAX Fields - SQL Slotted Example (Continued)
GTVSDAX fields - Slotted usage GTVSDAX Field Name GTVSDAX_EXTERNAL_CODE GTVSDAX_INTERNAL_CODE GTVSDAX_REPORTING_DATE GTVSDAX_TRANSLATION_CODE GTVSDAX_INTERNAL_CODE_SEQNO GTVSDAX_INTERNAL_CODE_GROUP GTVSDAX_DESC GTVSDAX_SYSREQ_IND GTVSDAX_ACTIVITY_DATE GTVSDAX Field Name GTVSDAX_EXTERNAL_CODE GTVSDAX_INTERNAL_CODE GTVSDAX_REPORTING_DATE GTVSDAX_TRANSLATION_CODE GTVSDAX_INTERNAL_CODE_SEQNO GTVSDAX_INTERNAL_CODE_GROUP GTVSDAX_DESC GTVSDAX_SYSREQ_IND GTVSDAX_ACTIVITY_DATE GTVSDAX Field Name GTVSDAX_EXTERNAL_CODE GTVSDAX_INTERNAL_CODE GTVSDAX_REPORTING_DATE GTVSDAX_TRANSLATION_CODE GTVSDAX_INTERNAL_CODE_SEQNO GTVSDAX_INTERNAL_CODE_GROUP GTVSDAX_DESC GTVSDAX_SYSREQ_IND GTVSDAX_ACTIVITY_DATE
• • • • •
1st Entry FA ENTYHOLD 1 HOLDS Hold Code 1 Y 17-JAN-96 1st Entry FA ENTYHOLD 1 HOLDS Hold Code 1 Y 17-JAN-96 1st Entry FA ENTYHOLD 1 HOLDS Hold Code 1 Y 17-JAN-96
2nd Entry TR ENTYHOLD 2 HOLDS Hold Code 2 Y 17-JAN-96 2nd Entry TR ENTYHOLD 2 HOLDS Hold Code 2 Y 17-JAN-96
The external code field is changed by the user to match STVHLDD codes. The internal code is not changed by the user. The internal sequence number (seqno) defines the order that the entries will be retrieved in the view. Internal group and description are not to be changed by user. Activity date is the system date.
© SunGard 2004-2005
Object:Access Technical Training Page 53
Section D: Managing the Components of Object:Access Lesson:
GTVSDAX Fields - SQL Slotted Example (Continued)
SQL Statement WHERE TABLE_ALIAS_1.ROWID = A_FUNCTION (PARAMS, 'SLOT_CONCEPT', SLOT) AND TABLE_ALIAS_2.ROWID = A_FUNCTION (PARAMS, 'SLOT_CONCEPT', SLOT + 1) ……….
PL/SQL Statements CREATE OR REPLACE FUNCTION A_FUNCTION (PARAMS, SLOT_CONCEPT VARHCAR2, SLOT NUMBER)……. RETURN ROWID ……. CURSOR GET_DATA_SDAX IS SELECT GTVSDAX_EXTERNAL_CODE FROM GTVSDAX WHERE GTVSDAX_INTERNAL_CODE = SLOT_CONCEPT AND GTVSDAX_INTERNAL_CODE_GROUP = 'HOLDS' AND GTVSDAX_INTERNAL_CODE_SEQNO = SLOT; CURSOR GET_TABLE_ROWID IS SELECT ROWID FROM TABLE WHERE PARAMS = PARAMS AND TABLE_CODE = GTVSDAX_EXTERNAL_CODE_VALUE;
© SunGard 2004-2005
Object:Access Technical Training Page 54
Section D: Managing the Components of Object:Access Lesson:
GTVSDAX - Parameter and Date Fields
Entries Entries are institution-specific. Parameter • These fields are used to allow dynamic control of variables • Similar to Job Submission values, but are associated with a view, not a particular job Dates • Used to override specific date selection routines • Critical to some view processing • "Seed" values must be removed or replaced • Date control is designed for only "some" views and functions GTVSDAX fields - Parameter usage GTVSDAX Field Name GTVSDAX_EXTERNAL_CODE GTVSDAX_INTERNAL_CODE GTVSDAX_REPORTING_DATE GTVSDAX_TRANSLATION_CODE GTVSDAX_INTERNAL_CODE_SEQNO GTVSDAX_INTERNAL_CODE_GROUP GTVSDAX_DESC GTVSDAX_SYSREQ_IND GTVSDAX_ACTIVITY_DATE
1st Entry 30 FIRST_DAY
2nd Entry 60 SECOND_DAY
1 2 AR AGED SLOTS AR AGED SLOTS AR Aging Slots AR Aging Slots Y Y 17-JAN-96 17-JAN-96
The external code field is changed by the user for the user defined aged days on the aging report. The internal code is not changed by the user. The internal sequence number (seqno) defines the order of entries to be returned on the report. Internal group and description are not to be changed by user.
© SunGard 2004-2005
Object:Access Technical Training Page 55
Section D: Managing the Components of Object:Access Lesson:
GTVSDAX - Parameter and Date Fields (Continued)
GTVSDAX Fields - Date Usage GTVSDAX Field Name 1st Entry 2nd Entry GTVSDAX_EXTERNAL_CODE FIELD NOT USED FIELD NOT USED GTVSDAX_INTERNAL_CODE PAYRPROF PAYRPROF GTVSDAX_REPORTING_DATE 31-DEC-99 GTVSDAX_TRANSLATION_CODE GTVSDAX_INTERNAL_CODE_SEQNO GTVSDAX_INTERNAL_CODE_GROUP EMPLOYEE PROFILE DEDUCTION/BENEFIT GTVSDAX_DESC Special Reporting Date Special Reporting Date GTVSDAX_SYSREQ_IND Y Y GTVSDAX_ACTIVITY_DATE 17-JAN-96 17-JAN-96
The reporting date field is either null for "as of today" processing or has the "as of processing date" entered. The internal code and internal code group are not changed by the user.
© SunGard 2004-2005
Object:Access Technical Training Page 56
Section D: Managing the Components of Object:Access Lesson:
Security
Security • Banner application-level security is employed where appropriate. • The purpose and audience of views should be evaluated for usage of security processes. • Incorporation of security within views assures consistency of data across users. • Views allow the dynamic implementation of security, whereas tables do not. Finance application security Fund and Organization: F_FUND_ORG_SECURITY_FNC (function) F_CHK_FOBSYSC (function) • Security functions stored in DBPROCS directory • Functions designed to return value of "Y" or "N" • Security not employed in some views until 3.1.01 o AF_ACCTG_DISTRIBUTION_ANALYSIS o A_BUDGET_AVAILABILITY o AF_RECONCILIATION o AF_TRANSACTION_DETAIL Human Resource application security • Employee Class: F_ECLS_SECURITY (function) • Organization: F_ORGN_SECURITY (function) o Security functions stored in DBPROCS directory o Functions designed to return value of "Y" or "N" Value Based application security (3.1) (Student) • Program • Campus • Level • College • Department • PIDM (some tables where program information not available) o Developed in cooperation with clients o Only areas based on specific student related information use security o Uses views of tables, triggers, and synonyms o Uses General tables to define and maintain VBS o Views using VBS must be designed for table retrieval, not VBS based views due to ROWID constraint
© SunGard 2004-2005
Object:Access Technical Training Page 57
Section D: Managing the Components of Object:Access Lesson:
Security (Continued)
Security - Oracle User given access to only views: • No need for underlying table or function access • Only "SELECT" access granted Accesses should be maintained via the Banner Security form. Creators of new views must be given specific "grants" to access views - roles will not work. Standard Role Level Security only addresses "connect" access; "select" access is needed to report. Views of views can add additional security levels.
© SunGard 2004-2005
Object:Access Technical Training Page 58
Section D: Managing the Components of Object:Access Lesson:
Review
Review • Control Object:Access data retrieval through functions that access the GTVSDAX table • GTVSDAX maintains Hierarchy, Slotted, Parameter and Date concept definitions • Banner application level security is used • Oracle based Role level security is recommended • Not all views employ security layers • Can implement your own versions of security using views - tables are more difficult
© SunGard 2004-2005
Object:Access Technical Training Page 59
Section D: Managing the Components of Object:Access Lesson:
Self Check
Directions Use the information you have learned in this workbook to complete this self-check activity. Exercise 1 Create a table (GWBSECR) to allow security processing that prevents unauthorized users from retrieving SPRIDEN information based on whether or not they're allowed to see PERSONS, COMPANIES, or BOTH.
Exercise 2 Create a security function (F_SECURITY_CHECK) that uses a PIDM as a parameter and access the GWBSECR table. The function must return a 'Y' or 'N' to indicate if the user is allowed to see the SPRIDEN data.
© SunGard 2004-2005
Object:Access Technical Training Page 60
Section D: Managing the Components of Object:Access Lesson:
Self Check (Continued)
Exercise 3 Create a view that selects data from the SPRIDEN table and incorporate into the view the function to check security.
Exercise 4 Insert values into the GWBSECR table to test the view.
© SunGard 2004-2005
Object:Access Technical Training Page 61
Section D: Managing the Components of Object:Access Lesson:
Self Check - Answer Key
Exercise 1 Create a table (GWBSECR) to allow security processing that prevents unauthorized users from retrieving SPRIDEN information based on whether or not they're allowed to see PERSONS, COMPANIES, or BOTH. CREATE TABLE GWBSECR (GWBSECR_USER_ID VARCHAR2(30) NOT NULL, GWBSECR_PERSON_IND VARCHAR2(1), GWBSECR_COMPANY_IND VARCHAR2(1));
Exercise 2 Create a security function (F_SECURITY_CHECK) that uses a PIDM as a parameter and access the GWBSECR table. The function must return a 'Y' or 'N' to indicate if the user is allowed to see the SPRIDEN data. CREATE OR REPLACE FUNCTION F_SECURITY_CHECK (PIDM SPRIDEN.SPRIDEN_PIDM%TYPE) RETURN VARCHAR2 AS RETURN_FIELD VARCHAR2(1) := 'N'; CURSOR CHECK_SECURITY IS SELECT 'Y' FROM SPRIDEN, GWBSECR WHERE GWBSECR_USER_ID = USER AND SPRIDEN_PIDM = PIDM AND SPRIDEN_CHANGE_IND IS NULL AND (((SPRIDEN_ENTITY_IND = 'P') AND (GWBSECR_PERSON_IND = SPRIDEN_ENTITY_IND)) OR ((SPRIDEN_ENTITY_IND = 'C') AND (GWBSECR_COMPANY_IND = SPRIDEN_ENTITY_IND))); BEGIN OPEN CHECK_SECURITY; FETCH CHECK_SECURITY INTO RETURN_FIELD; CLOSE CHECK_SECURITY; RETURN RETURN_FIELD; END;
© SunGard 2004-2005
Object:Access Technical Training Page 62
Section D: Managing the Components of Object:Access Lesson:
Self Check - Answer Key (Continued)
Exercise 3 Create a view that selects data from the SPRIDEN table and incorporate into the view the function to check security. CREATE AS SELECT WHERE AND
OR REPLACE VIEW GWVSECR * FROM SPRIDEN SPRIDEN_CHANGE_IND IS NULL F_SECURITY_CHECK (SPRIDEN_PIDM) = 'Y';
Exercise 4 Insert values into the GWBSECR table to test the view. INSERT INTO GWBSECR VALUES ('BANINST1','P','C'); INSERT INTO GWBSECR VALUES ('SATURN','P',null);
© SunGard 2004-2005
Object:Access Technical Training Page 63
Section E: Building an Object:Access Solution Lesson:
Overview
Introduction
Objectives At the end of this course, participants will be able to: •
Perform the five steps that build an Object:Access solution
Prerequisites Participants in this course are expected to have completed the Banner Navigation tutorial or must have equivalent experience navigating in the Banner System. Participants should be capable of performing the following tasks: • SQL*Plus – Create views; perform multiple table joins; and execute views and function • PL/SQL – Create stored functions; describe cursors, and use cursors
© SunGard 2004-2005
Object:Access Technical Training Page 64
Section E: Building an Object:Access Solution Lesson:
Overview (Continued)
Section Contents Overview ................................................................................................................................64 Object:Access – Five-Step Solution.......................................................................................66 Step 1 – Analyze.....................................................................................................................67 Step 2 - Technical Evaluation ................................................................................................68 Step 3 – Build .........................................................................................................................69 Step 4 – Test ...........................................................................................................................70 Step 5 - Problem Resolution...................................................................................................71 Review .................................................................................................................................73 Self Check ..............................................................................................................................74 Self Check - Answer Key.......................................................................................................81
© SunGard 2004-2005
Object:Access Technical Training Page 65
Section E: Building an Object:Access Solution Lesson:
Object:Access – Five-Step Solution
Five-Step Solution 1. Analyze • Define the Data Model • Identify its Components 2. Technical Evaluation 3. • • •
Build Accesses View(s) Object(s)
4. Test 5. Problem Resolution
© SunGard 2004-2005
Object:Access Technical Training Page 66
Section E: Building an Object:Access Solution Lesson:
Step 1 – Analyze
Data Modeling • Ask what is needed (not report layout) • Document Column Origination • Minimize columns (60 - 80 columns should be sufficient) • User-friendly view name o AG_ENTITY_DATA vs. GPVENTY o HOUSING_VIEW vs. CIS0012 • User-friendly column names o BIRTH_DATE vs. SPBPERS_BIRTH_DATE o IN_JAIL vs. SPBPERS_INCAR_IND
© SunGard 2004-2005
Object:Access Technical Training Page 67
Section E: Building an Object:Access Solution Lesson:
Step 2 - Technical Evaluation
Step 2 – Technical Evaluation • Identify tables to be accessed: • Driver • Supporting Cast • Identify "physical" keys • Identify "logical" keys (this may indicate another view) • Identify existing indexes: • New indexes needed • Enhancement to current • Identify unique key combinations: • How should view return data • Mandatory conditions needed • Review data model to identify functions: • Access functions • Concept functions • Dependent functions • Identify cross-product columns/values • Identify Dependent Columns/Values • Identify Dependent Tables
GTVSDAX Form • Identify Hierarchy concept requirements • Identify Parameter controls • Identify user-defined concept Translation requirements • Identify Slotted concept requirements • Identify Date Override concept requirements • Identify "new" concept controls (i.e., User)
© SunGard 2004-2005
Object:Access Technical Training Page 68
Section E: Building an Object:Access Solution Lesson:
Step 3 – Build
Step 3 – Build • Create access functions • Document details within function • Review data model for compliance (end user connection) • Use meaningful parameters • Create access functions • Document details within function • Use meaningful parameters • Create Base View • Base table joins • Base function extraction/evaluation • Column/data value manipulation • Banner standard naming conventions • Create Intermediate View (optional) • Dependent table joins • Dependent function extraction • Data expansion function extraction • Banner standard naming conventions • Create Top Layer View • Data description functions • User-friendly columns • User-friendly view name • Create "PUBLIC SYNONYM" using Banner standard naming conventions
© SunGard 2004-2005
Object:Access Technical Training Page 69
Section E: Building an Object:Access Solution Lesson:
Step 4 – Test
Step 4 – Test • Execute Base View using primary key(s) • Execute Intermediate View using primary key(s) • Execute Top Layer View using primary key(s) • Initial parse • Repeat execution • Repeat process using mandatory key(s)/conditions • Attempt verification of performance and counts using Base SQL
© SunGard 2004-2005
Object:Access Technical Training Page 70
Section E: Building an Object:Access Solution Lesson:
Step 5 - Problem Resolution
Step 5 – Problem Resolution • Data value correction: • Ensure value was properly "selected" • Function origination may involve parameters • Performance issue: • Volume of production data • Verify timings against base tables • What is the "Norm"? • Isolate problem to be function or table joins • Determine which view has problem • Determine which table/function has problem Performance • Views designed to match "1 Second" rule using all keys • Execute "SELECT" statement without columns • Remove access function data retrieval o Remove access functions individually o Remove ancillary tables • Create driver view if appropriate • New view(s) may be needed based on "key selection"
© SunGard 2004-2005
Object:Access Technical Training Page 71
Section E: Building an Object:Access Solution Lesson:
Step 5 - Problem Resolution (Continued)
Other • Only the Top Layer View is granted access to users. • Underlying views/functions are not granted out • View Doesn't Compile o Remove Force Statement o Determine if table or function GRANT is missing o Determine if lower level view is compiled • No Data Returning o Payroll Security o GTVSDAX Date Overrides o Finance Security • Function Not Working o Hasn't Happened Yet - Usually Interpretation o Run Function from SQL using dual and hard coded keys o Step up by using function driven from a table o Ask user what they expect to happen and then explain why function does it this way
© SunGard 2004-2005
Object:Access Technical Training Page 72
Section E: Building an Object:Access Solution Lesson:
Review
Review • Ask, Analyze, and Data Model • Perform Technical Evaluation • Build Objects • Test • Problem Resolution • Data • Performance
© SunGard 2004-2005
Object:Access Technical Training Page 73
Section E: Building an Object:Access Solution Lesson:
Self Check
Directions Use the information you have learned in this workbook to complete this self-check activity. Exercise 1 Using the SPRIDEN, SPBPERS, and SPRADDR tables, create a view to display basic person demographic data along with associated addresses. The approach must include: •
• • • •
A Data Model including: o ID o PIDM o Name ("L, F Mi." format) o Street 1, Street 2, Street 3 o City o State/Province o Zip/Postal Code The ability to dynamically control address selection based on a hierarchy The ability to allow USER override and use their own hierarchy The view must only have entries for persons, not companies Create a Population Selection Address view using the new view as its base
© SunGard 2004-2005
Object:Access Technical Training Page 74
Section E: Building an Object:Access Solution Lesson:
Self Check (Continued)
Exercise 1, continued
© SunGard 2004-2005
Object:Access Technical Training Page 75
Section E: Building an Object:Access Solution Lesson:
Self Check (Continued)
Exercise 1, continued
© SunGard 2004-2005
Object:Access Technical Training Page 76
Section E: Building an Object:Access Solution Lesson:
Self Check (Continued)
Exercise 1, continued
© SunGard 2004-2005
Object:Access Technical Training Page 77
Section E: Building an Object:Access Solution Lesson:
Self Check (Continued)
Exercise 2 Create a function to return the address fields in a delimited field (using a brace '{') and write an SQL script to extract each of the fields into six separate fields. • Use the Oracle system views to search for possible examples • Use the Oracle system views to search for a possible extracting function
© SunGard 2004-2005
Object:Access Technical Training Page 78
Section E: Building an Object:Access Solution Lesson:
Self Check (Continued)
Exercise 2, continued
© SunGard 2004-2005
Object:Access Technical Training Page 79
Section E: Building an Object:Access Solution Lesson:
Self Check (Continued)
Exercise 2, continued
© SunGard 2004-2005
Object:Access Technical Training Page 80
Section E: Building an Object:Access Solution Lesson:
Self Check - Answer Key
Exercise 1 Using the SPRIDEN, SPBPERS, and SPRADDR tables, create a view to display basic person demographic data along with associated addresses. The approach must include: •
• • • •
A Data Model including: o ID o PIDM o Name ("L, F Mi." format) o Street 1, Street 2, Street 3 o City o State/Province o Zip/Postal Code The ability to dynamically control address selection based on a hierarchy The ability to allow USER override and use their own hierarchy The view must only have entries for persons, not companies Create a Population Selection Address view using the new view as its base
© SunGard 2004-2005
Object:Access Technical Training Page 81
Section E: Building an Object:Access Solution Lesson:
Self Check - Answer Key (Continued)
Exercise 1, continued Data Model: View Name: AG_ADDRESSES View Purpose: This view returns people and their current addresses. Mandatory Conditions: None
Columns PIDM_KEY (Internal Identification number) ID (External Identification number) NAME (Name of the person in LFMI format) STREET_1 (Street 1 of the person) STREET_2 (Street 1 of the person) STREET_3 (Street 1 of the person) CITY (City of the person) STATE (State of the person) ZIP (Zip code of the person)
Form INTERNAL
Field SPRIDEN_PIDM
SPAIDEN
SPRIDEN_ID
FUNCTION
F_FORMAT_NAME
SPAIDEN
SPRADDR_STREET_LINE1
SPAIDEN
SPRADDR_STREET_LINE2
SPAIDEN
SPRADDR_STREET_LINE3
SPAIDEN
SPRADDR_CITY
SPAIDEN
SPRADDR_STAT_CODE
SPAIDEN
SPRADDR_ZIP
© SunGard 2004-2005
Object:Access Technical Training Page 82
Section E: Building an Object:Access Solution Lesson:
Self Check - Answer Key (Continued)
Exercise 1, continued CREATE OR REPLACE FUNCTION F_GET_SPRADDR_ROWID (PIDM SPRIDEN.SPRIDEN_PIDM%TYPE, ADDRESS_HIERARCHY GTVSDAX.GTVSDAX_INTERNAL_CODE%TYPE, ADDR_OCCURANCE NUMBER, PREF_ATYP VARCHAR2) RETURN ROWID AS A_ROW ROWID := NULL; WHICH_ADDR NUMBER := 1; CTR NUMBER := 0; ADDR_TYPE STVATYP.STVATYP_CODE%TYPE := NULL; ADDR_HIERARCHY GTVSDAX.GTVSDAX_INTERNAL_CODE%TYPE := NULL; CURSOR GET_USER_HIERARCHY IS SELECT GTVSDAX_EXTERNAL_CODE FROM GTVSDAX WHERE GTVSDAX_INTERNAL_CODE = USER AND GTVSDAX_INTERNAL_CODE_GROUP = 'ADDRESS OVERRIDE'; CURSOR GET_GTVSDAX_ADDR IS SELECT GTVSDAX_EXTERNAL_CODE FROM GTVSDAX WHERE GTVSDAX_INTERNAL_CODE = ADDR_HIERARCHY AND GTVSDAX_INTERNAL_CODE_GROUP = 'ADDRESS' ORDER BY GTVSDAX_INTERNAL_CODE_SEQNO; CURSOR GET_SPRADDR IS SELECT ROWID FROM SPRADDR WHERE SPRADDR_PIDM = PIDM AND SPRADDR_ATYP_CODE = ADDR_TYPE AND ((SPRADDR_STATUS_IND IS NULL) OR (SPRADDR_STATUS_IND = 'A')) AND TRUNC(SYSDATE) BETWEEN TRUNC(NVL(SPRADDR_FROM_DATE,SYSDATE)) AND TRUNC(NVL(SPRADDR_TO_DATE,SYSDATE)) ORDER BY SPRADDR_SEQNO;
© SunGard 2004-2005
Object:Access Technical Training Page 83
Section E: Building an Object:Access Solution Lesson:
Self Check - Answer Key (Continued)
Exercise 1, continued BEGIN IF PREF_ATYP IS NULL THEN OPEN GET_USER_HIERARCHY; FETCH GET_USER_HIERARCHY INTO ADDR_HIERARCHY; IF GET_USER_HIERARCHY%NOTFOUND THEN ADDR_HIERARCHY := ADDRESS_HIERARCHY; END IF; CLOSE GET_USER_HIERARCHY; IF ADDR_OCCURANCE IS NOT NULL THEN WHICH_ADDR := ADDR_OCCURANCE; END IF; OPEN GET_GTVSDAX_ADDR; LOOP A_ROW := NULL; FETCH GET_GTVSDAX_ADDR INTO ADDR_TYPE; EXIT WHEN GET_GTVSDAX_ADDR%NOTFOUND; OPEN GET_SPRADDR; FETCH GET_SPRADDR INTO A_ROW; IF GET_SPRADDR%FOUND THEN CTR := CTR + 1; IF CTR >= WHICH_ADDR THEN EXIT; END IF; END IF; CLOSE GET_SPRADDR; END LOOP; ELSE ADDR_TYPE := PREF_ATYP; OPEN GET_SPRADDR; FETCH GET_SPRADDR INTO A_ROW; CLOSE GET_SPRADDR; END IF; IF GET_SPRADDR%ISOPEN THEN CLOSE GET_SPRADDR; END IF; IF GET_GTVSDAX%ISOPEN THE CLOSE GET_GTVSDAX_ADDR; END IF; RETURN A_ROW; END;
© SunGard 2004-2005
Object:Access Technical Training Page 84
Section E: Building an Object:Access Solution Lesson:
Self Check - Answer Key (Continued)
Exercise 1, continued – GTSVDAX Entries INSERT INTO GTVSDAX VALUES ('USERADDR', 'BANINST1',null,null,1,'ADDRESS OVERRIDE','Override Hierarchy','Y',sysdate) / INSERT INTO GTVSDAX VALUES ('BU', 'USERADDR',null,null,1,'ADDRESS','User Address Code 1','Y',sysdate) / INSERT INTO GTVSDAX VALUES ('PR', 'USERADDR',null,null,2,'ADDRESS','User Address Code 2','Y',sysdate) /
Exercise 1, continued – AG_ADDRESS View CREATE OR REPLACE VIEW AG_ADDRESSES AS SELECT SPRIDEN_PIDM PIDM_KEY, SPRIDEN_ID ID SUBSTR(F_FORMAT_NAME(SPRIDEN_PIDM, 'LFMI'),1,90) NAME, SPRADDR_STREET_LINE1 STREET_1, SPRADDR_STREET_LINE2 STREET_2, SPRADDR_STREET_LINE3 STREET_3, SPRADDR_CITY CITY, SPRADDR_STAT_CODE STATE, SPRADDR_ZIP ZIP FROM SPRADDR, SPRIDEN WHERE SPRIDEN_CHANGE_IND IS NULL AND SPRADDR.ROWID = F_GET_SPRADDR_ROWID (SPRIDEN_PIDM,'ENTYADDR',1,NULL) AND SPRIDEN_ENTITY_IND = 'P' /
© SunGard 2004-2005
Object:Access Technical Training Page 85
Section E: Building an Object:Access Solution Lesson:
Self Check - Answer Key (Continued)
Exercise 1, continued - Population Selection View CREATE OR REPLACE VIEW SGVADDR AS SELECT PIDM_KEY SGVADDR_PIDM, ID SGVADDR_ID, NAME SGVADDR_NAME, STREET_1 SGVADDR_STREET_LINE1, STREET_2 SGVADDR_STREET_LINE2, STREET_3 SGVADDR_STREET_LINE3, CITY SGVADDR_CITY, STATE SGVADDR_STATE, ZIP SGVADDR_ZIP FROM AG_ADDRESSES /
© SunGard 2004-2005
Object:Access Technical Training Page 86
Section E: Building an Object:Access Solution Lesson:
Self Check - Answer Key (Continued)
Exercise 2 - Address Delimit Function Create a function to return the address fields in a delimited field (using a brace '{') and write an SQL script to extract each of the fields into six separate fields. • Use the Oracle system views to search for possible examples • Use the Oracle system views to search for a possible extracting function CREATE OR REPLACE FUNCTION F_GET_SPRADDR_DATA (PIDM SPRIDEN.SPRIDEN_PIDM%TYPE, ADDRESS_HIERARCHY GTVSDAX.GTVSDAX_INTERNAL_CODE%TYPE, ADDR_OCCURANCE NUMBER, PREF_ATYP VARCHAR2) RETURN VARCHAR2 AS RETURN_FIELD VARCHAR2(2000) := NULL; A_ROW ROWID := NULL; DELIM VARCHAR2(1) := '{'; WHICH_ADDR NUMBER := 1; CTR NUMBER := 0; ADDR_TYPE STVATYP.STVATYP_CODE%TYPE := NULL; ADDR_HIERARCHY GTVSDAX.GTVSDAX_INTERNAL_CODE%TYPE := NULL; STREET1 SPRADDR.SPRADDR_STREET_LINE1%TYPE := NULL; STREET2 SPRADDR.SPRADDR_STREET_LINE2%TYPE := NULL; STREET3 SPRADDR.SPRADDR_STREET_LINE3%TYPE := NULL; CITY SPRADDR.SPRADDR_CITY%TYPE := NULL; STATE SPRADDR.SPRADDR_STAT_CODE%TYPE := NULL; ZIP SPRADDR.SPRADDR_ZIP%TYPE := NULL; CURSOR GET_USER_HIERARCHY IS SELECT GTVSDAX_EXTERNAL_CODE FROM GTVSDAX WHERE GTVSDAX_INTERNAL_CODE = USER AND GTVSDAX_INTERNAL_CODE_GROUP = 'ADDRESS OVERRIDE'; CURSOR GET_GTVSDAX_ADDR IS SELECT GTVSDAX_EXTERNAL_CODE FROM GTVSDAX WHERE GTVSDAX_INTERNAL_CODE = ADDR_HIERARCHY AND GTVSDAX_INTERNAL_CODE_GROUP = 'ADDRESS' ORDER BY GTVSDAX_INTERNAL_CODE_SEQNO; CURSOR GET_SPRADDR IS SELECT ROWID, SPRADDR_STREET_LINE1, SPRADDR_STREET_LINE2, SPRADDR_STREET_LINE3, SPRADDR_CITY, SPRADDR_STAT_CODE, SPRADDR_ZIP FROM SPRADDR WHERE SPRADDR_PIDM = PIDM AND SPRADDR_ATYP_CODE = ADDR_TYPE AND ((SPRADDR_STATUS_IND IS NULL) OR (SPRADDR_STATUS_IND = 'A')) AND TRUNC(SYSDATE) BETWEEN TRUNC(NVL(SPRADDR_FROM_DATE,SYSDATE)) AND TRUNC(NVL(SPRADDR_TO_DATE,SYSDATE)) ORDER BY SPRADDR_SEQNO;
© SunGard 2004-2005
Object:Access Technical Training Page 87
Section E: Building an Object:Access Solution Lesson:
Self Check - Answer Key (Continued)
Exercise 2 - Address Delimit Function, continued BEGIN IF PREF_ATYP IS NULL THEN OPEN GET_USER_HIERARCHY; FETCH GET_USER_HIERARCHY INTO ADDR_HIERARCHY; IF GET_USER_HIERARCHY%NOTFOUND THEN ADDR_HIERARCHY := ADDRESS_HIERARCHY; END IF; CLOSE GET_USER_HIERARCHY; IF ADDR_OCCURANCE IS NOT NULL THEN WHICH_ADDR := ADDR_OCCURANCE; END IF; OPEN GET_GTVSDAX_ADDR; LOOP A_ROW := NULL; FETCH GET_GTVSDAX_ADDR INTO ADDR_TYPE; EXIT WHEN GET_GTVSDAX_ADDR%NOTFOUND; OPEN GET_SPRADDR; FETCH GET_SPRADDR INTO A_ROW, STREET1, STREET2, STREET3, CITY, STATE, ZIP;
© SunGard 2004-2005
Object:Access Technical Training Page 88
Section E: Building an Object:Access Solution Lesson:
Self Check - Answer Key (Continued)
Exercise 2, continued IF GET_SPRADDR%FOUND THEN CTR := CTR + 1; IF CTR >= WHICH_ADDR THEN EXIT; END IF; END IF; CLOSE GET_SPRADDR; END LOOP; ELSE ADDR_TYPE := PREF_ATYP; OPEN GET_SPRADDR; FETCH GET_SPRADDR INTO A_ROW, STREET1, STREET2, STREET3, CITY, STATE, ZIP; CLOSE GET_SPRADDR; END IF; IF GET_SPRADDR%ISOPEN THEN CLOSE GET_SPRADDR; END IF; IF GET_GTVSDAX%ISOPEN THEN CLOSE GET_GTVSDAX_ADDR; END IF; IF A_ROW IS NOT NULL THEN RETURN_FIELD := STREET1 || DELIM || STREET2 || DELIM || STREET3 || DELIM || CITY || DELIM || STATE || DELIM || ZIP; END IF; RETURN RETURN_FIELD; END;
© SunGard 2004-2005
Object:Access Technical Training Page 89
Section E: Building an Object:Access Solution Lesson:
Self Check - Answer Key (Continued)
Exercise 2 - Extract scripts CREATE OR REPLACE VIEW GWVADEX AS SELECT SPRIDEN_PIDM GWVADEX_PIDM, F_GET_SPRADDR_DATA (SPRIDEN_PIDM,'ENTYADDR',1,null) GWVADEX_ADDR_DATA FROM SPRIDEN WHERE SPRIDEN_CHANGE_IND IS NULL; CREATE OR REPLACE VIEW AG_ADDRESS_EXTRACT AS SELECT GWVADEX_PIDM PIDM_KEY, SUBSTR(F_SPLIT_FIELDS(GWVADEX_ADDR_DATA,1),1,30) STREET1, SUBSTR(F_SPLIT_FIELDS(GWVADEX_ADDR_DATA,2),1,30) STREET2, SUBSTR(F_SPLIT_FIELDS(GWVADEX_ADDR_DATA,3),1,30) STREET3, SUBSTR(F_SPLIT_FIELDS(GWVADEX_ADDR_DATA,4),1,20) CITY, SUBSTR(F_SPLIT_FIELDS(GWVADEX_ADDR_DATA,5),1,3) STATE, SUBSTR(F_SPLIT_FIELDS(GWVADEX_ADDR_DATA,6),1,10) ZIP FROM GWVADEX;
© SunGard 2004-2005
Object:Access Technical Training Page 90
Section F: Wrap-up and Tidbits Lesson:
Overview
Introduction
Prerequisites Participants in this course are expected to have completed the Banner Navigation tutorial or must have equivalent experience navigating in the Banner System. Participants should be capable of performing the following tasks: • SQL*Plus – Create views; perform multiple table joins; and execute views and function • PL/SQL – Create stored functions; describe cursors, and use cursors Section contents Overview ................................................................................................................................91 Object:Access – Tidbits..........................................................................................................92 Object:Access - Example Functions with General.................................................................93
© SunGard 2004-2005
Object:Access Technical Training Page 91
Section F: Wrap-up and Tidbits Lesson:
Object:Access – Tidbits
General • Many Functions delivered with General • All Functions stored in DBPROCS directory • All Views stored in VIEWS directory • Clients are "encouraged" to enhance • Can and should be utilized to create warehouse tables • Base Views should "NEVER" be joined to one another Documentation • CD number 2 for the 3.0 release • Reporting Data Model for each product • General System using GTVSDAX Contact • ActionLine •
[email protected] • Account Consultant, Project Manager, or Region Manager Relationship of Oracle Views • DBA_ • ALL_ • USER Oracle Information Available • OBJECTS • ERRORS • SOURCE • COMMENTS ALL_VIEWS view (set long to 10,000)
© SunGard 2004-2005
Object:Access Technical Training Page 92
Section F: Wrap-up and Tidbits Lesson:
Object:Access - Example Functions with General
Common Functions SUFADRS.SQL: F_GET_ADDRESS_ROWID SUFADTE.SQL: F_GET_ADDRESS_TELEPHONE_ROWID SUFAGES.SQL: F_CALCULATE_AGE SUFCDES.SQL: F_COMMON_GET_DESC SUFETCT.SQL: F_GET_ETHN_CATEGORY SUFGEOR.SQL: F_GEOGRAPHIC_REGION SUFHOLD.SQL: F_GET_SPRHOLD_ROWID SUFINTL.SQL: F_GET_SPRINTL_ROWID SUFNAME.SQL: F_FORMAT_NAME SUFPDSY.SQL: F_GET_TENURE_DESC SUFSPLT.SQL: F_SPLIT_FIELDS SUFTELE.SQL: F_GET_SPRTELE_ROWID
© SunGard 2004-2005
Object:Access Technical Training Page 93
Release Date
This workbook was last updated on 09/22/2005.