IBM i SQL Stored Procedure : Check if Rows exist in Table To check if there are rows in a table within an IBM i SQL stored procedure, you can use the EXISTS or NOT EXISTS condition in an IF statement. Here’s an example of how you might structure your stored procedure to perform this

Read More

IBM i SQL Stored Procedures: Case When In SQL, the CASE statement is often used within stored procedures to handle conditional logic. It’s similar to the if-else logic found in other programming languages. Here’s a basic example of how you might use a simple CASE statement within an IBM i stored procedure: In this example,

Read More

Object size management is crucial on IBM i systems for several reasons: By regularly monitoring and managing object sizes, you can ensure that your IBM-i System runs smoothly and efficiently, providing reliable service to your organization. Want to find LARGE Objects on your IBM i System? To find large objects on an IBM i system

Read More

We are always trying to find the large libraries on the machine! Hunting down the big libraries in an IBM i system (the artist formerly known as AS/400 or iSeries) is a quest with several critical motives: Diving into the vast ocean of libraries in your IBM i system with a proactive snorkel can unearth

Read More

Going for the Guinness Book of Records for vague blog titles I decided to waffle about inner joins and outer joins in the world of bellybuttons *cough* Structured Query Language. Since plagiarism is the best form of flattery, Chirag Sharma (over at Guru99) wrote a very nice article about the finer points of SQL INNER

Read More

Only Numpty Programmers hardcode library names #internetfact One of the mumbling, drooling, gray haired programmers on my team asked me to peer review his code this morning. This was for a simple SQL table to be created and promoted through multiple environments using TURNOVER. The code looked something like this: CREATE TABLE MYLIB/TESTSQL ( TSTFLD

Read More

IBM i Data Obfuscation – Making Data Foggy Murky and Squinty A little while ago, I wrote a data obfuscation tool – which I decided to call Data Fogging. This is specifically to solve the data privacy problems that we face when we want to suck down real data from production environments to our development

Read More

I found this wonderful article over at Midrange Blog It does exactly what I am trying to do: Lets me encrypt a certain field (column) in a table so that its encrypted as its added and updated. It also lets me automatically decrypt it when I read the record back (the only caveat is that

Read More

I recently updated the blog to use the very impressive THRIVE THEME called PRESSIVE. I love the SHOW IMAGE IN TITLE function on the blog pages. 90% of my blogs have a unique header image and I would like to go back and upate all (1k+) blogs to set this flag by default. Is there

Read More

IBM i SQL – Using SUBST A while ago I had a problem where I wanted to change the first two characters in a table and I used the very simple concat and subst operations to do it with SQL. Today, we had a slightly more complex requirement of updating text in the middle of

Read More

Using SQLRPGLE to Validate email addresses in IBM i Following on from my previous blog (basic email validation) I decided that it would much nicer to (a) have the regex stored in a data area so that we can easily play with it to try different validation scenarios and (b) lets have a shot at

Read More

AS400 hundred year date format I had to pull records from two files with a matching date value in each file. To make things interesting, the date on one file was stored in timestamp format and the date field in the other file was stored in hundred year date format. SQL (and QUERY400) can very

Read More