0% found this document useful (0 votes)
33 views30 pages

RPGLE As A Web Service Liam Allan

RPGLE Web Service
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views30 pages

RPGLE As A Web Service Liam Allan

RPGLE Web Service
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 30

RPGLE as a web

service Let’s
Create
Using SQL to create basic services

Liam Barry Allan


Let’s
Create

Agenda

• Ways for RPG/ILE to return data


• Capturing that data with SQL
• Turning that into a web service by using PHP, Node.js, Python, etc

Node.js
PHP SQL IBM i
Python

© Copyright IBM Corporation 2022


Let’s
Create

Returning data
from RPG

Return value
Output parameters SQL result set
(Exported procedures)

© Copyright IBM Corporation 2022


Let’s
Create

Procedure
output
parameters

© Copyright IBM Corporation 2022


Let’s
Create

Function
return value

© Copyright IBM Corporation 2022


Let’s
Create

Program
result set

© Copyright IBM Corporation 2022


Let’s
Create

Pros and cons

© Copyright IBM Corporation 2022


Let’s
Create

Procedure with output parameter


Pros & cons

Database drivers may


Can have many output parameters
not like output parameters

© Copyright IBM Corporation 2022


Let’s
Create

Function return value


Pros & cons

Great for embedding into


Can only have one output type
existing SQL statements

© Copyright IBM Corporation 2022


Let’s
Create

Procedure result sets


Pros & cons

Might choose to write in


Can return many rows
RPG instead of SQL/PL

© Copyright IBM Corporation 2022


Let’s
Create

Procedure output parameters User de ned function Procedure Result Set

© Copyright IBM Corporation 2022


fi
Let’s
Create

Examples

© Copyright IBM Corporation 2022


Let’s
Create

Salary sum
RPGLE function

© Copyright IBM Corporation 2022


Let’s
Create

Salary sum
SQL statement

© Copyright IBM Corporation 2022


Let’s
Create

Salary sum
SQL function

© Copyright IBM Corporation 2022


Let’s
Create

Employees
Display le

© Copyright IBM Corporation 2022


fi
Let’s
Create

Employees
Display le
conversion (1)

© Copyright IBM Corporation 2022


fi
Let’s
Create

Employees
Display le
conversion (2)

© Copyright IBM Corporation 2022


fi
Let’s
Create

Employees
Result set

© Copyright IBM Corporation 2022


Let’s
Create

Employees
Result set
comparison

© Copyright IBM Corporation 2022


Let’s
Create

Employees
Result set
from SQL procedure

© Copyright IBM Corporation 2022


Let’s
Create

Using the Data

© Copyright IBM Corporation 2022


Let’s
Create

© Copyright IBM Corporation 2022


Let’s
Create

Mapping the routes

/salary/a GetSalarySum()

/salary/b GetSalarySum2()

/depts/a DEPTS (*PGM)

/depts/b GetDepartments()

© Copyright IBM Corporation 2022


Let’s
Create

Tech choice

© Copyright IBM Corporation 2022


Let’s
Create

Node.js
Modules used

Express ODBC

© Copyright IBM Corporation 2022


IBM TLS
(Technology Lifecycle Services)
http://ibm.biz/ibmi-oss-support
Let’s
Create

Demo

© Copyright IBM Corporation 2022


Let’s

Special notices
Create

This document was developed for IBM offerings in the United States as of the date of publication. IBM may not make these offerings available in other
countries, and the information is subject to change without notice. Consult your local IBM business contact for information on the IBM offerings available in your
area.
Information in this document concerning non-IBM products was obtained from the suppliers of these products or other public sources. Questions on the
capabilities of non-IBM products should be addressed to the suppliers of those products.
IBM may have patents or pending patent applications covering subject matter in this document. The furnishing of this document does not give you any license
to these patents. Send license inquires, in writing, to IBM Director of Licensing, IBM Corporation, New Castle Drive, Armonk, NY 10504-1785 USA.
All statements regarding IBM future direction and intent are subject to change or withdrawal without notice, and represent goals and objectives only.
The information contained in this document has not been submitted to any formal IBM test and is provided "AS IS" with no warranties or guarantees either
expressed or implied.
All examples cited or described in this document are presented as illustrations of the manner in which some IBM products can be used and the results that
may be achieved. Actual environmental costs and performance characteristics will vary depending on individual client configurations and conditions.
IBM Global Financing offerings are provided through IBM Credit Corporation in the United States and other IBM subsidiaries and divisions worldwide to
qualified commercial and government clients. Rates are based on a client's credit rating, financing terms, offering type, equipment type and options, and may
vary by country. Other restrictions may apply. Rates and offerings are subject to change, extension or withdrawal without notice.
IBM is not responsible for printing errors in this document that result in pricing or information inaccuracies.
All prices shown are IBM's United States suggested list prices and are subject to change without notice; reseller prices may vary.
IBM hardware products are manufactured from new parts, or new and serviceable used parts. Regardless, our warranty terms apply.
Any performance data contained in this document was determined in a controlled environment. Actual results may vary significantly and are dependent on
many factors including system hardware configuration and software design and configuration. Some measurements quoted in this document may have been
made on development-level systems. There is no guarantee these measurements will be the same on generally-available systems. Some measurements
quoted in this document may have been estimated through extrapolation. Users of this document should verify the applicable data for their specific
environment.

© Copyright IBM Corporation 2022


Let’s

Special notices (cont.)


Create

IBM, the IBM logo, ibm.com AIX, AIX (logo), AIX 5L, AIX 6 (logo), AS/400, BladeCenter, Blue Gene, ClusterProven, Db2, ESCON, i5/OS, i5/OS (logo), IBM Business Partner (logo), IntelliStation,
LoadLeveler, Lotus, Lotus Notes, Notes, Operating System/400, OS/400, PartnerLink, PartnerWorld, PowerPC, pSeries, Rational, RISC System/6000, RS/6000, THINK, Tivoli, Tivoli (logo), Tivoli
Management Environment, WebSphere, xSeries, z/OS, zSeries, Active Memory, Balanced Warehouse, CacheFlow, Cool Blue, IBM Systems Director VMControl, pureScale, TurboCore, Chiphopper,
Cloudscape, Db2 Universal Database, DS4000, DS6000, DS8000, EnergyScale, Enterprise Workload Manager, General Parallel File System, , GPFS, HACMP, HACMP/6000, HASM, IBM Systems
Director Active Energy Manager, iSeries, Micro-Partitioning, POWER, PowerExecutive, PowerVM, PowerVM (logo), PowerHA, Power Architecture, Power Everywhere, Power Family, POWER Hypervisor,
Power Systems, Power Systems (logo), Power Systems Software, Power Systems Software (logo), POWER2, POWER3, POWER4, POWER4+, POWER5, POWER5+, POWER6, POWER6+, POWER7,
System i, System p, System p5, System Storage, System z, TME 10, Workload Partitions Manager and X-Architecture are trademarks or registered trademarks of International Business Machines
Corporation in the United States, other countries, or both. If these and other IBM trademarked terms are marked on their first occurrence in this information with a trademark symbol (® or ™), these
symbols indicate U.S. registered or common law trademarks owned by IBM at the time this information was published. Such trademarks may also be registered or common law trademarks in other
countries.

A full list of U.S. trademarks owned by IBM may be found at: http://www.ibm.com/legal/copytrade.shtml.

Adobe, the Adobe logo, PostScript, and the PostScript logo are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States, and/or other countries.
AltiVec is a trademark of Freescale Semiconductor, Inc.
AMD Opteron is a trademark of Advanced Micro Devices, Inc.
InfiniBand, InfiniBand Trade Association and the InfiniBand design marks are trademarks and/or service marks of the InfiniBand Trade Association.
Intel, Intel logo, Intel Inside, Intel Inside logo, Intel Centrino, Intel Centrino logo, Celeron, Intel Xeon, Intel SpeedStep, Itanium, and Pentium are trademarks or registered trademarks of Intel Corporation or
its subsidiaries in the United States and other countries.
IT Infrastructure Library is a registered trademark of the Central Computer and Telecommunications Agency which is now part of the Office of Government Commerce.
Java and all Java-based trademarks and logos are trademarks or registered trademarks of Oracle and/or its affiliates.
Linear Tape-Open, LTO, the LTO Logo, Ultrium, and the Ultrium logo are trademarks of HP, IBM Corp. and Quantum in the U.S. and other countries.
Linux is a registered trademark of Linus Torvalds in the United States, other countries or both.
Microsoft, Windows and the Windows logo are registered trademarks of Microsoft Corporation in the United States, other countries or both.
NetBench is a registered trademark of Ziff Davis Media in the United States, other countries or both.
SPECint, SPECfp, SPECjbb, SPECweb, SPECjAppServer, SPEC OMP, SPECviewperf, SPECapc, SPEChpc, SPECjvm, SPECmail, SPECimap and SPECsfs are trademarks of the Standard Performance
Evaluation Corp (SPEC).
The Power Architecture and Power.org wordmarks and the Power and Power.org logos and related marks are trademarks and service marks licensed by Power.org.
TPC-C and TPC-H are trademarks of the Transaction Performance Processing Council (TPPC).
UNIX is a registered trademark of The Open Group in the United States, other countries or both.

Other company, product and service names may be trademarks or service marks of others.

© Copyright IBM Corporation 2022

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy