Beruflich Dokumente
Kultur Dokumente
Colin Abbott
ISR Technical Services
Goals
After this class the attendees should be able
to create a basic SQR program and have the
report distributed on Minerva
SQR
Naming Standards
Types of SQR programs
Reserve a program name
Start with SQL
Use a Template, Program Sections
BEGIN-SELECT
Dynamic SQL
Procedures
Procedures with Parameters
PL/SQL Procedures
SQR
Sample Reports
FZRG0001A
First Character F = Finance, S=Student
Second Character Z for custom
Third Character R for Report
Fourth Character G=GL, P=Purchasing,
B=budget ...
4 digits for a report number
Optionally a multiple report can end in a
letter A-Z
Use a Template
Start a SQR program with fzrgskel.sqr
Template for a basic report and .slk file
Take a look at the template
Begin-Select
BEGIN-SELECT END-SELECT
Column alias
Working storage variables
Processes SQR commands for each row
returned
Use Inline Views
on-error, loops and distinct
Use SQL to constrain rows returned,
discarding rows will effect break processing
Dynamic SQL
You can build a where clause based on
input parameters or program logic
let $where_clause =
in Begin-Select you can use
[$where_clause] Must be enclosed in
square brackets
(see FZRG0024 for example) determines by
input parameter if we are selecting
academic or non-academic budget sheets.
Using Variables
Variable prefixes
Variable scope
Define variables
Bugs due to variable spelling typos
Brio Procedures
Call a procedure with the DO command
do p_print_info
do p_get_vendor_by_pidm($pidm)
Using Libraries
Example #1
Simple Report
Break
On-Break Processing
Writing to a file
Create a File
Write to a file
Close File
close 1
Using Arrays
Define Array
Put Data into Array
Get Data from Array
(FZRG0051 Good example of Arrays)
do p_appworx_info ('{appworx_file_name}',
$appworx_module_name ,$appworx_chain_id, $appworx_seq_id)
do p_generate_file_name ($hold_appworx_module_name,
$appworx_chain_id, $appworx_seq_id, '', '.slk',
$report_file_name)
Database Links
Do not hard code Database links (It will fail
when Appworx runs it)
Accept Database links as ASK parameters
BEGIN-PROGRAM
let $path = getenv('IMAGE_LIB')
let $gif_file = $path || '/mcgill.gif'
display $gif_file
END-PROGRAM
File Retention
Appworx will expire and delete a file after
its retention period has passed
Specify retention period in module
documentation
Monthly reports 37 months
Weekly reports 3 months
Daily reports, depends on report
No Archiving plan in effect yet, once
Appworx deletes a file it can not be
retrieved
Program Options
Appworx has many program options
a Program option is basically just a shell
script that controls how Appworx will run
the program
for SQR the only program option is
SQRP_MC2 this needs to be specified on
program documentation
Conditions
Can be based on successful/unsuccessful
completion of another job/chain
Can be based on database logic
DWH is UP
Chains
Appworx Variables
Variables are documented in the file
Finance Variables for Appworx.doc
Dynamic variables based on Database logic
in FZKBO003 (DWH1 tables)
Getting to Production
Minerva Architecture
Minerva Demo (Phase I)
Minerva Demo (Phase II)
Security Classes
Security Methods
Bursted Reports
Minerva Architecture
Minerva Phase I
Minerva Phase II
Drill down capability
Burstable reports with security
Support for all file types
Security Classes
MCGILL_FIS_RPT_PUBLIC_C
MCGILL_FIS_RPT_EXECUTIVE_C
MCGILL_FIS_RPT_CENTRALSTAFF_C
MCGILL_FIS_RPT_ACCOUNTANT_C
MCGILL_FIS_RPT_FINSTMT_C
MCGILL_FIS_RPT_PURCHASING_C
MCGILL_FIS_RPT_ISR_C
Security Methods
Security Methods (Defined in GZBSECM)
Each report is assigned to a security method
Security method is really a PL/SQL
procedure, generates an addition to the
where clause that returns list of reports.
Fund, Fund/Orgn, ID, Fund/Orgn
NHIDIST, Fund/Orgn Budget Admin
Simple Reports
Have Richard ask Steve/Danny to enrol the
object in a FIS_RPT class
Once in a class create an extender record in
GZBOBJS
Report can be set active or inactive in the
extender table.
Setting a report as inactive in MCGP but
active in FIS1 is a good way to test
distribution and security methods.
More Information
Brio Listserv - http://www.sqrug.org/
http://www.is.mcgill.ca/brio/developerguide
.pdf
/opt/brio/ora/sample and
/opt/brio/ora/tutorial on VENUS