advanced functions with db2 and php for ibm...

30
© All rights reserved. Zend Technologies, Inc. Advanced Functions with DB2 and PHP for IBM i Mike Pavlak Solution Consultant

Upload: trinhliem

Post on 03-Apr-2018

228 views

Category:

Documents


3 download

TRANSCRIPT

© All rights reserved. Zend Technologies, Inc.

Advanced Functions with

DB2 and PHP for IBM i

Mike Pavlak

Solution Consultant

© All rights reserved. Zend Technologies, Inc.

Agenda

•DB2 features in i6.1 and i7.1

•Review DB2 functions in PHP

•Explore the possibilities

•Q&A

2

© All rights reserved. Zend Technologies, Inc.

Three primary ingredients to PHP script

3 Insert->Header & Footer

© All rights reserved. Zend Technologies, Inc.

Go get info

4 Insert->Header & Footer

© All rights reserved. Zend Technologies, Inc.

DB2 Wiki

5 Insert->Header & Footer

© All rights reserved. Zend Technologies, Inc.

IBM changed the update process

•Version – Major release

Technology refresh - #4 released to GA on

• Cumulative

• Group

– PTF

6 Insert->Header & Footer

© All rights reserved. Zend Technologies, Inc.

Updates and plans…

7 Insert->Header & Footer

© All rights reserved. Zend Technologies, Inc.

Why do I care about DB2 changes?

• IBM continually investing

•Primary data access to DB2 on IBM i

•Rising tide raises all boats…

In other words, improvements in DB2, SQL and especially SQE..

Improves features and performance in all languages like

• Java

• RPG

• COBOL

• Of, of course PHP!

And, ODBC, JDBC, ADO

8 Insert->Header & Footer

© All rights reserved. Zend Technologies, Inc.

Subscribe to blog and get notified!

•http://db2fori.blogspot.com/

9 Insert->Header & Footer

© All rights reserved. Zend Technologies, Inc.

DB2 features V5R4

10 Insert->Header & Footer

© All rights reserved. Zend Technologies, Inc.

V5R4 DB2

•Free format embedded SQL (RPG)

•PHP DB2 interface was delivered (back-leveled to V5R3)

•Automatic journaling enhancements

•SQE makes its debut in V5R2 and gets tweaked in V5R4

•Speed enhancements of SPL

•System i Navigator enhancements

•Content Manager delivered.

•Much more…

11 Insert->Header & Footer

© All rights reserved. Zend Technologies, Inc.

V5R4 DB2

•Sunset is on the horizon

•September 30, 2013 – EOL for V5R4

•Extended support for a fee, but

Get thyself to i6.1 or higher!

12 Insert->Header & Footer

© All rights reserved. Zend Technologies, Inc.

DB2 features IBM i6.1

13 Insert->Header & Footer

© All rights reserved. Zend Technologies, Inc.

Lots of new features! •Supergroup

CUBE and ROLLUP

•VALUES in FROM clause

• INSERT in FROM

•Expression support in Index

•Row change TIMESTAMP

•Hidden Columns

•Full outer join

•Skip locked data

•For each finds its way to SPL!

•Many new functions, & features. This is a bang up release!

14 Insert->Header & Footer

Many new

functions!

This is a BANG

up release!

© All rights reserved. Zend Technologies, Inc.

IBM DB2 Storage Engine for MySQL

•Makes debut in i6.1

•Creates tables

•Populates data

•Shipped with Zend DBi

http://www.zend.com/en/products/dbi/

•Supported by IBM

•Redbook

http://www.redbooks.ibm.com/abstracts/sg247705.html

15 Insert->Header & Footer

© All rights reserved. Zend Technologies, Inc.

Server side for PHP

•SQL Server Mode Subsystem Control

Server job QSQSRVR runs in QSYSWRK by default

Can change to same subsystem as application

PHP application runs in QHTTPSVR

Better memory control and workload partitioning

•ADDENVVAR ENVVAR(QIBM_SRVRMODE_SBS) VALUE('*SAME')

LEVEL(*SYS)

16 Insert->Header & Footer

© All rights reserved. Zend Technologies, Inc.

DB2 features IBM i7.1

17 Insert->Header & Footer

© All rights reserved. Zend Technologies, Inc.

DB2 features delivered in i7.1

•Enhanced SQL & RPG integration

•Greater result set support

•XML Data Type

•Performance

Adaptive query processing

Self Learning Optimization

Logical file on FROM support, select omit observance

•SSD and in memory DB enablement

• IBM i Navigator enhancements

Progress monitor, Index advisor, etc.

18 Insert->Header & Footer

© All rights reserved. Zend Technologies, Inc.

PHP on IBM i

•Since PHP runs natively on IBM i

Zend Server!

DRDA via PASE

•All features available!!!

19 Insert->Header & Footer

© All rights reserved. Zend Technologies, Inc.

Digging in to Key Features

20 Insert->Header & Footer

© All rights reserved. Zend Technologies, Inc.

Hidden Column

•Useful for protecting sensitive data from dynamic queries

•Hide a column by default

•Column is still there and can be manipulated directly

21 Insert->Header & Footer

CREATE TABLE ZENDDATA/EMPMAST (

NAME CHAR (20 ) NOT NULL WITH DEFAULT,

CITY CHAR (20 ) NOT NULL WITH DEFAULT,

STATE CHAR (2 ) NOT NULL WITH DEFAULT,

SSN INT NOT NULL WITH DEFAULT IMPLICITLY HIDDEN)

© All rights reserved. Zend Technologies, Inc.

Insert data…

•Must explicitly reference field on insert statement

(lost sleep here, but makes sense)

•Then values clause…

22 Insert->Header & Footer

INSERT INTO

ZENDDATA.EMPMAST (NAME, CITY, STATE, SSN)

VALUES('Sheldon Cooper', 'San Jose', 'CA‘,567891234);

© All rights reserved. Zend Technologies, Inc.

Let’s see…

•So using “select *” returns only the visible fields…

23 Insert->Header & Footer

© All rights reserved. Zend Technologies, Inc.

Hidden field

•Reference hidden field explicitly to reveal data

24 Insert->Header & Footer

© All rights reserved. Zend Technologies, Inc.

In PHP, why is this good

•Write dynamic routines to display data

•Database can manage what is seen by default

•But as a developer, you can still manipulate and control!

25 Insert->Header & Footer

© All rights reserved. Zend Technologies, Inc.

But what if I want to see this?

• Include the column in the select

•Now you can see it…

26 Insert->Header & Footer

© All rights reserved. Zend Technologies, Inc.

Webcasts

•June 20 –PHP on IBM i Beyond the Basics

•July 18 – PHP and IBM i: Open Source Productivity Tools

Your thoughts???

27 Insert->Header & Footer

© All rights reserved. Zend Technologies, Inc.

Join us at ZendCon The premier PHP conference!

October 22-25, 2012 – Santa Clara, CA

www.zendcon.com

Conference Themes

PHP in 2012 - The latest PHP technologies and tools

Learn how to leverage the latest mobile, HTML 5, testing and

PHP best practices

Zend Framework 2 - Hit the ground running

Learn how to build faster, more modular and more

expandable applications

Development & The Cloud – A love story

Learn how the latest developments in cloud-based services,

infrastructure and best practices can benefit you

Conference Highlights

• Sessions focused on how to best develop and deploy PHP

• Sessions designed for all knowledge levels

• Intensive tutorials for accelerated learning

• PHP Certification crash courses and testing

• Exhibit hall showcasing the latest products

• Special networking opportunities during meals and events

© All rights reserved. Zend Technologies, Inc. 30

Q&A

[email protected]

[email protected]