understanding prophet 21 databases -...

64
Presented By: Copyright © Epicor Software Corporation 2013 Jennifer Bankos Understanding Prophet 21 Databases

Upload: duonghanh

Post on 04-Jun-2018

253 views

Category:

Documents


0 download

TRANSCRIPT

Presented By:

Copyright © Epicor Software Corporation 2013

Jennifer Bankos

Understanding Prophet 21 Databases

Copyright © Epicor Software Corporation 2013

Objectives

• Explain the difference between databases, tables and

columns

• Extract data from different areas of the system

• Discuss basic SQL statements using SQL Server

Management Studio

• Use Prophet 21 to gather SQL Information

• Utilize Data Dictionary

Copyright © Epicor Software Corporation 2013

Definitions

Columns (fields)

Contains a single piece of information

Copyright © Epicor Software Corporation 2013

Definitions

Columns (fields)

Contains a single piece of information

Record (rows) One complete set of columns

Copyright © Epicor Software Corporation 2013

Definitions

Columns (fields)

Contains a single piece of information

Record (rows) One complete set of columns

Table A collection of rows

Copyright © Epicor Software Corporation 2013

Definitions

Columns (fields)

Contains a single piece of information

Record (rows) One complete set of columns

Table A collection of rows

View Virtual table created for easier data extraction

Copyright © Epicor Software Corporation 2013

Definitions

Columns (fields)

Contains a single piece of information

Record (rows) One complete set of columns

Table A collection of rows

View Virtual table created for easier data extraction

Database Collection of information organized for easy selection of data

Copyright © Epicor Software Corporation 2013

Definitions

Columns (fields)

Contains a single piece of information

Record (rows) One complete set of columns

Table A collection of rows

View Virtual table created for easier data extraction

Database Collection of information organized for easy selection of data

SQL Server Management Studio

A graphical user interface used to extract data and perform administrative functions such as backing up and restoring databases and maintaining SQL Logins

Copyright © Epicor Software Corporation 2013

SQL Server Management Studio

• Accessed through

Microsoft SQL

Server 2005 or

2008, 2008 R2

Copyright © Epicor Software Corporation 2013

SQL Server Tool

• Profiler

• Run traces of activity in

your system

• Allow you to review

which tables are being

affected by certain

processes in P21

Copyright © Epicor Software Corporation 2013

Application Share

• SQL Server Management Studio

• Take “a tour” of the application

• Review ‘sp_help’, and ‘object browser’

• Discuss syntax rules

Copyright © Epicor Software Corporation 2013

Basic SQL Commands

• sp_help

• sp_help <table_name>

• select * from <table_name>

• Select <field_name>, <field_name> from <table_name>

• Ex: Select * from customer

Where customer_id > 10000

Order by credit_limit DESC

Copyright © Epicor Software Corporation 2013

Most Common Reporting Areas

• Address and Contact tables

• Order Processing

• Inventory

• Purchasing

• Accounts Receivable

• Accounts Payable

• Production Orders

Copyright © Epicor Software Corporation 2013

Address and Contact tables

• Used in conjunction with other tables

• These tables hold every address/contact in the system

• Customers

• Vendors

• Suppliers

• Ship to locations

• Company locations

Copyright © Epicor Software Corporation 2013

Tables and Views

• Tables

• Stores all data

• One set of information

Copyright © Epicor Software Corporation 2013

Tables and Views

• Tables

• Stores all data

• One set of information

• P21 Views

• Basic and Master Views

• Single or multiple tables linked together

Copyright © Epicor Software Corporation 2013

Understanding Basic and Master Views

• Basic Views

• Start with nine characters:

P21_VIEW_

• Ex: P21_VIEW_oe_hdr

• Every table has a basic view

• Master Views

• End with _VIEW

• Ex: P21_order_VIEW

Copyright © Epicor Software Corporation 2013

p21_view_oe_hdr

• Contains most of the information seen in the order

header

Copyright © Epicor Software Corporation 2013

p21_view_oe_line

• Holds most of the line item information in the lower

portion of an Order Processing window

Copyright © Epicor Software Corporation 2013

p21_view_oe_hdr_salesrep

• Contains sales rep information per order

Copyright © Epicor Software Corporation 2013

p21_view_oe_line_schedule

• Contains release information for an item

Copyright © Epicor Software Corporation 2013

Order Processing

• Basic Views

• P21_View_oe_hdr

• P21_View_oe_line

• P21_View_oe_hdr_salesrep

• P21_View_oe_line_schedule

• Master Views

• P21_ORDER_VIEW

Copyright © Epicor Software Corporation 2013

p21_view_inv_mast

• Contains most of the information found in the Item

Maintenance window

Copyright © Epicor Software Corporation 2013

p21_view_inv_loc

• Contains most of the location-specific information on the

location tab of an item

Copyright © Epicor Software Corporation 2013

p21_view_inventory_supplier

• Contains most of what is found on the supplier list and

supplier detail tabs in Item Maintenance

Copyright © Epicor Software Corporation 2013

Inventory

• Basic View

• p21_view_inv_mast

• p21_view_inv_loc

• p21_view_inventory_supplier

• Master Views

• P21_ITEM_VIEW

• P21_ITEM_LOCATION_VIEW

• P21_INVENTORY_USAGE_VIEW

Copyright © Epicor Software Corporation 2013

p21_view_po_hdr

• Contains most of the information found in the PO header

section of Purchase Orders

Copyright © Epicor Software Corporation 2013

p21_view_po_line

• Contains most of the information found in the line section

of a PO

Copyright © Epicor Software Corporation 2013

Purchasing

• Basic Views

• p21_view_po_hdr

• p21_view_po_line

• P21 Views

• P21_PO_VIEW

Copyright © Epicor Software Corporation 2013

p21_view_assembly_hdr

• Contains the information on the top half of the assembly

maintenance screen

Copyright © Epicor Software Corporation 2013

p21_view_assembly_line

• Contains the information on the bottom half of the

assembly maintenance window

Copyright © Epicor Software Corporation 2013

p21_view_prod_order_hdr

• Contains information on the top half of the production

order entry window

Copyright © Epicor Software Corporation 2013

p21_view_prod_order_line

• Contains information from the bottom half of the

production order entry window

Copyright © Epicor Software Corporation 2013

p21_view_prod_order_line_component

• Contains the component information for each assembly

detail record

Copyright © Epicor Software Corporation 2013

p21_view_prod_order_line_link

• Contains information from the Production order tab in

order entry

Copyright © Epicor Software Corporation 2013

Production Order

• Basic Views

• p21_view_assembly_hdr

• p21_view_assembly_line

• p21_view_prod_order_hdr

• p21_view_prod_order_line

• p21_view_prod_order_line_component

• p21_view_prod_order_line_link

• Master View

• p21_assembly_view

Copyright © Epicor Software Corporation 2013

p21_view_invoice_hdr

• Contains most of the information found in the header

section of the A/R Drill Down by Invoice Number

Copyright © Epicor Software Corporation 2013

p21_view_invoice_line

• Contains most of the information found in the line section

of the A/R Drill Down by Invoice window

Copyright © Epicor Software Corporation 2013

p21_view_ar_receipts

• Contains payment information

• Commonly used fields

• - receipt_number - customer_id

• - invoice_no - payment_date

• - payment_amount - terms_amount

Copyright © Epicor Software Corporation 2013

Accounts Receivable

• Basic Views

• p21_view_invoice_hdr

• p21_view_invoice_line

• p21_view_ar_receipts

• p21_view_ar_receipts_detail

• Master Views

• P21_AR_VIEW

• P21_SALES_HISTORY_VIEW

• P21_SALES_HISTORY_REPORT_VIEW

• P21_AR_RECEIPTS_VIEW

Copyright © Epicor Software Corporation 2013

p21_view_apinv_hdr

• Contains most of the information found in the header

section of an AP voucher

Copyright © Epicor Software Corporation 2013

p21_view_apinv_line

• Contains most of the information found in the line section

of an AP voucher

Copyright © Epicor Software Corporation 2013

Accounts Payable

• Basic Views

• p21_view_apinv_hdr

• p21_view_apinv_line

• Master View

• P21_AP_VIEW

Copyright © Epicor Software Corporation 2013

Linking

• Necessary when working with more than one table/view

• Relationships are important

• Tables linked together by an ID/key field

• Provides more descriptive information

• The idea that it is better to have more links between

tables/views is completely false

Copyright © Epicor Software Corporation 2013

Linking

• In this example

• oe_hdr does NOT hold line item detail

• oe_line does NOT hold the Item_ID

Copyright © Epicor Software Corporation 2013

Linking

• oe_hdr links to oe_line by order_no

Copyright © Epicor Software Corporation 2013

Linking

• oe_line links to inv_mast by inv_mast_uid

Copyright © Epicor Software Corporation 2013

Joins

• How tables/views are linked is referred to as a JOIN

• Default = Inner Join

Copyright © Epicor Software Corporation 2013

Joins

Table/View 1

Copyright © Epicor Software Corporation 2013

Joins

Inner

Join

Overlap Left Right

Table/View 1 Table/View 2

Copyright © Epicor Software Corporation 2013

Left Outer Join

Left Right

Table/View 1 Table/View 2

Left Outer Join

• All data from this table

• Matches from joined table

Copyright © Epicor Software Corporation 2013

Left Outer Join Example

Sales History

p21_view_customer p21_sales_history_view

Customer Record

Copyright © Epicor Software Corporation 2013

Tips and Tricks

• Fields common among tables

• Complete flag

• Delete flag

• Cancel flag

• RMA flag in order tables

• Quote flag in order tables

Copyright © Epicor Software Corporation 2013

Tips and Tricks

• Fields common among tables

• Complete flag

• Delete flag

• Cancel flag

• RMA flag in order tables

• Quote flag in order tables

• Enumerated Values

• Link to code_p21 table to get descriptions for numeric

values

Copyright © Epicor Software Corporation 2013

Enumerated Values

Copyright © Epicor Software Corporation 2013

Enumerated Values

• Join to the code_p21 table to pull the description for the

code

Copyright © Epicor Software Corporation 2013

SQL Information in P21

• RMB on field

• Choose Help

• SQL Information

Copyright © Epicor Software Corporation 2013

SQL Information in P21

Copyright © Epicor Software Corporation 2013

Data Dictionary

Copyright © Epicor Software Corporation 2013

Data Dictionary Searches

• Table

• View columns and column definitions

• Column

• View tables that contain a particular column

• Look into information ‘behind the views’

Copyright © Epicor Software Corporation 2013

Summary

• Explain the difference between databases, tables and

columns

• Extract data from different areas of the system

• Run basic SQL statements using SQL Server

Management Studio

• Use Prophet 21 to gather SQL Information

• Utilize Data Dictionary

Copyright © Epicor Software Corporation 2013

Published Solutions

• Published Solution 27070 – How to create a SQL

authenticated login for SQL 2005 and P21

• Published Solution 26761 – How to run a query for

support using SQL Server Management Studio

• Published Solution 26762 – How to run a trace using

SQL Server 2005 or 2008 Profiler

Copyright © Epicor Software Corporation 2013

For More Information…

• Prophet 21 Help Files

• Visit us on the web: www.epicor.com

• View Educational Services course offerings

– View SQL Information in Prophet 21

– Prophet 21 Data Dictionary

• Browse Documentation

• Search the Solutions database

• Submit a web case

• Contact your CAM (Customer Account Manager) to

arrange consulting specific to your needs

[email protected]

Copyright © Epicor Software Corporation 2013

Additional Classes and LMS Courses

• Getting Started with Crystal Reports

• More Crystal Reports

• Optimizing Crystal Reports

• ICE Extend – Business Activity Queries Hands-on Virtual

Training

• On the LMS, Browse the Course Catalog, expand

System Administration / SQL folders to find additional

courses