Skip to content

Instantly share code, notes, and snippets.

@NoMan2000
Last active March 27, 2018 20:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NoMan2000/957722807026d9a7f56e3a615e2a863d to your computer and use it in GitHub Desktop.
Save NoMan2000/957722807026d9a7f56e3a615e2a863d to your computer and use it in GitHub Desktop.
DB2 debugging statements.
select * from SYSIBM.TABLES WHERE TABLE_NAME LIKE '%SWPRCRSELP%';
SELECT * FROM SYSIBM;
select r.routinename as FunctionName, r.text as FunctionBody
from syscat.routines r
where r.routinetype = 'F' -- Function
and r.origin in ('U', 'Q'); -- User-defined sourced or query-based
SELECT * FROM SYSIBM.ROUTINES;
select * from sysibm.tables
WHERE TABLE_SCHEMA = 'CMS72DTA'
AND TABLE_NAME = 'CSLCM1';
SELECT * FROM SYSIBM.VIEWS LIMIT 100;
SELECT * FROM SYSIBM.VIEWS WHERE TABLE_SCHEMA = 'CMS72DTA';
SELECT * FROM SYSIBM.VIEWS WHERE TABLE_CATALOG LIKE '%CMS72%';
SELECT * FROM SYSIBM.VIEWS WHERE UPPER(TABLE_SCHEMA) LIKE '%CMS%';
SELECT
TABLE_NAME
FROM
INFORMATION_SCHEMA.TABLES;
SELECT VIEW_DEFINITION
FROM QSYS2.SYSVIEWS
WHERE VIEW_OWNER = 'VIEWSCHEMA'
AND TABLE_NAME = 'VIEWNAME'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment