MainframeSupports
tip week 44/2001:

In DB2 version 5 a new table occurred in the catalog. It is called SYSIBM.SYSDUMMY1 and its only purpose is to contain exactly one row. I have already shown a tip in week 40 using this table. This tip will explain its use in detail.

SYSIBM.SYSDUMMY1 contains only one column, which is of very little interest. We cannot have tables without columns, so therefore there has to be one. The name of the table indicates that IBM has great plans. In the near future SYSIBM.SYSDUMMY2 will be implemented, just wait and see. The possibilities are limitless.

Well, why is SYSIBM.SYSDUMMY1 such a pretty good table. The tip from week 40 is just one example. Furthermore we are now able to retrieve the value of expressions and special registers using dynamic SQL, without inventing clumsy SQL to do the trick of returning exactly one row. My favourite trick was SELECT ... FROM SYSIBM.SYSTABLES WHERE CREATOR = 'SYSIBM' AND NAME = 'SYSTABLES'. I just got tired of all the typing.

All this has been history for quite a while. Just type in SELECT ... FROM SYSIBM.SYSDUMMY1 and you will get your result in no time without the need of actually having to retrieve some data, that you wouldn't use anyway. If you are still on DB2 version 4 (I hope not) then you have yet another argument for migrating ASAP.

Previous tip in english        Sidste danske tip        Tip list