HOWTO:SQL/Prevent rerouting SQL when renaming or moving: Difference between revisions

From Remain Software
Jump to navigation Jump to search
(Created page with "==How to prevent rerouting of SQL objects when renaming or moving== IBM has implemented a rerouting mechanism to make sure SQL schema references do not break when renaming or moving objects. [https://www.ibm.com/support/pages/improved-catalog-management-procedures-and-functions Read the details here] When a procedure or function is created, the routine information is stored within the *PGM or *SRVPGM. Previously, when librarian commands were used to copy/move/rename th...")
 
 
(No difference)

Latest revision as of 10:25, 7 August 2025

How to prevent rerouting of SQL objects when renaming or moving

IBM has implemented a rerouting mechanism to make sure SQL schema references do not break when renaming or moving objects.

Read the details here

When a procedure or function is created, the routine information is stored within the *PGM or *SRVPGM. Previously, when librarian commands were used to copy/move/rename the object, the QSYS2/SYSROUTINE, SYSPARMS and SYSRTNDEP catalogs were left unchanged. The following commands (and their API counterparts) are changed to keep the catalogs in sync with the executable object for procedures and functions:

  • Create Duplicate Object (CRTDUPOBJ) - the routine catalog information is duplicated and the SYSROUTINE EXTERNAL_NAME column points to the newly duplicated executable object
  • Copy Library (CPYLIB) - the routine catalog information is duplicated and the SYSROUTINE EXTERNAL_NAME column points to the newly duplicated executable object
  • Rename Object (RNMOBJ) - the routine catalog information is modified with the SYSROUTINE EXTERNAL_NAME column pointing to the renamed executable object
  • Move Object (MOVOBJ) - the routine catalog information is modified with the SYSROUTINE EXTERNAL_NAME column pointing to the moved executable object


TD/OMS moves and renames SQL implementation objects before they are replaced with new versions. This causes the side effects mentioned above which are unwanted.

To prevent the re-routing, an environment variable must be set at the job or system level.

  ADDENVVAR ENVVAR(QIBM_SQL_NO_CATALOG_UPDATE) LEVEL(*JOB/*SYS)

Create an action that gets executed at UEP 1 with the "Suppress Subsequent" flag set to '1' to avoid setting it multiple times