Skip to content

Instantly share code, notes, and snippets.

View NielsLiisberg's full-sized avatar

Niels Liisberg NielsLiisberg

View GitHub Profile
@NielsLiisberg
NielsLiisberg / system_name.sql
Created June 22, 2022 15:55
SQL Retrieve system name by MI call
-- Retrieve the system name by call to MI
-- This also showcase how to integrate the C code directly into your UDTF
--
-- Simply paste this gist into ACS SQL and step through the example.
--
-- It is a cool example how far you can go with SQL: Have fun 😀
-- (C) Niels Liisberg 2022
--
-- This gist is distributed on an "as is" basis, without warranties
-- or conditions of any kind, either express or implied.
@NielsLiisberg
NielsLiisberg / enable_netserver_user.sql
Last active June 29, 2022 08:17
SQL re-enable net user
-- Enable netserver user
-- This also showcase how to integrate the C code directly into your UDTF
--
-- Simply paste this gist into ACS SQL and step through the example.
--
-- It is a cool example how far you can go with SQL: Have fun 😀
-- (C) Niels Liisberg 2022
--
-- This gist is distributed on an "as is" basis, without warranties
-- or conditions of any kind, either express or implied.
-- convert BLOB to a bsae64 CLOB in UTF-8
-- This also showcase how to integrate the C code directly into your UDTF
--
-- Simply paste this gist into ACS SQL and step through the example.
--
-- It is a cool example how far you can go with SQL: Have fun 😀
-- (C) Niels Liisberg 2022
--
-- This gist is distributed on an "as is" basis, without warranties
-- or conditions of any kind, either express or implied.
@NielsLiisberg
NielsLiisberg / service_program_procedure_exports.sql
Created September 29, 2022 16:08
service program procedure exports
-- List service program procedure exports
--
-- Simply paste this gist into ACS SQL and step through the example.
--
-- It is a cool example how far you can go with SQL: Have fun 😀
-- (C) Niels Liisberg 2022
--
-- This gist is distributed on an "as is" basis, without warranties
-- or conditions of any kind, either expressed or implied.
----------------------------------------------------------------------------------------------
@NielsLiisberg
NielsLiisberg / days_in_year.sql
Created October 5, 2022 12:16
SQL: Returns a list of all dates in a given year
-- Returns a list of all dates in a given year
--
-- Note: I am using library QUSRSYS. I suggest you put it into your own tool library
--
-- Simply paste this gist into ACS SQL and step through the example.
--
-- It is a cool example how far you can go with SQL: Have fun 😀
-- (C) Niels Liisberg 2022
--
-- This gist is distributed on an "as is" basis, without warranties
@NielsLiisberg
NielsLiisberg / counter.sql
Last active October 5, 2022 14:14
SQL: counter
-- Returns a list numbers:
-- from and including FROM value
-- until and including TO value
-- and optional STEP can be either positive or negative. Default to +1 for step up and -1 for step down
--
-- Note: I am using library QUSRSYS. I suggest you put it into your own tool library
--
-- Simply paste this gist into ACS SQL and step through the example.
--
-- It is a cool example how far you can go with SQL: Have fun 😀
@NielsLiisberg
NielsLiisberg / to_num.sql
Last active January 1, 2024 10:07
TO_NUM is the TO_NUMBER in a lax and european version
-- Convert text to decimal number for europeans where decimal point is a comma
--
-- This also showcase how to integrate the C code directly into your UDTF
--
-- Simply paste this gist into ACS SQL and step through the example.
--
-- Note: I am using the library QUSRSYS. I suggest you put it into your own tool library
--
-- It is a cool example how far you can go with SQL: Have fun 😀
-- (C) Niels Liisberg 2022
@NielsLiisberg
NielsLiisberg / dspdbr
Last active August 16, 2023 14:53
List database relations with keys for files/tables
-- Returns database relations with keys
-- for SQL tables, the name is convert to the physical filename first.
-- Simply paste this gist into ACS SQL and run it to create the UDTF.
-- Note: I am using library QUSRSYS. I suggest you put it into your own tool library
-- It is a cool example how far you can go with SQL: Have fun -
-- (C) Niels Liisberg 2023
@NielsLiisberg
NielsLiisberg / capitalize.sql
Last active September 1, 2023 09:18
UDTF to return a capitalize first letter in each word of a string
-- UDTF to return a capitalize first letter in each word of a string
-- Simply paste this gist into ACS SQL and run it to create the UDTF.
-- Note: I am using library QUSRSYS. I suggest you put it into your own tool library
-- It is a cool example how far you can go with SQL: Have fun -
-- (C) Niels Liisberg 2023
@NielsLiisberg
NielsLiisberg / ifs_delete_file.sql
Created October 11, 2023 12:05
SQL - Delete (unlink) a IFS file
-- SQL Scalar function to delete ( unlink) a IFS files
-- this is a wrapper for unlink (delete IFS files) system / unix API
-- Simply paste this gist into ACS SQL and run it to create the UDTF.
-- Note: I am using library QUSRSYS. I suggest you put it into your own tool library
-- It is a cool example how far you can go with SQL: Have fun -
-- (C) Niels Liisberg 2023