SlideShare a Scribd company logo
IBM i/DB2 Modernization to SQL
CM First Group. Confidential & Do Not Distribute 2
About Your Presenter
IBM i Professional for 16 Years.
Primary Focus is IBM i Engineering / Programming
Well Versed in 2E.
Well Versed in RPG (All Flavors)
Well Versed in CM Products such as Implementer
Up to Date on Newest SQL/RPG Enhancements.
CM First Group. Confidential & Do Not Distribute 3
Agenda
What Exactly is SQL (Just in case you don’t know. )
Benefits of Moving to SQL Created Objects
SQL Performance Benefits
SQL Objects vs DDS Objects
SQL Source vs DDS Source
Changing a 2E Model to Support SQL
SQL Specific Data Types
CM First Group. Confidential & Do Not Distribute 4
What Exactly is SQL?
SQL Stands for Structured Query Language.
Developed at IBM in the Early 1970s.
Consists of a DDL (Data Definition Language)
IE, CREATE TABLE, CREATE INDEX
Consists of a DML (Data Manipulation Language)
IE, INSERT INTO, UPDATE, DELETE,
To a Large Extent Consists of Simple English
Statements.
CM First Group. Confidential & Do Not Distribute 5
Benefits of Moving to SQL Created Objects
Whole World Uses SQL. New resources are more familiar with
SQL then DDS.
Long Field Names are Available to Outside World. YAY! 
Performance (Further discussion later)
Data is Validated when Written to the Database.
DDL Defined Indexes use a 64K page size vs 8K used by Logical
Files.
Null Capable Fields.
New Data Types (Blob, Clob, Lob) Demo of this!
CM First Group. Confidential & Do Not Distribute 6
Benefits of Moving to SQL Created Objects
No Enhancements to DDS Language.
Constraints are Built into Database.
Built in Encryption.
Easier Modification of Table Layouts.
RPG Programs that Use SQL Access Don’t Need a Re-
compile.
Automatic Identity Columns.
CM First Group. Confidential & Do Not Distribute 7
SQL Performance
In DDS Data is Validated When Read. In SQL Data is
Validated When Written.
This is Important as we Normally do many more reads
vs. writes. Ratio could be as high as 25 to 1.
Data Can Arrive up to 11 Seconds Faster. Especially
Helpful When Loading up Subfiles from Random Keys.
Concurrent Write Support.
Logical Page Size of 64K.
CM First Group. Confidential & Do Not Distribute 8
SQL Performance
In DDS Data is Validated When Read. In SQL Data is
Validated When Written.
This is Important as we Normally do many more reads
vs. writes. Ratio could be as high as 25 to 1.
Data Can Arrive up to 11 Seconds Faster. Especially
Helpful When Loading up Subfiles from Random Keys.
Concurrent Write Support.
Logical Page Size of 64K.
CM First Group. Confidential & Do Not Distribute 9
SQL Objects vs DDS Objects
DDS Objects Create Physical Files & Logical Files
The Object types are *FILE PF and *FILE LF
Most common source is DDS and stored in QDDSSRC.
Source Member type is PF for Physical files, and LF for Logical Files.
Compiled like a program using option 14 from PDM, or using the CRTPF or
CRTLF commands.
SQL Objects create Physical Files & Logical Files as well.
The Object types are *FILE PF and *FILE LF
Most common source is SQL and stored in QSQLSRC.
Source Member type can be named anything.
CM First Group. Confidential & Do Not Distribute 10
SQL Objects vs DDS Objects DSPFD
CM First Group. Confidential & Do Not Distribute 11
SQL Objects vs DDS Objects DSPFD
CM First Group. Confidential & Do Not Distribute 12
SQL Source vs DDS Source
DDS Source is stored in source physical file QDDSSRC (Most Common)
Source is then compiled using CRTPF or CRTLF commands. (Option 14 in PDM)
CM First Group. Confidential & Do Not Distribute 13
SQL Source vs DDS Source
SQL Source is stored in source file QSQLSRC (Most
Common)
Source member type can be named anything.
However, common examples are
SQLT for tables, SQLV for views and SQLI for indexes.
SQL Objects are created using the RUNSQLSTM
command.
CM First Group. Confidential & Do Not Distribute 14
SQL Source vs DDS Source
Example SQL Table Source.
CM First Group. Confidential & Do Not Distribute 15
SQL Source vs DDS Source
Example SQL Table Source.
CM First Group. Confidential & Do Not Distribute 16
SQL Source vs DDS Source
Example SQL View Source.
CM First Group. Confidential & Do Not Distribute 17
SQL Source vs DDS Source
Example SQL View Source.
CM First Group. Confidential & Do Not Distribute 18
SQL Source vs DDS Source
Example SQL Index Source.
CM First Group. Confidential & Do Not Distribute 19
SQL Source vs DDS Source
Items to Note!
SQL objects are created using the RUNSQLSTM Command.
SQL View And Indexes produce separate IBM i Objects. (LFs)
No problem combining SQL Created tables and DDS Created LFs. (Common)
CM First Group. Confidential & Do Not Distribute 20
DML (Data Manipulation Language)
DML is used to manipulate the database.
Examples are,
SELECT ( to read data )
INSERT ( to insert data )
UPDATE (to update data)
DELETE (to delete data)
Big advantage is the use of the DB2 Database Engine for automatic index selection!
If an index exists that matches the search criteria then that index will be used
automatically. In standard record level access from RPG this is not the case.
SQL DML Statements can be incorporated directly into an RPG program! There is no
longer a need to use the traditional record level access provided by RPG.
CM First Group. Confidential & Do Not Distribute 21
DML (Data Manipulation Language)
Select (Statement Example)
CM First Group. Confidential & Do Not Distribute 22
DML (Data Manipulation Language)
Select (Statement Example)
CM First Group. Confidential & Do Not Distribute 23
DML (Data Manipulation Language)
INSERT (Statement Example)
CM First Group. Confidential & Do Not Distribute 24
DML (Data Manipulation Language)
UPDATE (Statement Example)
Can update multiple records at once!
CM First Group. Confidential & Do Not Distribute 25
DML (Data Manipulation Language)
DELETE (Statement Example)
Can delete multiple records at once!
CM First Group. Confidential & Do Not Distribute 26
Change Model to use SQL Support.
Several different approaches can be taken to change a model to support SQL.
You can change the model to use the 2E generated table name, but use longer
field name support. This allows you to expose the longer field names to the
outside world. No change to RPG.
You can change the model to use both the longer table name, and also the
longer field names. Again, easier for the outside world. No change to RPG.
You can change the generated function to use SQL record level access
regardless of the database type.
CM First Group. Confidential & Do Not Distribute 27
Change Model to use SQL Support.
Any change to support SQL is done though the changing of model values.
Name Description Values
YSQLVNM SQL naming *DDS
YDDLDBA Database Access Method *RLA / *SQL
YSQLLEN SQL naming length 10 to 25
YSQLOPT Generate SQL OPTIMIZE clause *NO
YSQLFMT Generate SQL RCDFMT clause *NO
YSQLSTM SQL statement generation type *EXC
YSQLCOL Generate SQL Col/Library Name *YES
YLVLCHK Generate IDX with LVLCHK(*YES) *NO
YDBFGEN Method for database file generation DDS / SQL / DDL
YSQLWHR specifies whether to use OR or NOT logic when generating SQL WHERE clauses. The default is
*OR.
YSQLLCK
CM First Group. Confidential & Do Not Distribute 28
Change Model to use SQL Support.
YSQLVNM relates to the naming scheme used for fields and files.
Values
*DDS – Uses the DDS name
*SQL – Use the names of the objects in the model.
*LNG – Use long names for fields and files
*LNF – Use long field names
*LNT – Use long table names
CM First Group. Confidential & Do Not Distribute 29
Change Model to use SQL Support.
YDDLDBA
specifies a method of accessing the database
Values
*RLA
External function generates with RLA access.
*SQL
External function generates with SQL access.
CM First Group. Confidential & Do Not Distribute 30
Change Model to use SQL Support.
YSQLLEN – The length of field names up to 25 characters.
Values
Any number between 10 and 25.
CM First Group. Confidential & Do Not Distribute 31
Change Model to use SQL Support.
YSQLFMT
Specifies whether the RCDFMT keyword must be generated for SQL tables,
views, and indexes.
Values
*YES
the RCDFMT value is calculated using the same rules as are used when
DDS files are generated.
*NO
the record format is the same as the table, index, or view name.
CM First Group. Confidential & Do Not Distribute 32
Change Model to use SQL Support.
YDBFGEN – Specifies the language used in creating the logical/view over a physical
file/table.
*DDS
*SQL
*DDL
CM First Group. Confidential & Do Not Distribute 33
Change Model to use SQL Support.
YDBFGEN – Specifies the language used in creating the logical/view over a physical
file/table.
*DDS
*SQL
*DDL
CM First Group. Confidential & Do Not Distribute 34
Change existing table to SQL.
Generating SQL files
Extended Names?
Generating SQL Functions?
Generating RLA Functions over SQL Files
CM First Group. Confidential & Do Not Distribute 35
Change existing table to SQL.
There are options to consider when modernizing a file
name to SQL in 2E.
Keep the file and field names the same.
Keep the file name the same, give the fields enhanced
names.
Change the file and fields to enhanced names.
CM First Group. Confidential & Do Not Distribute 36
SQL Record access in Functions
Functions can be changed through model values, or one at a
time to SQL access by the use of function options.
CM First Group. Confidential & Do Not Distribute 37
SQL Specific Data Types
Use BLOB data type of store binary data.
SQL Only Data Type! (No DDS Support)
BLOBs can be up to 2GB in size! YAY!
Created As Column In Table Definition.
Can Store ANY Binary Data (Files, Audio, Emails, .EXE
Files)
Cannot Be Modified Outside of Program. (NOT in IFS)
Takes Advantage of IBM i Security.
Automatic Replication to Target HA System.
CM First Group. Confidential & Do Not Distribute 38
Wrap Up
Questions? Comments?
Ad

Recommended

Sql server difference faqs- 6
Sql server difference faqs- 6
Umar Ali
 
Domains - Don't leave your data model without them
Domains - Don't leave your data model without them
Peter Heller
 
Intro to T-SQL - 1st session
Intro to T-SQL - 1st session
Medhat Dawoud
 
Sql ppt
Sql ppt
Roni Roy
 
T-SQL Overview
T-SQL Overview
Ahmed Elbaz
 
Handy annotations-within-oracle-10g
Handy annotations-within-oracle-10g
VESIT/University of Mumbai
 
What is SQL Server?
What is SQL Server?
CPD INDIA
 
Introduction to SQL
Introduction to SQL
Ram Kedem
 
Sql tutorial-Structured query language
Sql tutorial-Structured query language
Mayank Bansal
 
SQL202.1 Accelerated Introduction to SQL Using SQL Server Module 1
SQL202.1 Accelerated Introduction to SQL Using SQL Server Module 1
Dan D'Urso
 
Intro to T-SQL – 2nd session
Intro to T-SQL – 2nd session
Medhat Dawoud
 
Sql a practical introduction
Sql a practical introduction
Hasan Kata
 
Database Systems - Introduction to SQL (Chapter 3/1)
Database Systems - Introduction to SQL (Chapter 3/1)
Vidyasagar Mundroy
 
Sql server T-sql basics ppt-3
Sql server T-sql basics ppt-3
Vibrant Technologies & Computers
 
Xml Session No 1
Xml Session No 1
Saif Ullah Dar
 
Presentation slides of Sequence Query Language (SQL)
Presentation slides of Sequence Query Language (SQL)
Punjab University
 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql server
baabtra.com - No. 1 supplier of quality freshers
 
Sql 2009
Sql 2009
Cathie101
 
SQL and NoSQL in SQL Server
SQL and NoSQL in SQL Server
Michael Rys
 
Top 100 SQL Interview Questions and Answers
Top 100 SQL Interview Questions and Answers
iimjobs and hirist
 
Sql server
Sql server
Puja Gupta
 
SQL, Oracle, Joins
SQL, Oracle, Joins
Gaurish Goel
 
Glossary
Glossary
Facilitador Apoyo
 
SQL overview and software
SQL overview and software
Randy Riness @ South Puget Sound Community College
 
SQLPASS AD501-M XQuery MRys
SQLPASS AD501-M XQuery MRys
Michael Rys
 
Ms sql-server
Ms sql-server
Md.Mojibul Hoque
 
Oracle advanced queuing
Oracle advanced queuing
Gurpreet singh
 
Institución educativa fiscal andrés f córdoba
Institución educativa fiscal andrés f córdoba
Washo Jmc
 
Horton,Ciera__Poetics&Praise
Horton,Ciera__Poetics&Praise
Ciera Horton
 
WCEC's 7 Favourite things about Yorkshire
WCEC's 7 Favourite things about Yorkshire
Anna Kemp
 

More Related Content

What's hot (19)

Sql tutorial-Structured query language
Sql tutorial-Structured query language
Mayank Bansal
 
SQL202.1 Accelerated Introduction to SQL Using SQL Server Module 1
SQL202.1 Accelerated Introduction to SQL Using SQL Server Module 1
Dan D'Urso
 
Intro to T-SQL – 2nd session
Intro to T-SQL – 2nd session
Medhat Dawoud
 
Sql a practical introduction
Sql a practical introduction
Hasan Kata
 
Database Systems - Introduction to SQL (Chapter 3/1)
Database Systems - Introduction to SQL (Chapter 3/1)
Vidyasagar Mundroy
 
Sql server T-sql basics ppt-3
Sql server T-sql basics ppt-3
Vibrant Technologies & Computers
 
Xml Session No 1
Xml Session No 1
Saif Ullah Dar
 
Presentation slides of Sequence Query Language (SQL)
Presentation slides of Sequence Query Language (SQL)
Punjab University
 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql server
baabtra.com - No. 1 supplier of quality freshers
 
Sql 2009
Sql 2009
Cathie101
 
SQL and NoSQL in SQL Server
SQL and NoSQL in SQL Server
Michael Rys
 
Top 100 SQL Interview Questions and Answers
Top 100 SQL Interview Questions and Answers
iimjobs and hirist
 
Sql server
Sql server
Puja Gupta
 
SQL, Oracle, Joins
SQL, Oracle, Joins
Gaurish Goel
 
Glossary
Glossary
Facilitador Apoyo
 
SQL overview and software
SQL overview and software
Randy Riness @ South Puget Sound Community College
 
SQLPASS AD501-M XQuery MRys
SQLPASS AD501-M XQuery MRys
Michael Rys
 
Ms sql-server
Ms sql-server
Md.Mojibul Hoque
 
Oracle advanced queuing
Oracle advanced queuing
Gurpreet singh
 

Viewers also liked (15)

Institución educativa fiscal andrés f córdoba
Institución educativa fiscal andrés f córdoba
Washo Jmc
 
Horton,Ciera__Poetics&Praise
Horton,Ciera__Poetics&Praise
Ciera Horton
 
WCEC's 7 Favourite things about Yorkshire
WCEC's 7 Favourite things about Yorkshire
Anna Kemp
 
Adf results 2014
Adf results 2014
Fusly einrot
 
MauroCoppola_Presentazione
MauroCoppola_Presentazione
Mauro Coppola
 
NFS Trifold
NFS Trifold
June Melden
 
Goldilocks lucas p
Goldilocks lucas p
Lucas Palmer
 
CV Hamzah
CV Hamzah
Muhammad Hamzah S.E
 
GuidePédagogique-logicielMultimedia_ENGLISH
GuidePédagogique-logicielMultimedia_ENGLISH
Raquel Pollo Gonzalez
 
5 of WCEC's Favourite Retail Projects
5 of WCEC's Favourite Retail Projects
Anna Kemp
 
Silabo deontologia
Silabo deontologia
obfloresc
 
CV engleza actualizat
CV engleza actualizat
chioibasu cristina
 
Ada 1 agmh
Ada 1 agmh
H24SINIGUAL
 
Героїчний подвиг АВГУСТИ ПІВЕНЬ – вчительки-партизанки в роки Другої світово...
Героїчний подвиг АВГУСТИ ПІВЕНЬ – вчительки-партизанки в роки Другої світово...
painAlex
 
Mekesson Quarterly Reports 2008 1st
Mekesson Quarterly Reports 2008 1st
finance2
 
Institución educativa fiscal andrés f córdoba
Institución educativa fiscal andrés f córdoba
Washo Jmc
 
Horton,Ciera__Poetics&Praise
Horton,Ciera__Poetics&Praise
Ciera Horton
 
WCEC's 7 Favourite things about Yorkshire
WCEC's 7 Favourite things about Yorkshire
Anna Kemp
 
MauroCoppola_Presentazione
MauroCoppola_Presentazione
Mauro Coppola
 
Goldilocks lucas p
Goldilocks lucas p
Lucas Palmer
 
GuidePédagogique-logicielMultimedia_ENGLISH
GuidePédagogique-logicielMultimedia_ENGLISH
Raquel Pollo Gonzalez
 
5 of WCEC's Favourite Retail Projects
5 of WCEC's Favourite Retail Projects
Anna Kemp
 
Silabo deontologia
Silabo deontologia
obfloresc
 
Героїчний подвиг АВГУСТИ ПІВЕНЬ – вчительки-партизанки в роки Другої світово...
Героїчний подвиг АВГУСТИ ПІВЕНЬ – вчительки-партизанки в роки Другої світово...
painAlex
 
Mekesson Quarterly Reports 2008 1st
Mekesson Quarterly Reports 2008 1st
finance2
 
Ad

Similar to Jason Olson - IBM i DB2 Modernization to SQL (20)

System i - DDL vs DDS Presentation
System i - DDL vs DDS Presentation
Chuck Walker
 
DDL And DML
DDL And DML
pnp @in
 
introduction to SQL query language beginner.ppt
introduction to SQL query language beginner.ppt
PatriceRochon1
 
DDL and DML.pptx ddl vs dml ddl and dml ddl and dml
DDL and DML.pptx ddl vs dml ddl and dml ddl and dml
sadiariasat10
 
SQL Complete Tutorial. All Topics Covered
SQL Complete Tutorial. All Topics Covered
Danish Mehraj
 
SQL 3.pptx
SQL 3.pptx
Rishab Saini
 
DEE 431 Introduction to Mysql Slide 3
DEE 431 Introduction to Mysql Slide 3
YOGESH SINGH
 
Database Management Lab -SQL Queries
Database Management Lab -SQL Queries
shamim hossain
 
my sql
my sql
Ayush Pandey
 
CA_Plex_SupportForModernizingIBM_DB2_for_i
CA_Plex_SupportForModernizingIBM_DB2_for_i
George Jeffcock
 
SQL Server 2000 Research Series - Essential Knowledge
SQL Server 2000 Research Series - Essential Knowledge
Jerry Yang
 
S3 l3 db2 environment - instances
S3 l3 db2 environment - instances
Mohammad Khan
 
Structured query language
Structured query language
Rashid Ansari
 
Sq lite module5
Sq lite module5
Highervista
 
SQL/MED: Doping for PostgreSQL
SQL/MED: Doping for PostgreSQL
Peter Eisentraut
 
Intoduction to SQL Chapter 7 Lessons.ppt
Intoduction to SQL Chapter 7 Lessons.ppt
AdrianSanJuanCayao
 
DBMS Part-3.pptx
DBMS Part-3.pptx
Prof. Dr. K. Adisesha
 
PT- Oracle session01
PT- Oracle session01
Karthik Venkatachalam
 
Ddl vs dml
Ddl vs dml
shahbazalishahbaz
 
Sql tutorial
Sql tutorial
Rumman Ansari
 
System i - DDL vs DDS Presentation
System i - DDL vs DDS Presentation
Chuck Walker
 
DDL And DML
DDL And DML
pnp @in
 
introduction to SQL query language beginner.ppt
introduction to SQL query language beginner.ppt
PatriceRochon1
 
DDL and DML.pptx ddl vs dml ddl and dml ddl and dml
DDL and DML.pptx ddl vs dml ddl and dml ddl and dml
sadiariasat10
 
SQL Complete Tutorial. All Topics Covered
SQL Complete Tutorial. All Topics Covered
Danish Mehraj
 
DEE 431 Introduction to Mysql Slide 3
DEE 431 Introduction to Mysql Slide 3
YOGESH SINGH
 
Database Management Lab -SQL Queries
Database Management Lab -SQL Queries
shamim hossain
 
CA_Plex_SupportForModernizingIBM_DB2_for_i
CA_Plex_SupportForModernizingIBM_DB2_for_i
George Jeffcock
 
SQL Server 2000 Research Series - Essential Knowledge
SQL Server 2000 Research Series - Essential Knowledge
Jerry Yang
 
S3 l3 db2 environment - instances
S3 l3 db2 environment - instances
Mohammad Khan
 
Structured query language
Structured query language
Rashid Ansari
 
SQL/MED: Doping for PostgreSQL
SQL/MED: Doping for PostgreSQL
Peter Eisentraut
 
Intoduction to SQL Chapter 7 Lessons.ppt
Intoduction to SQL Chapter 7 Lessons.ppt
AdrianSanJuanCayao
 
Ad

More from John Zozzaro (11)

Steve Solomon - iCAthon 2016 and CA Plex 721 Final
Steve Solomon - iCAthon 2016 and CA Plex 721 Final
John Zozzaro
 
Rolf Stephan - Axon Ivy Intro
Rolf Stephan - Axon Ivy Intro
John Zozzaro
 
Mark Schroeder - Considering APIs?
Mark Schroeder - Considering APIs?
John Zozzaro
 
Marcel Pruegel - RESTful APIs & Automated Workflows
Marcel Pruegel - RESTful APIs & Automated Workflows
John Zozzaro
 
Marcel Pruegel - Building an Automated Process That Interacts With Different ...
Marcel Pruegel - Building an Automated Process That Interacts With Different ...
John Zozzaro
 
Kiyoshi Terasawa - Build Plex XAML UI – Advanced Training
Kiyoshi Terasawa - Build Plex XAML UI – Advanced Training
John Zozzaro
 
John Rhodes - CA Plex for CA 2E Shops
John Rhodes - CA Plex for CA 2E Shops
John Zozzaro
 
John Rhodes - DevOps Automated Testing
John Rhodes - DevOps Automated Testing
John Zozzaro
 
Jason Olson - Test What You've Built
Jason Olson - Test What You've Built
John Zozzaro
 
James Higginbotham - API Design
James Higginbotham - API Design
John Zozzaro
 
Andrew leggett & Abram Darnutzer - How to build CA Plex Web & mobile app
Andrew leggett & Abram Darnutzer - How to build CA Plex Web & mobile app
John Zozzaro
 
Steve Solomon - iCAthon 2016 and CA Plex 721 Final
Steve Solomon - iCAthon 2016 and CA Plex 721 Final
John Zozzaro
 
Rolf Stephan - Axon Ivy Intro
Rolf Stephan - Axon Ivy Intro
John Zozzaro
 
Mark Schroeder - Considering APIs?
Mark Schroeder - Considering APIs?
John Zozzaro
 
Marcel Pruegel - RESTful APIs & Automated Workflows
Marcel Pruegel - RESTful APIs & Automated Workflows
John Zozzaro
 
Marcel Pruegel - Building an Automated Process That Interacts With Different ...
Marcel Pruegel - Building an Automated Process That Interacts With Different ...
John Zozzaro
 
Kiyoshi Terasawa - Build Plex XAML UI – Advanced Training
Kiyoshi Terasawa - Build Plex XAML UI – Advanced Training
John Zozzaro
 
John Rhodes - CA Plex for CA 2E Shops
John Rhodes - CA Plex for CA 2E Shops
John Zozzaro
 
John Rhodes - DevOps Automated Testing
John Rhodes - DevOps Automated Testing
John Zozzaro
 
Jason Olson - Test What You've Built
Jason Olson - Test What You've Built
John Zozzaro
 
James Higginbotham - API Design
James Higginbotham - API Design
John Zozzaro
 
Andrew leggett & Abram Darnutzer - How to build CA Plex Web & mobile app
Andrew leggett & Abram Darnutzer - How to build CA Plex Web & mobile app
John Zozzaro
 

Recently uploaded (20)

FIDO Seminar: New Data: Passkey Adoption in the Workforce.pptx
FIDO Seminar: New Data: Passkey Adoption in the Workforce.pptx
FIDO Alliance
 
cnc-processing-centers-centateq-p-110-en.pdf
cnc-processing-centers-centateq-p-110-en.pdf
AmirStern2
 
10 Key Challenges for AI within the EU Data Protection Framework.pdf
10 Key Challenges for AI within the EU Data Protection Framework.pdf
Priyanka Aash
 
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
caoyixuan2019
 
Powering Multi-Page Web Applications Using Flow Apps and FME Data Streaming
Powering Multi-Page Web Applications Using Flow Apps and FME Data Streaming
Safe Software
 
"How to survive Black Friday: preparing e-commerce for a peak season", Yurii ...
"How to survive Black Friday: preparing e-commerce for a peak season", Yurii ...
Fwdays
 
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
pcprocore
 
Cyber Defense Matrix Workshop - RSA Conference
Cyber Defense Matrix Workshop - RSA Conference
Priyanka Aash
 
The Future of Technology: 2025-2125 by Saikat Basu.pdf
The Future of Technology: 2025-2125 by Saikat Basu.pdf
Saikat Basu
 
Connecting Data and Intelligence: The Role of FME in Machine Learning
Connecting Data and Intelligence: The Role of FME in Machine Learning
Safe Software
 
FIDO Seminar: Targeting Trust: The Future of Identity in the Workforce.pptx
FIDO Seminar: Targeting Trust: The Future of Identity in the Workforce.pptx
FIDO Alliance
 
AI vs Human Writing: Can You Tell the Difference?
AI vs Human Writing: Can You Tell the Difference?
Shashi Sathyanarayana, Ph.D
 
From Manual to Auto Searching- FME in the Driver's Seat
From Manual to Auto Searching- FME in the Driver's Seat
Safe Software
 
You are not excused! How to avoid security blind spots on the way to production
You are not excused! How to avoid security blind spots on the way to production
Michele Leroux Bustamante
 
MuleSoft for AgentForce : Topic Center and API Catalog
MuleSoft for AgentForce : Topic Center and API Catalog
shyamraj55
 
Techniques for Automatic Device Identification and Network Assignment.pdf
Techniques for Automatic Device Identification and Network Assignment.pdf
Priyanka Aash
 
AI VIDEO MAGAZINE - June 2025 - r/aivideo
AI VIDEO MAGAZINE - June 2025 - r/aivideo
1pcity Studios, Inc
 
OWASP Barcelona 2025 Threat Model Library
OWASP Barcelona 2025 Threat Model Library
PetraVukmirovic
 
FIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptx
FIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptx
FIDO Alliance
 
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik
 
FIDO Seminar: New Data: Passkey Adoption in the Workforce.pptx
FIDO Seminar: New Data: Passkey Adoption in the Workforce.pptx
FIDO Alliance
 
cnc-processing-centers-centateq-p-110-en.pdf
cnc-processing-centers-centateq-p-110-en.pdf
AmirStern2
 
10 Key Challenges for AI within the EU Data Protection Framework.pdf
10 Key Challenges for AI within the EU Data Protection Framework.pdf
Priyanka Aash
 
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
caoyixuan2019
 
Powering Multi-Page Web Applications Using Flow Apps and FME Data Streaming
Powering Multi-Page Web Applications Using Flow Apps and FME Data Streaming
Safe Software
 
"How to survive Black Friday: preparing e-commerce for a peak season", Yurii ...
"How to survive Black Friday: preparing e-commerce for a peak season", Yurii ...
Fwdays
 
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
pcprocore
 
Cyber Defense Matrix Workshop - RSA Conference
Cyber Defense Matrix Workshop - RSA Conference
Priyanka Aash
 
The Future of Technology: 2025-2125 by Saikat Basu.pdf
The Future of Technology: 2025-2125 by Saikat Basu.pdf
Saikat Basu
 
Connecting Data and Intelligence: The Role of FME in Machine Learning
Connecting Data and Intelligence: The Role of FME in Machine Learning
Safe Software
 
FIDO Seminar: Targeting Trust: The Future of Identity in the Workforce.pptx
FIDO Seminar: Targeting Trust: The Future of Identity in the Workforce.pptx
FIDO Alliance
 
AI vs Human Writing: Can You Tell the Difference?
AI vs Human Writing: Can You Tell the Difference?
Shashi Sathyanarayana, Ph.D
 
From Manual to Auto Searching- FME in the Driver's Seat
From Manual to Auto Searching- FME in the Driver's Seat
Safe Software
 
You are not excused! How to avoid security blind spots on the way to production
You are not excused! How to avoid security blind spots on the way to production
Michele Leroux Bustamante
 
MuleSoft for AgentForce : Topic Center and API Catalog
MuleSoft for AgentForce : Topic Center and API Catalog
shyamraj55
 
Techniques for Automatic Device Identification and Network Assignment.pdf
Techniques for Automatic Device Identification and Network Assignment.pdf
Priyanka Aash
 
AI VIDEO MAGAZINE - June 2025 - r/aivideo
AI VIDEO MAGAZINE - June 2025 - r/aivideo
1pcity Studios, Inc
 
OWASP Barcelona 2025 Threat Model Library
OWASP Barcelona 2025 Threat Model Library
PetraVukmirovic
 
FIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptx
FIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptx
FIDO Alliance
 
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik
 

Jason Olson - IBM i DB2 Modernization to SQL

  • 2. CM First Group. Confidential & Do Not Distribute 2 About Your Presenter IBM i Professional for 16 Years. Primary Focus is IBM i Engineering / Programming Well Versed in 2E. Well Versed in RPG (All Flavors) Well Versed in CM Products such as Implementer Up to Date on Newest SQL/RPG Enhancements.
  • 3. CM First Group. Confidential & Do Not Distribute 3 Agenda What Exactly is SQL (Just in case you don’t know. ) Benefits of Moving to SQL Created Objects SQL Performance Benefits SQL Objects vs DDS Objects SQL Source vs DDS Source Changing a 2E Model to Support SQL SQL Specific Data Types
  • 4. CM First Group. Confidential & Do Not Distribute 4 What Exactly is SQL? SQL Stands for Structured Query Language. Developed at IBM in the Early 1970s. Consists of a DDL (Data Definition Language) IE, CREATE TABLE, CREATE INDEX Consists of a DML (Data Manipulation Language) IE, INSERT INTO, UPDATE, DELETE, To a Large Extent Consists of Simple English Statements.
  • 5. CM First Group. Confidential & Do Not Distribute 5 Benefits of Moving to SQL Created Objects Whole World Uses SQL. New resources are more familiar with SQL then DDS. Long Field Names are Available to Outside World. YAY!  Performance (Further discussion later) Data is Validated when Written to the Database. DDL Defined Indexes use a 64K page size vs 8K used by Logical Files. Null Capable Fields. New Data Types (Blob, Clob, Lob) Demo of this!
  • 6. CM First Group. Confidential & Do Not Distribute 6 Benefits of Moving to SQL Created Objects No Enhancements to DDS Language. Constraints are Built into Database. Built in Encryption. Easier Modification of Table Layouts. RPG Programs that Use SQL Access Don’t Need a Re- compile. Automatic Identity Columns.
  • 7. CM First Group. Confidential & Do Not Distribute 7 SQL Performance In DDS Data is Validated When Read. In SQL Data is Validated When Written. This is Important as we Normally do many more reads vs. writes. Ratio could be as high as 25 to 1. Data Can Arrive up to 11 Seconds Faster. Especially Helpful When Loading up Subfiles from Random Keys. Concurrent Write Support. Logical Page Size of 64K.
  • 8. CM First Group. Confidential & Do Not Distribute 8 SQL Performance In DDS Data is Validated When Read. In SQL Data is Validated When Written. This is Important as we Normally do many more reads vs. writes. Ratio could be as high as 25 to 1. Data Can Arrive up to 11 Seconds Faster. Especially Helpful When Loading up Subfiles from Random Keys. Concurrent Write Support. Logical Page Size of 64K.
  • 9. CM First Group. Confidential & Do Not Distribute 9 SQL Objects vs DDS Objects DDS Objects Create Physical Files & Logical Files The Object types are *FILE PF and *FILE LF Most common source is DDS and stored in QDDSSRC. Source Member type is PF for Physical files, and LF for Logical Files. Compiled like a program using option 14 from PDM, or using the CRTPF or CRTLF commands. SQL Objects create Physical Files & Logical Files as well. The Object types are *FILE PF and *FILE LF Most common source is SQL and stored in QSQLSRC. Source Member type can be named anything.
  • 10. CM First Group. Confidential & Do Not Distribute 10 SQL Objects vs DDS Objects DSPFD
  • 11. CM First Group. Confidential & Do Not Distribute 11 SQL Objects vs DDS Objects DSPFD
  • 12. CM First Group. Confidential & Do Not Distribute 12 SQL Source vs DDS Source DDS Source is stored in source physical file QDDSSRC (Most Common) Source is then compiled using CRTPF or CRTLF commands. (Option 14 in PDM)
  • 13. CM First Group. Confidential & Do Not Distribute 13 SQL Source vs DDS Source SQL Source is stored in source file QSQLSRC (Most Common) Source member type can be named anything. However, common examples are SQLT for tables, SQLV for views and SQLI for indexes. SQL Objects are created using the RUNSQLSTM command.
  • 14. CM First Group. Confidential & Do Not Distribute 14 SQL Source vs DDS Source Example SQL Table Source.
  • 15. CM First Group. Confidential & Do Not Distribute 15 SQL Source vs DDS Source Example SQL Table Source.
  • 16. CM First Group. Confidential & Do Not Distribute 16 SQL Source vs DDS Source Example SQL View Source.
  • 17. CM First Group. Confidential & Do Not Distribute 17 SQL Source vs DDS Source Example SQL View Source.
  • 18. CM First Group. Confidential & Do Not Distribute 18 SQL Source vs DDS Source Example SQL Index Source.
  • 19. CM First Group. Confidential & Do Not Distribute 19 SQL Source vs DDS Source Items to Note! SQL objects are created using the RUNSQLSTM Command. SQL View And Indexes produce separate IBM i Objects. (LFs) No problem combining SQL Created tables and DDS Created LFs. (Common)
  • 20. CM First Group. Confidential & Do Not Distribute 20 DML (Data Manipulation Language) DML is used to manipulate the database. Examples are, SELECT ( to read data ) INSERT ( to insert data ) UPDATE (to update data) DELETE (to delete data) Big advantage is the use of the DB2 Database Engine for automatic index selection! If an index exists that matches the search criteria then that index will be used automatically. In standard record level access from RPG this is not the case. SQL DML Statements can be incorporated directly into an RPG program! There is no longer a need to use the traditional record level access provided by RPG.
  • 21. CM First Group. Confidential & Do Not Distribute 21 DML (Data Manipulation Language) Select (Statement Example)
  • 22. CM First Group. Confidential & Do Not Distribute 22 DML (Data Manipulation Language) Select (Statement Example)
  • 23. CM First Group. Confidential & Do Not Distribute 23 DML (Data Manipulation Language) INSERT (Statement Example)
  • 24. CM First Group. Confidential & Do Not Distribute 24 DML (Data Manipulation Language) UPDATE (Statement Example) Can update multiple records at once!
  • 25. CM First Group. Confidential & Do Not Distribute 25 DML (Data Manipulation Language) DELETE (Statement Example) Can delete multiple records at once!
  • 26. CM First Group. Confidential & Do Not Distribute 26 Change Model to use SQL Support. Several different approaches can be taken to change a model to support SQL. You can change the model to use the 2E generated table name, but use longer field name support. This allows you to expose the longer field names to the outside world. No change to RPG. You can change the model to use both the longer table name, and also the longer field names. Again, easier for the outside world. No change to RPG. You can change the generated function to use SQL record level access regardless of the database type.
  • 27. CM First Group. Confidential & Do Not Distribute 27 Change Model to use SQL Support. Any change to support SQL is done though the changing of model values. Name Description Values YSQLVNM SQL naming *DDS YDDLDBA Database Access Method *RLA / *SQL YSQLLEN SQL naming length 10 to 25 YSQLOPT Generate SQL OPTIMIZE clause *NO YSQLFMT Generate SQL RCDFMT clause *NO YSQLSTM SQL statement generation type *EXC YSQLCOL Generate SQL Col/Library Name *YES YLVLCHK Generate IDX with LVLCHK(*YES) *NO YDBFGEN Method for database file generation DDS / SQL / DDL YSQLWHR specifies whether to use OR or NOT logic when generating SQL WHERE clauses. The default is *OR. YSQLLCK
  • 28. CM First Group. Confidential & Do Not Distribute 28 Change Model to use SQL Support. YSQLVNM relates to the naming scheme used for fields and files. Values *DDS – Uses the DDS name *SQL – Use the names of the objects in the model. *LNG – Use long names for fields and files *LNF – Use long field names *LNT – Use long table names
  • 29. CM First Group. Confidential & Do Not Distribute 29 Change Model to use SQL Support. YDDLDBA specifies a method of accessing the database Values *RLA External function generates with RLA access. *SQL External function generates with SQL access.
  • 30. CM First Group. Confidential & Do Not Distribute 30 Change Model to use SQL Support. YSQLLEN – The length of field names up to 25 characters. Values Any number between 10 and 25.
  • 31. CM First Group. Confidential & Do Not Distribute 31 Change Model to use SQL Support. YSQLFMT Specifies whether the RCDFMT keyword must be generated for SQL tables, views, and indexes. Values *YES the RCDFMT value is calculated using the same rules as are used when DDS files are generated. *NO the record format is the same as the table, index, or view name.
  • 32. CM First Group. Confidential & Do Not Distribute 32 Change Model to use SQL Support. YDBFGEN – Specifies the language used in creating the logical/view over a physical file/table. *DDS *SQL *DDL
  • 33. CM First Group. Confidential & Do Not Distribute 33 Change Model to use SQL Support. YDBFGEN – Specifies the language used in creating the logical/view over a physical file/table. *DDS *SQL *DDL
  • 34. CM First Group. Confidential & Do Not Distribute 34 Change existing table to SQL. Generating SQL files Extended Names? Generating SQL Functions? Generating RLA Functions over SQL Files
  • 35. CM First Group. Confidential & Do Not Distribute 35 Change existing table to SQL. There are options to consider when modernizing a file name to SQL in 2E. Keep the file and field names the same. Keep the file name the same, give the fields enhanced names. Change the file and fields to enhanced names.
  • 36. CM First Group. Confidential & Do Not Distribute 36 SQL Record access in Functions Functions can be changed through model values, or one at a time to SQL access by the use of function options.
  • 37. CM First Group. Confidential & Do Not Distribute 37 SQL Specific Data Types Use BLOB data type of store binary data. SQL Only Data Type! (No DDS Support) BLOBs can be up to 2GB in size! YAY! Created As Column In Table Definition. Can Store ANY Binary Data (Files, Audio, Emails, .EXE Files) Cannot Be Modified Outside of Program. (NOT in IFS) Takes Advantage of IBM i Security. Automatic Replication to Target HA System.
  • 38. CM First Group. Confidential & Do Not Distribute 38 Wrap Up Questions? Comments?