Skip to content

Instantly share code, notes, and snippets.

@forstie
Last active November 5, 2019 12:56
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save forstie/866025cbee676b2af1d757f260c05582 to your computer and use it in GitHub Desktop.
Save forstie/866025cbee676b2af1d757f260c05582 to your computer and use it in GitHub Desktop.
Locate reusable pieces of SQL code into the IFS. Then, use INCLUDE to pull those segments into your SQL routines or triggers, and even ACS's Run SQL Scripts or RUNSQLSTM.
--
-- Use INCLUDE (SQL) to maintain reusable code segments.
-- and incorporate in scripts or SQL Procedures, Functions, and Triggers
-- Reference: http://ibm.biz/DB2fori_INCLUDE
--
--
-- description: Use the INCLUDE statement to pull
-- in and execute common pieces
-- of SQL
--
begin
include sql '/home/SCOTTF/create objects.sql';
include sql '/home/SCOTTF/insert data.sql';
end;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment