Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to deal with DB2 structure in batch

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

In this issue, the editor will bring you about how to deal with the DB2 structure in batches. The article is rich in content and analyzed and described from a professional point of view. I hope you can get something after reading this article.

Query all columns

| SELECT 'SELECT' | | LISTAGG (T1.COLNAMEMagazine) | | 'FROM' | | T1.TABNAME | |;'; 'FROM SYSCAT.COLUMNS T1 WHERE T1.TABSCHEMA' mode name 'GROUP BY T1.TABNAME; SELECT * FROM SYSCAT.COLUMNS T1 "

Second, query all column remarks

SELECT T.TABSCHEMA, T.TABNAME, T.COLNAME, CASE WHEN T.TYPENAME = 'DECIMAL' THEN T.TYPENAME |' ('| | T.LENGTH | |','| T.SCALE | |') 'WHEN T.TYPENAME IN (' VARCHAR','CHAR') THEN T.TYPENAME | |'('| | T.LENGTH | |') 'ELSE T.TYPENAME END TYPE_NAME, T.REMARKSFROM SYSCAT.COLUMNS TWHERE TABSCHEMA=' schema name' ORDER BY 1Magin2

Third, query table annotation information

The name of SELECT T.TABSCHEMA, T.TABNAME and T.REMARKSFROM SYSCAT.TABLES TWHERE TABSCHEMA=' schema is' ORDER BY 1 ORDER BY 2'. The above is how to deal with the DB2 table structure in batches. If you happen to have similar doubts, please refer to the above analysis to understand. If you want to know more about it, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report