Tag Archives for " #SQLRPGLE "

Mar 04

How to read a Data Area (*DTAARA) using IBM i SQL

Our first problem is, SQL doesn’t know what a *DTAARA is. SQL reads data from Tables but our gloriously quirky IBM i Box has other places to secretly store data. Data Areas are just one of these tricky little blocks of data that other machines don’t know about – think of them as a single […]

More Waffle
Jun 13

Simple email validation SQL RPG ILE program

There are lots of code snippets, example programs and long waffling discussions in internet land filled with pointy headed AS400, iSeries and IBM i programmer chaps (and chappettes) arguing about the best way to “validate an email address in RPG”. I know because I’ve read nearly all of them, as well as tried all the […]

More Waffle
Aug 17

Scan Replace in RPGLE and SQLRPGLE

In the middle of this RPG program, I want to reformat and replace some values in a big long address field. But for the life of me… I cant remember how to use the SCANREPLACE built in function in RPG. #Dingbat¬†/me memory circuits need a service methinks. So, like all programmers, I wonder off to […]

More Waffle
Aug 01

Use substring in RPGLE SQL Statements

So, I had to make a little change to an RPG4 program to let it respond to a new parameter being passed into it via JSON. This value had to be stored in the first character of a field in a physical file in the database. Simple Logic and we want it done quick, efficient, […]

More Waffle
Jul 09

Replace IBM i Native File Access with SQL

I found this excellent article by Birgitta Hauser, Software and Database Engineer, Toolmaker Advanced Efficiency GmbH. It covers the basic concepts you will need to consider if you want to “Replace IBM i Native File Access with SQL” Just in case it vanishes I’m going to reproduce it here: If you are considering SQL and […]

More Waffle
Jun 17

sqlrpgle select into extname using freeform

AKA – Why does this compile fail using SQLRPGLE and QUALIFIED data structures? Sometimes I find a problem and scratch my head and just cannot figure it out. I swear a lot. Then I discover the solution by climbing out of my little box, turning my head at a funny angle, squinting and thinking a […]

More Waffle
Dec 14

Adopting Authority – Problems with SQL RPG Programs

RPG PROGRAM USER(*OWNER) – Adopts the object owner level of Authority Most IBM i Programmers are aware of the USER(*OWNER) compile setting — anyone calling this program will adopt the authority level of the program. So if a program is compiled by user QSECOFR and USER(*OWNER) then anyone calling that program will automatically be elevated […]

More Waffle
Aug 31

Speeding up SQLRPGLE using indexes instead of logicals

SQL is a wonderful beast for quickly getting data from huge tables (aka Files). The trouble with SQL is that it’s so very simple to use; programmers get lazy and sometimes forget to do the analysis to make it as simple and #FAST as possible! It’s easy to overlook performance tuning because SQL goes out […]

More Waffle
Jun 17

Getting a count with SQLRPGLE Variable File Name

Been having fun with SQL and RPGLE this afternoon… the question was “how do I find out if and how many Policy numbers exist in one of the Policy files at any given time?” So, this meant using a variable file name in the RPG code, with a variable policy number. Took some playing around […]

More Waffle