25
Summit 2007: Get Connected W515 - Getting Data Out of Disc with ODBC BBJ Brian Fluckiger Technical Support Not quite getting the results you want from your ODBC queries? Then attend this session. Using the Business Basic Java tools to get and use data from your Disc solution is the focus of this class. Learn how you can use simple SQL commands, a powerful query language, to make your queries much more beneficial. Pre-requisites: None Wednesday, 2:30 p.m. © 2007 Activant Solutions Inc. All Rights Reserved 2 Session Objectives Review ODBC and configuration process Review some troubleshooting errors Explain the role of the data dictionary Review the Disc data structure Where to find what you need Discuss SQL and query language Demonstrate some practical applications

W515 - Getting Data Out of Disc with ODBC BBJ · 2007. 2. 14. · Summit 2007: Get Connected W515 - Getting Data Out of Disc with ODBC BBJ Brian Fluckiger Technical Support Not quite

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: W515 - Getting Data Out of Disc with ODBC BBJ · 2007. 2. 14. · Summit 2007: Get Connected W515 - Getting Data Out of Disc with ODBC BBJ Brian Fluckiger Technical Support Not quite

Summit 2007: Get Connected

W515 - Getting Data Out of Disc with ODBC BBJ

Brian FluckigerTechnical Support

Not quite getting the results you want from your ODBC queries? Then attend this session. Using the Business Basic Java tools to get and use data from your Disc solution is the focus of this class. Learn how you can use simple SQL commands, a powerful query language, to make your queries much more beneficial.

Pre-requisites: None

Wednesday, 2:30 p.m.

© 2007 Activant Solutions Inc. All Rights Reserved

2

Session Objectives

Review ODBC and configuration processReview some troubleshooting errorsExplain the role of the data dictionaryReview the Disc data structure

Where to find what you need

Discuss SQL and query languageDemonstrate some practical applications

Page 2: W515 - Getting Data Out of Disc with ODBC BBJ · 2007. 2. 14. · Summit 2007: Get Connected W515 - Getting Data Out of Disc with ODBC BBJ Brian Fluckiger Technical Support Not quite

Summit 2007: Get Connected

© 2007 Activant Solutions Inc. All Rights Reserved

3

What is ODBC?

Open DataBase ConnectivityGives PC apps access to databases

Word, Excel, Access, Crystal Reports and more!

Uses universal language to communicate

No more moving files to your PCMust be on a networkDirect access to real-time information

© 2007 Activant Solutions Inc. All Rights Reserved

4

ODBC Configuration and Set-up

Server set-upDataserverData DictionaryHU.INTEGRATE

Data links

Task 912

PC configurationODBC driversBBj clientData sources

Page 3: W515 - Getting Data Out of Disc with ODBC BBJ · 2007. 2. 14. · Summit 2007: Get Connected W515 - Getting Data Out of Disc with ODBC BBJ Brian Fluckiger Technical Support Not quite

Summit 2007: Get Connected

© 2007 Activant Solutions Inc. All Rights Reserved

5

Task 515 and Task 614 Data

You can export Tasks 515 and 614 data to BBjChose to OUTPUT TO A 'F'ILEOnly one of each task can be linked at a time

Task 912Link your files to ODBC

Start a query in your choice of softwareOUT_IQITH - Task 614 InformationOUT_515 - Task 515 Information

© 2007 Activant Solutions Inc. All Rights Reserved

6

Exporting Additional Tasks to BBj

More Tasks that can be written to filesTask 306 – Customer Labels = OUT_306Task 314 – Performance Reporting = OUT_314Task 323 – Mailing Lists = OUT_323Task 623 – Vendor Rebates = OUT_623Task 709 – Balance Sheet = OUT_709Task 804 – Inventory File = OUT_804Disc*Man Job Searcher = OUT_M2JOBS

These are also linked in Task 912

Page 4: W515 - Getting Data Out of Disc with ODBC BBJ · 2007. 2. 14. · Summit 2007: Get Connected W515 - Getting Data Out of Disc with ODBC BBJ Brian Fluckiger Technical Support Not quite

Summit 2007: Get Connected

© 2007 Activant Solutions Inc. All Rights Reserved

7

Troubleshooting Errors

[BASIS] (BBJ ODBC Driver) ! ERROR=0, 65532 Just like an ERR=0 in Disc, the data file is locked

[BASIS][BBj ODBC Driver] Unable to open socket connection. BBj services may not be running on the host machine or the connection was rejected.Unable to open the specified database. Unable to open the Data Dictionary file.Connection refused. /<hostname,port=1100>/usr2/PP/ODBC/DICT/FILE.1

BBj Data services needs to be manually restarted/usr/pro5ds/pro5srv -p1100 -c/u/bbx/config.bbx -r -l/usr/pro5ds/ds.log

© 2007 Activant Solutions Inc. All Rights Reserved

8

Troubleshooting Errors

Invalid username and password unable to started BBj services on PC?

Need to set administrator’s password in the DSN on the PC

No license connection made License manager not startedLicenses are all in useReboot your PCReboot server or Contact Activant Disc to restart BBj services

Page 5: W515 - Getting Data Out of Disc with ODBC BBJ · 2007. 2. 14. · Summit 2007: Get Connected W515 - Getting Data Out of Disc with ODBC BBJ Brian Fluckiger Technical Support Not quite

Summit 2007: Get Connected

© 2007 Activant Solutions Inc. All Rights Reserved

9

Role of the Data Dictionary

Makes Disc data look like a relational databaseInterprets data into RDBMS-like tables

All files and fields are defined hereWorks with query languages to access data

© 2007 Activant Solutions Inc. All Rights Reserved

10

Disc Data Structure Explained

Some examples of file prefixesCU – CustomerIN – InventoryCO – CorporateAT – Action TrackOUT – Output files (Task 323, 515 etc.)

Records and fieldsFile types: single and multi-record

Index or sort files are not included

Data File Definitions

Page 6: W515 - Getting Data Out of Disc with ODBC BBJ · 2007. 2. 14. · Summit 2007: Get Connected W515 - Getting Data Out of Disc with ODBC BBJ Brian Fluckiger Technical Support Not quite

Summit 2007: Get Connected

© 2007 Activant Solutions Inc. All Rights Reserved

11

Task 909 - Single Record Type File

© 2007 Activant Solutions Inc. All Rights Reserved

12

ODBC - Single Record Type File

603+421-7789PVS03496Portsmouth, NH101 West Main StGoff’s Hydraulic608100

502+312-121199901119New Orleans, LA3 South StFountain Distributor604500

860+521-4812ABC06114Hartford, CT1177 Center StEastern Corp603020

603+924-3201PVS03458Peterborough, NHOne Grove StAir Express600300

315+708-3211JHG02123Warwick, RI48 Legolas WayHydraulic Distributor703000

315+555-6987JHG02864Cumberland, RIMartin StreetAmerican Scientific601200

203+729-0221CJB06770Naugatuck, CTNew Haven RdAcme Co600000

PhoneSalescodeZipCity, StateAddressNameCust #

Table: Customer.Master

Page 7: W515 - Getting Data Out of Disc with ODBC BBJ · 2007. 2. 14. · Summit 2007: Get Connected W515 - Getting Data Out of Disc with ODBC BBJ Brian Fluckiger Technical Support Not quite

Summit 2007: Get Connected

© 2007 Activant Solutions Inc. All Rights Reserved

13

Task 909 - Multi-Record Type File

© 2007 Activant Solutions Inc. All Rights Reserved

14

ODBC - Multi-Record Type FileTable: Order Sold-to information

Table: Order Ship-to informationNew Britain, CT

West Haven CT

City, State

1.10602545 W Main StreetAlan Manufacturing01F51239100300

4.197045808 Collins WayRelease Testing Co01I518370101000

LevelZipAddressSold-toCust NameRecord #Order #Cust #

New Britain, CT

New Britain CT

City, State

1.10602545 W Main StreetAlan Manufacturing02F51239100300

NER97045202 Wavy StRelease NB02I518370101000

Entered byZipAddressSold-toCust NameRecord #Order #Cust #

Table: Order Miscellaneous information

1

0

State Code

1.1ABCAlan Manufacturing03F51239100300

648.80CRYVERBAL WAYNE03I518370101000

Est Order $SalescodeCust Purch OrderRecord #Order #Cust #

Table: Order Line Item information

0

40

Order Qty

0THANK YOU FOR YOUR BUSINESS*THANK05I518370101000

01/18/072.00HANSEN 10 PLUGHA02201B04I518370101000

Required DatePricePart DescriptionOur Part #Record #Order #Cust #

Page 8: W515 - Getting Data Out of Disc with ODBC BBJ · 2007. 2. 14. · Summit 2007: Get Connected W515 - Getting Data Out of Disc with ODBC BBJ Brian Fluckiger Technical Support Not quite

Summit 2007: Get Connected

© 2007 Activant Solutions Inc. All Rights Reserved

15

SQL and Microsoft Query

Structured Query LanguageUsed to communicate with a databaseRetrieves data based on your selection criteria

Example:SELECT customer_name, customer_address FROM Customer.Master WHERE customer_state = ‘NV’SELECT customer_name FROM Customer.Master WHEREcustomer_name LIKE ‘Ace%’SELECT MAX(customer_YTDsales), customer_name FROMCustomer.Master GROUP BY customer_state

Updating of Disc data is allowed but not advised

© 2007 Activant Solutions Inc. All Rights Reserved

16

SQL – WHERE Clause

Adds conditions or criteria for selectionOperators used with WHERE

= Equal<> Not Equal> Greater Than< Less Than>= Greater Than or Equal<= Less Than or EqualBETWEEN Between an inclusive rangeLIKE Search for a Pattern

Example: SELECT name WHERE Sales>20000SELECT sales WHERE Salescode =‘AB%’

Page 9: W515 - Getting Data Out of Disc with ODBC BBJ · 2007. 2. 14. · Summit 2007: Get Connected W515 - Getting Data Out of Disc with ODBC BBJ Brian Fluckiger Technical Support Not quite

Summit 2007: Get Connected

© 2007 Activant Solutions Inc. All Rights Reserved

17

SQL – WHERE Clause Example

SELECT * WHERE City LIKE ‘N%’

Company_Name Contact_Name Address City StateABC Company George’s Service Ctr Southside West Thomaston CTBishops Shops Cloe Weaver 108 East Main St Berlin WICentral Pizza Joseph Sandia 3A Two Rod Highway New Hartford NDEast Main Plumbing Ralph Parsons 9801 Circle East Cowa City CAFirst City Bank Dave Handler 42 Riverside Dr Locust CAGallery of Paint Olivia Turner 197 State St North Haven CTGeorge’s Service Center Randy Hearns 46 Locust Ctr Deniston CAKen's Diner Ralph Cramer Maubelstr. 90 New Britain CTLand's End Yao Ming 1900 Oak St. Vancouver GA

Company_Name Contact_Name Address City StateCentral Pizza Joseph Sandia 3A Two Rod Highway New Hartford NDGallery of Paint Olivia Turner 197 State St North Haven CTKen's Diner Ralph Cramer Maubelstr. 90 New Britain CT

© 2007 Activant Solutions Inc. All Rights Reserved

18

SQL – GROUP BY Clause

Allows aggregate functions to operate on a collection of data and return a single value

SUM, COUNT, MAX, MIN, AVGExample:

SELECT CU_INVOICE_01.CUSTOMER_NUM,SUM(CU_INVOICE_03.FREIGHT_DOLLARS), SUM(CU_INVOICE_03.INVOICE_SUBTOTAL), SUM(CU_INVOICE_03.TAX_DOLLARS)FROM CU_INVOICE_01 CU_INVOICE_01, CU_INVOICE_03 CU_INVOICE_03WHERE CU_INVOICE_01.CUSTOMER_NUM =

CU_INVOICE_03.CUSTOMER_NUM AND CU_INVOICE_01.ORDER_NUM = CU_INVOICE_03.ORDER_NUMGROUP BY(CU_INVOICE_01.CUSTOMER_NUM)

Page 10: W515 - Getting Data Out of Disc with ODBC BBJ · 2007. 2. 14. · Summit 2007: Get Connected W515 - Getting Data Out of Disc with ODBC BBJ Brian Fluckiger Technical Support Not quite

Summit 2007: Get Connected

© 2007 Activant Solutions Inc. All Rights Reserved

19

SQL – Joining Tables

Binding tables together to allow selection of data from all tablesPrevents data from being duplicated Simple and Inner Joins are most common

SELECT Employees.Name, Orders.Product FROM Employees, Orders WHERE Employees.Employee_ID=Orders.Employee_IDSELECT Contact.contact_name, Company.Company_name, Contact.Phone_number From Company INNER JOIN Contacts Where Company.Company_ID = Contact.Company_ID

© 2007 Activant Solutions Inc. All Rights Reserved

20

Examples of Some Queries

Excel - Inventory by Sales AnalysisExcel - Customer email addresses

Review formatting and refreshing data

Word - Mail MergeAccess - Inventory by Sales Analysis

Page 11: W515 - Getting Data Out of Disc with ODBC BBJ · 2007. 2. 14. · Summit 2007: Get Connected W515 - Getting Data Out of Disc with ODBC BBJ Brian Fluckiger Technical Support Not quite

Summit 2007: Get Connected

© 2007 Activant Solutions Inc. All Rights Reserved

21

Excel Query Example – Step 1

In Excel select ‘Data’, ‘New Database Query’

© 2007 Activant Solutions Inc. All Rights Reserved

22

Excel Query Example – Step 2

Select the database to be used

Page 12: W515 - Getting Data Out of Disc with ODBC BBJ · 2007. 2. 14. · Summit 2007: Get Connected W515 - Getting Data Out of Disc with ODBC BBJ Brian Fluckiger Technical Support Not quite

Summit 2007: Get Connected

© 2007 Activant Solutions Inc. All Rights Reserved

23

Excel Query Example – Step 3

Select the files and fields to be included

© 2007 Activant Solutions Inc. All Rights Reserved

24

Excel Query Example – Step 4

Tables can be joined or linked together later

Page 13: W515 - Getting Data Out of Disc with ODBC BBJ · 2007. 2. 14. · Summit 2007: Get Connected W515 - Getting Data Out of Disc with ODBC BBJ Brian Fluckiger Technical Support Not quite

Summit 2007: Get Connected

© 2007 Activant Solutions Inc. All Rights Reserved

25

Excel Query Example – Step 5

Enter selection criteria (or not), and then ‘Next’

© 2007 Activant Solutions Inc. All Rights Reserved

26

Excel Query Example – Step 6

Enter sort order (or not), and then ‘Next’

Page 14: W515 - Getting Data Out of Disc with ODBC BBJ · 2007. 2. 14. · Summit 2007: Get Connected W515 - Getting Data Out of Disc with ODBC BBJ Brian Fluckiger Technical Support Not quite

Summit 2007: Get Connected

© 2007 Activant Solutions Inc. All Rights Reserved

27

Excel Query Example – Step 7

Select ‘View data or edit query…’ and ‘Finish’

© 2007 Activant Solutions Inc. All Rights Reserved

28

Excel Query Example – Step 8

Initial results may need to be ‘tweaked’

Page 15: W515 - Getting Data Out of Disc with ODBC BBJ · 2007. 2. 14. · Summit 2007: Get Connected W515 - Getting Data Out of Disc with ODBC BBJ Brian Fluckiger Technical Support Not quite

Summit 2007: Get Connected

© 2007 Activant Solutions Inc. All Rights Reserved

29

Excel Query Example – Step 9

Select to view the SQL statement created

© 2007 Activant Solutions Inc. All Rights Reserved

30

Excel Query Example – Step 10

Edit the SQL statement and hit ‘OK’

Page 16: W515 - Getting Data Out of Disc with ODBC BBJ · 2007. 2. 14. · Summit 2007: Get Connected W515 - Getting Data Out of Disc with ODBC BBJ Brian Fluckiger Technical Support Not quite

Summit 2007: Get Connected

© 2007 Activant Solutions Inc. All Rights Reserved

31

Excel Query Example – Step 11

Return the data back to your spreadsheet

© 2007 Activant Solutions Inc. All Rights Reserved

32

Excel Query Example – Step 12

You can add multiple queries to the same page

Page 17: W515 - Getting Data Out of Disc with ODBC BBJ · 2007. 2. 14. · Summit 2007: Get Connected W515 - Getting Data Out of Disc with ODBC BBJ Brian Fluckiger Technical Support Not quite

Summit 2007: Get Connected

© 2007 Activant Solutions Inc. All Rights Reserved

33

Excel Query Example – Step 13

© 2007 Activant Solutions Inc. All Rights Reserved

34

Add Creative Formatting to Your Query

Page 18: W515 - Getting Data Out of Disc with ODBC BBJ · 2007. 2. 14. · Summit 2007: Get Connected W515 - Getting Data Out of Disc with ODBC BBJ Brian Fluckiger Technical Support Not quite

Summit 2007: Get Connected

© 2007 Activant Solutions Inc. All Rights Reserved

35

Using Access to Get to Disc Data – Step 1

Start Access, select Blank Database

© 2007 Activant Solutions Inc. All Rights Reserved

36

Using Access to Get to Disc Data – Step 2

Create the database file on your machine

Page 19: W515 - Getting Data Out of Disc with ODBC BBJ · 2007. 2. 14. · Summit 2007: Get Connected W515 - Getting Data Out of Disc with ODBC BBJ Brian Fluckiger Technical Support Not quite

Summit 2007: Get Connected

© 2007 Activant Solutions Inc. All Rights Reserved

37

Using Access to Get to Disc Data – Step 3

To link the files, select ‘File’…

© 2007 Activant Solutions Inc. All Rights Reserved

38

Using Access to Get to Disc Data – Step 4

Select ‘Get External Data’, and ‘Link Tables’

Page 20: W515 - Getting Data Out of Disc with ODBC BBJ · 2007. 2. 14. · Summit 2007: Get Connected W515 - Getting Data Out of Disc with ODBC BBJ Brian Fluckiger Technical Support Not quite

Summit 2007: Get Connected

© 2007 Activant Solutions Inc. All Rights Reserved

39

Using Access to Get to Disc Data – Step 5

Select ‘ODBC Databases’ as the File Type

© 2007 Activant Solutions Inc. All Rights Reserved

40

Using Access to Get to Disc Data – Step 6

Select the Data Source for the Disc System

Page 21: W515 - Getting Data Out of Disc with ODBC BBJ · 2007. 2. 14. · Summit 2007: Get Connected W515 - Getting Data Out of Disc with ODBC BBJ Brian Fluckiger Technical Support Not quite

Summit 2007: Get Connected

© 2007 Activant Solutions Inc. All Rights Reserved

41

Using Access to Get to Disc Data – Step 7

Select the files to be included in your query

© 2007 Activant Solutions Inc. All Rights Reserved

42

Using Access to Get to Disc Data – Step 8

Files will then be displayed as live links

Page 22: W515 - Getting Data Out of Disc with ODBC BBJ · 2007. 2. 14. · Summit 2007: Get Connected W515 - Getting Data Out of Disc with ODBC BBJ Brian Fluckiger Technical Support Not quite

Summit 2007: Get Connected

© 2007 Activant Solutions Inc. All Rights Reserved

43

Using Access to Get to Disc Data – Step 9

Create queries with these live tables

© 2007 Activant Solutions Inc. All Rights Reserved

44

Return on Investment Opportunity

Get more value out of ODBCExpand the use of your Disc dataDesign your own reportsCreate information to make business decisionsMore efficiency and productivity

Page 23: W515 - Getting Data Out of Disc with ODBC BBJ · 2007. 2. 14. · Summit 2007: Get Connected W515 - Getting Data Out of Disc with ODBC BBJ Brian Fluckiger Technical Support Not quite

Summit 2007: Get Connected

© 2007 Activant Solutions Inc. All Rights Reserved

45

Additional Resources

Customer Web Sitehttp://distribution.activant.com/

Product documentationActivant Customer Web Site – DocumentationODBC Data Dictionary Definitions

Activant Disc [email protected]@activant.com

Internet search for tutorials and helpful tipswww.w3schools.com/sqlhttp://office.microsoft.comor Search google e.g. ‘SQL GROUP BY’

© 2007 Activant Solutions Inc. All Rights Reserved

46

Suggested Action Plan

Install ODBC if you haven’t alreadyGet familiar with the Disc databaseFigure out what data you want to seeSee how others do itUse the web for tips and tricks

Page 24: W515 - Getting Data Out of Disc with ODBC BBJ · 2007. 2. 14. · Summit 2007: Get Connected W515 - Getting Data Out of Disc with ODBC BBJ Brian Fluckiger Technical Support Not quite

Summit 2007: Get Connected

© 2007 Activant Solutions Inc. All Rights Reserved

47

Summary

Review how ODBC is implementedDiscuss some troubleshooting errorsExplain data dictionaryReview Disc data structureDiscuss SQL and query languagesDemonstrate some practical uses

© 2007 Activant Solutions Inc. All Rights Reserved

48

Thank You for Attending

W515 – Getting Data Out of Disc with ODBC BBjBrian FluckigerPlease submit the Session Feedback Form

To receive NASBA credits, please be sure to complete the Session Feedback Form and sign the class roster in the back of the room

Page 25: W515 - Getting Data Out of Disc with ODBC BBJ · 2007. 2. 14. · Summit 2007: Get Connected W515 - Getting Data Out of Disc with ODBC BBJ Brian Fluckiger Technical Support Not quite

Session Feedback Form Summit 2007 – Las Vegas, NV

Please take a moment to evaluate this session and offer feedback. Activant uses your input to understand your needs and to determine future Summit sessions.

Session Name: Session Number:

Presenter’s Name:

How important is this topic to your job/company? 1 2 3 4 5

Not Important Important

Please rate the educational value you received from this session. 1 2 3 4 5

Low Value High Value

1. What software are you currently using?

2. How long have you personally used this software?

3. Describe the effectiveness of your instructor.

4. What is your overall evaluation of this session?

5. What could have been done to improve this session?

6. What sessions would you like to see presented at future conferences?

7. What issues will be critical to your business in the next 12-24 months?

Check here if you would like CPE credits. To receive credits, be sure to sign your name at the bottom of this form and sign the roster in the session room.

Answering the following questions is OPTIONAL (but required for CPE Credits).

Yes No

Did this session meet your expectations, based on the description/objectives in the registration materials?

Were the pre-requisite requirements stated in the course description appropriate?

Did the session materials contribute to achieving the learning objectives?

Did the equipment (screen, microphone, projector, etc.) in the room enhance the instruction?

Was the time allotted for the session appropriate for the topic?

Name:__________________________________________________________________________________________________

Company:_____________________________________________________ E-mail:___________________________________