Loading…
Attending this event?
THE BEST IBM i & POWER SYSTEMS EDUCATION.When you come to POWERUp, you’ll be able to customize your experience. Choose from 300 sessions, covering over 20 areas of IT, when you plan your schedule. Visit the largest Expo of its kind and meet the experts behind the solutions. Attend social events to meet renowned speakers and peers alike. This conference is structured to give you the pure education and professional connections needed to best enhance your career. Are you ready to POWERUp?

Exhibitor Hall: https://www.expocad.com/host/fx/common/s24/exfx.html

Exhibitor Hall Map Here 
Thursday, May 23 • 9:15am - 10:15am
242: Fun with JSON Publishing: Letting SQL Do the Dirty Work

Sign up or log in to save this to your schedule, view media, leave feedback and see who's attending!

If you've ever been tasked as a developer with creating complex responses for an internal or external web service, you've likely explored multiple avenues for generating JSON from your IBM i programs. From constructing responses manually in your RPG code, to using various publicly available toolkits like YAJL, RPG NextGen, etc., there are a myriad of ways to create JSON strings with all the requisite curlies, commas, colons, quotes and hard brackets.

If you're on IBM i OS 7.2 or higher, there's yet another avenue you can explore in which you let SQL do the JSON construction work for you. The biggest benefit of this approach becomes most apparent when your JSON response requires arrays, and especially nested subarrays. Coding such responses can be a bit tedious when done on a record-by-record basis in your program, whereas by using some nifty functions you can can let SQL assemble your JSON response automatically.

In this session we'll review the basics of JSON publishing functions such as JSON_Object, JSON_Array, JSON_ObjectAgg and JSON_ArrayAgg. We'll explore some practical use examples for publishing your business data in JSON, letting SQL do all the dirty work.

Learning Objectives:
1. Learn the syntax of the most commonly used SQL JSON publishing functions
2. Understand the differences between a standard SQL select statement and an SQL statement constructing a JSON response
3. See how to integrate these SQL functions into an RPG program

Speakers
avatar for Robert Swanson

Robert Swanson

Senior Partner, CNX Corporation
Rob has worked as an in-the-trenches IBM i developer since 1992, with the past 15 years focused on developing modernization efforts for legacy systems written in RPG. Currently serving as Senior Partner for CNX Corporation in Chicago, Rob is a strong advocate of introducing highly... Read More →


Thursday May 23, 2024 9:15am - 10:15am CDT
Meeting Room 201C 1508 Houston St, Fort Worth, TX 76102
  Database
  • Session Level Intermediate
  • Digital Badge SQL
  • Audience Developers looking to create intricate JSON responses for web services or various JavaScript frameworks.