Enterprise Grafana Cloud

SQL query editor

The IBM Db2 data source plugin provides a query editor that supports full SQL syntax. You can use it to run any SQL query against your IBM Db2 database.

Example query using system tables:

SQL
SELECT 'TABLE' AS OBJECT_TYPE, COUNT(NAME) AS COUNT
  FROM SYSIBM.SYSTABLES
  WHERE TYPE='T'
 UNION
  SELECT 'VIEW' AS OBJECT_TYPE, COUNT(NAME) AS COUNT
  FROM SYSIBM.SYSTABLES
  WHERE TYPE = 'V'
  ORDER BY 1