Skip to content

Instantly share code, notes, and snippets.

View sriedmue79's full-sized avatar

Steve Riedmueller sriedmue79

View GitHub Profile
@forstie
forstie / frca_info.sql
Created February 7, 2024 12:01
The path to achieving improved security on IBM i is sometimes a winding road. SQL can help to get you there on time. In this installment, FRCA is raised from obscurity to something understandable. #SQLcandoit,
--
-- Subject: HTTP Servers and FRCA
-- Author: Scott Forstie
-- Date : February, 2024
-- Features Used : This Gist uses SQL PL, qsys2.object_statistics, qsys2.syspartitionstat,
-- SQL aliases, SQL built-in functions, UDTF, qsys2.ifs_read, and pipe
--
-- HTTP Server configuration detail resides in the IFS.
-- The HTTP Server instance file (QUSRSYS/QATMHINSTC *FILE)
-- points to the IFS path to use for each specific server.
@forstie
forstie / Data validation of a string.sql
Created July 14, 2020 18:26
In a classic two-for-Tuesday move, another string based and built-in function solved question has come in.
--
-- Author: Scott Forstie
-- Date : July 14, 2020
--
-- Question: How can I use SQL to validate that a string only contains an approved list of characters?
-- Answer : The TRANSLATE() built-in function.
--
-- TRANSLATE replaces the allowed characters with blanks.
-- Then, RTRIM throws all the blanks away.
-- Then, if the resulting LENGTH is zero, you can conclude that the string only contained allowed characters.