From MySQL to SiR via ODBC John S. Lemon. From MySQL to SiR via ODBC How did it start ? Interdivisional rivalry / power complex- Calls are being delayed.

Slides:



Advertisements
Similar presentations
MFA for Business Banking – Security Code Multifactor Authentication: Quick Tip Sheets Note to Financial Institutions: We are providing these QT sheets.
Advertisements

Debugging ACL Scripts.
JQuery MessageBoard. Lets use jQuery and AJAX in combination with a database to update and retrieve information without refreshing the page. Here we will.
Writing Pseudocode And Making a Flow Chart A Number Guessing Game
PHP II Interacting with Database Data. The whole idea of a database-driven website is to enable the content of the site to reside in a database, and to.
Use of the SPSSMR Data Model at ATP 12 January 2004.
What is MySQL? MySQL is a relational database management system (A relational database stores data in separate tables rather than putting all the data.
PHP (2) – Functions, Arrays, Databases, and sessions.
Web Time Entry Approval of Student Time Entry Via the Web.
A Guide to MySQL 3. 2 Objectives Start MySQL and learn how to use the MySQL Reference Manual Create a database Change (activate) a database Create tables.
MIS2502: Data Analytics MySQL and SQL Workbench David Schuff
CS2008/CS5035 Exam Preparation. Dept. of Computing Science, University of Aberdeen2 Organization of Lecture Notes Group 1 - SQL –L1 – Introduction –L2.
Chocolate Bar! luqili. Milestone 3 Speed 11% of final mark 7%: path quality and speed –Some cleverness required for full marks –Implement some A* techniques.
CHAPTER 9 DATABASE MANAGEMENT © Prepared By: Razif Razali.
Databases with PHP A quick introduction. Y’all know SQL and Databases  You put data in  You get data out  You can do processing on it very easily 
Making ODBC easier By Dave Doulton University of Southampton.
MySQL + PHP.  Introduction Before you actually start building your database scripts, you must have a database to place information into and read it from.
1 PHP and MySQL. 2 Topics  Querying Data with PHP  User-Driven Querying  Writing Data with PHP and MySQL PHP and MySQL.
ICAPRG301A Week 4Buggy Programming ICAPRG301A Apply introductory programming techniques Program Bugs US Navy Admiral Grace Hopper is often credited with.
A SIR web based leave/absence management system. By Dave Doulton University of Southampton.
Getting SQL Right the First Try (Most of the Time!) May, 2008 ©2007 Dan Tow, All rights reserved SingingSQL Presents.
PHP meets MySQL.
Dinamic SQL & Cursor. Why Dinamic SQL ? Sometimes there is a need to dynamically create a SQL statement on the fly and then run that command. This can.
Stored Procedures, Transactions, and Error-Handling
Key Data Management Tasks in Stata
(Chapter 10 continued) Our examples feature MySQL as the database engine. It's open source and free. It's fully featured. And it's platform independent.
Dr Gordon Russell, Napier University Unit Embedded SQL - V3.0 1 Embedded SQL Unit 5.1.
CHAPTER 9 PHP AND MYSQL. A POSSIBLE SITE CONFIGURATION Application Folder index.php includes (folder)header.phpfooter.phpstyle.cssmodel (folder)mysqli_connect.php.
Systems Life Cycle. Know the elements of the system that are created Understand the need for thorough testing Be able to describe the different tests.
Diagnostic Pathfinder for Instructors. Diagnostic Pathfinder Local File vs. Database Normal operations Expert operations Admin operations.
Crystal And Elliott Edward M. Kwang President. Objective A brief demo of Crystal Report to entice you –People spend thousand of dollars to attend Crystal.
Views Lesson 7.
Just a Little PHP Programming PHP on the Server. Common Programming Language Features Comments Data Types Variable Declarations Expressions Flow of Control.
Programmatic SQL Shaista Khan CS 157B. Topic Embedded SQL statements in high-level programming languages.
CIS4368: Advanced DatabaseSlide # 1 PL/SQL Dr. Peeter KirsSpring, 2003 PL/SQL.
A Baker's Dozen Tricks in a Button Thirteen Tricks of the SIR Trade Rolled into a Single Useful Application © Tom Shriver, DataVisor 2002.
DT228/3 Web Development Databases. Querying a database: Partial info Search engines, on-line catalogues often need to allow user to search a database.
INFO1408 Database Design Concepts Week 16: Introduction to Database Management Systems Continued.
1 CS 177 Week 12 Recitation Slides Running Time and Performance.
Mtivity Client Support System Quick start guide. Mtivity Client Support System We are very pleased to announce the launch of a new Client Support System.
Controlling User Access. 2 home back first prev next last What Will I Learn? Compare the difference between object privileges and system privileges Construct.
Creating a simple database This shows you how to set up a database using PHPMyAdmin (installed with WAMP)
Introduction to Explicit Cursors. 2 home back first prev next last What Will I Learn? Distinguish between an implicit and an explicit cursor Describe.
Just a Little PHP Programming PHP on the Server. Common Programming Language Features Comments Data Types Variable Declarations Expressions Flow of Control.
Task #1 Create a relational database on computers in computer classroom 308, using MySQL server and any client. Create the same database, using MS Access.
NSF DUE ; Wen M. Andrews J. Sargeant Reynolds Community College Richmond, Virginia.
Introduction to Database Systems Exam Preparation.
Testing External Survey Automatic Credit Granting Shepherd University Department of Psychology.
PROGRAMMING IN PYTHON LETS LEARN SOME CODE TOGETHER!
Confidencial - TRACASA Automatize test [e- Reporting]
MYSQL AND MYSQL WORKBENCH MIS2502 Data Analytics.
@CRMUG Get2Know CRM 2015 Covering the Field(s) - Rollup and Calculated Style.
1 Chapter 1- Introduction How Bugs affect our lives What is a Bug? What software testers do?
Reactor An ORM framework for ColdFusion Presentation By: Doug Hughes
Lawson Mid-America User Group Spring 2016 Meeting.
Concepts of Database Management, Fifth Edition Chapter 3: The Relational Model 2: SQL.
VAdata Tools VAdata: Virginia’s Sexual and Domestic Violence Data Collection System.
3 A Guide to MySQL.
Cleveland SQL Saturday Catch-All or Sometimes Queries
CS1371 Introduction to Computing for Engineers
MVC Framework, in general.
From 4 Minutes to 8 Seconds in an Hour (or a bit less)
Designing and Debugging Batch and Interactive COBOL Programs
Data and Flowcharts Session
Data and Flowcharts Session
DATABASES WHAT IS A DATABASE?
Fundamental Programming
Data and Flowcharts Session
Selection Statements Chapter 3.
Presentation transcript:

From MySQL to SiR via ODBC John S. Lemon

From MySQL to SiR via ODBC How did it start ? Interdivisional rivalry / power complex- Calls are being delayed longer this year in your division and this is reflecting on the service Had to prove it in 24 hours before weekly division managers meeting.

From MySQL to SiR via ODBC Summary Initial crude solution – ODBC & SPSS hoist by own petard - too successful MySQL extractions no help – bugs / features Re-think Need to automate / replicate Use vPQL + ODBC > SiR > SPSS

From MySQL to SiR via ODBC Problem Needed to know poor response rates. System provided reports and charts were no help

From MySQL to SiR via ODBC Problem Charts and tables geared towards management Gave overall views but fail to answer detailed questions Why ?

From MySQL to SiR via ODBC Problem Organisation is the problem Calls can enter at any point not just top Then migrate anywhere

From MySQL to SiR via ODBC Problem Charts and tables geared towards management Didnt show movement between subgroups Only times were Open and Close So if call closed by subgroup X then reports allocated total time to X even if 90% was in Y !!!

From MySQL to SiR via ODBC ODBC and SPSS Use ODBC from SPSS to extract data Create two files and manipulate within SPSS Merge and Aggregate create data file Still not good enough as limited cross record functions

From MySQL to SiR via ODBC ODBC and SPSS Use my SPSS2SiR routines ? No – one-off and time constrained – hadnt used for some years so ….. ? Save As fixed ASCII from SPSS Create simple data base in SiR Allowed cross record functions

From MySQL to SiR via ODBC ODBC and SPSS Crude but effective solution Unfortunately not end of problem Hoist by my own petard –A petard is an explosive device used to break down doors or walls with a slow burning fuse –Sometimes the burn was not as slow as the bomb placer would like.

From MySQL to SiR via ODBC My Petard Met the deadline – but …. Management requested more detail and complexity Actually heard that the phrase was – If it is not your ….ing division that needs a kick up the a..e ! Then whose does.

From MySQL to SiR via ODBC My Petard Also wanted weekly updates Using SPSS route wasnt practical –Cumbersome –Crude –Had tailored process for one division –So couldnt be easily extended or automated Back to drawing board

From MySQL to SiR via ODBC Next Step – First thoughts MySQL data base - so obvious answer Use MySQL queries to generate data files –Even though updates were via SiR vPQL generated SQL code thought might work –Few more grey hairs later – no success –Dump data out and read into SiR Feature – no last column !!

From MySQL to SiR via ODBC Next Step – Second thoughts ODBC worked for MySQL to SPSS so why not use for this Dave Doulton uses a lot so … it must be good ! How to do it ? Direct into SiR

From MySQL to SiR via ODBC Next Step – Second thoughts Appeared to work well However –Many very short records for describing the action –Also many actions missing Why ? Took some while to crack the reason

From MySQL to SiR via ODBC Next Step – Second thoughts LF / CR

From MySQL to SiR via ODBC Next Step – Second thoughts Why was this important ? Whatever I was doing ( right or wrong ) SiR treated it as end of record Truncated MySQL records and so missed out the important bit !!

From MySQL to SiR via ODBC Next Step – Second thoughts

From MySQL to SiR via ODBC Next Step – Third thoughts Back to the drawing board Have to write a vPQL programme How ? Obvious thing RTFM Read The Fine Manual You thought I was going say Flipping ! Or something else !!

From MySQL to SiR via ODBC Next Step – Third thoughts Actually not a manual –( how many are nowadays ? ) Help files – complete with sample program RTFHF doesnt flow as easily off the tongue as RTFM Didnt quite understand all the options Now for a bit of history

From MySQL to SiR via ODBC PROGRAM INTEGER*4 errid conid statid rnum cnum STRING*20 cname colval STRING*80 qtext errstr CONNECT conid SERVER 'ODBC' DATABASE 'Company' USER 'me' PASSWORD 'mypwd,COMPANY,HIGH,HIGH' PREFIX 'c:\SIR2002\TEST\' ERROR errid STATEMENT statid CONNECT conid ERROR errid WRITE errid PREPARE STATEMENT statid CONNECT conid COMMAND 'SELECT * FROM EMPLOYEE' ERROR errid WRITE errid EXECUTE STATEMENT statid CONNECT conid ERROR errid WRITE errid COMPUTE cnum = COLCOUNT (conid,statid) COMPUTE rnum = ROWCOUNT (conid,statid) WRITE 'Columns returned ' cnum ' Rows returned ' rnum FOR I = 1,cnum. COMPUTE cname = COLNAME (conid,statid,i). WRITE cname END FOR SET J (0) LOOP. COMPUTE j = j+1. COMPUTE res = NEXTROW (conid,statid). IF (res LE 0) EXIT LOOP. FOR I = 1,cnum. IFTHEN (COLTYPE(conid,statid,i) eq 1). COMPUTE colval = COLVALS (conid,statid,j,i). ELSE. COMPUTE colval = FORMAT (COLVALN (conid,statid,j,i)). ENDIF. WRITE colval. END FOR END LOOP DELETE STATEMENT statid CONNECT conid DISCONNECT conid END PROGRAM The Good old days ?

From MySQL to SiR via ODBC Progress ? Number of basic crucial commands to get ODBC data –CONNECT –STATEMENT –PREPARE STATEMENT –EXECUTE STATEMENT –DELETE STATEMENT –DISCONNECT After RTFHFing still had problems

From MySQL to SiR via ODBC Progress ? Just couldnt get a connection or anything Solution – David Baxter !!! As usual came to rescue – problem solved Still not sure why – just happy it does

From MySQL to SiR via ODBC Progress ? This is the help file suggestion CONNECT conid SERVER 'ODBC' DATABASE 'Company' USER 'me' PASSWORD 'mypwd,COMPANY,HIGH,HIGH' PREFIX 'c:\SIR2002\TEST\' ERROR errid This is what I (we!!) got to work CONNECT conid SERVER 'ODBC DATABASE 'Supportworks ODBC USER 'train01 PASSWORD 'train01 PREFIX ' ERROR errid

From MySQL to SiR via ODBC Progress ? Cant re-read / re-extract a column Why would you want to com045-user identifier com- department code If needed then extract twice ODBC doesnt complain !!! Or extract to string and chop up which is what I did for Date/Time vars

From MySQL to SiR via ODBC Progress ? COMPUTE TEMP468= COLVALS ( conid, statid, ROWNUM, 4 ); TEMP4D = CDATE ( ( SBST ( TEMP468, 1, 10 ) ), 'DDIMMIYYYY' ); TEMP4T = CTIME ( ( SBST ( TEMP468, 12, 8 ) ), 'HHIMMISS' ); Extract the MySQL Date/Time variable into a string ( COLVALS ) Then chop out the bit you want and convert to date or time Numeric values need COLVALN COMPUTE TEMP2 = COLVALN ( conid, statid, ROWNUM, 2 );

From MySQL to SiR via ODBC SiR wins Typical output but presents problem Start date and end date but no intermediates Generate dummy records

From MySQL to SiR via ODBC Hindsight Would I use ODBC again ? Yes – with what I know now I would not attempt extracting data from two MySQL tables and merge them in ODBC query statement SiR does it more cleanly Would be more careful in the planning.