MC Systems Insight
MC Power Technology Manager
MC RPG Developer
MC Power Developer
MC TNT Tips 'n Techniques
MC AIX Expert
MC Linux Expert
MC Mobile on Power
This Week @ the MC Press Bookstore

February 20, 2013 | Volume 12 Issue 4


TOP STORY: Enhance Your SQL Queries with User-Defined Table Functions
FEATURED ARTICLE: The API Corner: Diagnosing Decimal Data Errors
NEWS HIGHLIGHT: inFORM Decisions to Feature at IBM PureSystems and IBM i Enterprise Modernization Events
FORUM: CPYTOIMPF - Text Delimited?
EVENT: ASNA Visual RPG for .NET Windows 5-Day Beginning/Intermediate Class
Manage Subscription | Contact Us

Feature Article - Programming
Enhance Your SQL Queries with User-Defined Table Functions

Simplify your SQL SELECT statements, provide an interface to pass parameters to create dynamic tables, automatically log access to tables, and create a single point of maintenance for the SQL code you use repeatedly.

jim statonWritten by Jim Staton

In my previous article, "Reuse Your RPG Code with SQL User-Defined Functions," I discussed how you could reuse RPG business logic in SQL by taking an RPG program or service program that returns a single value and then using the SQL CREATE FUNCTION command to make the business logic available to any high-level language (HLL), such as PHP or Java, or any tool that uses SQL to access data on your system. There are times, however, when you might want a function that returns not just a single value but a set of values or even a table. In that case, you could consider using a User-Defined Table Function (UDTF).


Feature Article - Programming
The API Corner: Diagnosing Decimal Data Errors

Consider the advantages of the Convert Hex to Character (cvthc) API.

bruce viningWritten by Bruce Vining

In developing a general-purpose utility to detect decimal data errors, we have made use of a few APIs. In the article "In Search of Decimal Data Errors," we saw how the List Fields (QUSLFLD) API can be used to find all numeric fields, within a user-specified file record format, that are defined as either zoned decimal or packed decimal. In addition to discovering the data type of each field, we were also able to determine the name of the field, the number of decimal positions, the number of digits to the right of the decimal point, the number of bytes used to store the field value, and the starting location of the field within the record format.


In the News

Support MC Press - Visit Our Sponsors

Forums Sponsor



Search Sponsor



  Bookstore Sidebar Header