将字段描述添加到 DB2/400 文件
我在 AS/400/iSeries/System-I/whatever-IBM-wants-me-to-call-it-these-days 上的库中有一组文件,我没有 DDS(在 SQL I 中创建)收集)但我想添加字段描述。 我找不到在 400 上执行此操作的方法。
有谁知道如何添加字段描述? 直接更新 SYSIBM.SQLCOLUMNS 以设置 COLUMN_TEXT 安全吗?
(我不是在这里寻找一般的 SQL 答案,而是寻找 DB2/400 特定的答案。不幸的是,考虑到 IBM 对该平台的重命名以及他们选择的非常无法通过谷歌搜索的名称,几乎不可能找到答案(或者特别是要证明这一点)没有答案)这些问题无需花费大量时间查看大量、难以理解的文档)
I have a set of files in a library on an AS/400/iSeries/System-I/whatever-IBM-wants-me-to-call-it-these-days which I do not have DDS for (created in SQL I gather) but to which I would like to add field descriptions. I cannot find a way to do this on the 400.
Does anyone know how I can add field description? Is directly updating SYSIBM.SQLCOLUMNS to set COLUMN_TEXT safe?
(I am not looking for general SQL answers here, only DB2/400 specific answers. Unfortunately given IBMs renamings of this platform and the very un-google-able name they chose, it is almost impossible to find answers (or especially to prove that there is NOT an answer) to such questions without spending ages looking through there voluminous, impenetrable documentation)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用LABEL SQL 命令。 如果您使用的是绿屏 STRSQL 命令,则可以提示它。 LABEL 命令可用于设置列文本和列标题。
下面是使用 LABEL 命令为名为 TESTFILE1 的文件中的两个字段提供列文本的示例。 在本例中,字段被命名为FIELD1和FIELD2:
下面是使用LABEL命令给出将在查询结果中显示的列标题的示例:
创建列标题时,每个字段有60个字符。 前 20 个字符是第 1 行。后 20 个字符是第 2 行。第三个 20 个字符是第 3 行。在上面的示例中,字段标题如下所示:
Use the LABEL SQL command. If you are using the green-screen STRSQL command, you can prompt it. The LABEL command can be used to set both column text and column headings.
Here is an example of using the LABEL command to give column text for two fields in the file named TESTFILE1. The fields are named FIELD1 and FIELD2 in this example:
Here is an example of using the LABEL command to give column headings that would show up in query results:
When creating column headings, you get 60 characters per field. The first 20 characters are line 1. The second 20 characters are line 2. The third 20 characters are line 3. In the above example, the field headings would look like this:
作为附加提示,您可以使用 iSeries Navigator 获取该文件的 SQL 语句。 如果您启动该程序,登录到 iSeries,转到数据库,转到模式,然后转到表,然后您就可以找到您的文件。 您会在某处找到“生成 SQL”按钮。 这将为您创建一个精确的 SQL 语句来创建表。 您可以使用此 SQL 语句来处理该表。
对于您的问题,另一个答案中的“标签”就足够了。 如果您想做更多 ALTER 无法完成的事情,这个答案很有用。
As an additional hint, you can use iSeries Navigator to get the SQL statement for that file. If you fire up this program, log on to the iSeries, go to database, go to schemas, and go to tables, then you can find your file. You'll find the button "generate SQL" somewhere. This creates an exact SQL statement for you to create the table. You can use this SQL statement to work with this table.
For your questions, the "LABEL" from another answer is sufficient. This answer is usefull if you want to do more stuff, that can not be done with ALTER.