• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 577
  • Last Modified:

iSeries table description blank

We are running an iSeries at V7R1. When I run a sql query (from run sql scripts or strsql) like:

Select * from qsys2.systables

The TABLE_TEXT and LONG_COMMENT fields are blank. With SYSCOLUMNS table the COLUMN_TEXT field is populated.  

If I run the command DSPFD <TABLENAME> the “text description” does have this information.

Is there something I need to do to get the table_text field populated?
  • 3
1 Solution
Dave FordSoftware Developer / Database AdministratorCommented:
You'd use SQL's "LABEL ON" and "COMMENT ON" command. Give me a minute, and I'll whip up a couple examples.

Dave FordSoftware Developer / Database AdministratorCommented:
Something like this should do it:

create table MySchema.MyTable (
   anInteger integer         

LABEL ON TABLE MySchema.MyTable IS 'Some descriptive text';

COMMENT ON TABLE MySchema.MyTable IS 'Some longer descriptive text';

Open in new window

-- DaveSlash
HelpDeskGeigerAuthor Commented:
I should have mentioned this is for tables that already exist. I don't think they were created with sql either.
Dave FordSoftware Developer / Database AdministratorCommented:
"LABEL ON" and "COMMENT ON" would still work.

Give it a try. It's mind-numbingly easy to try it out.
There is an "object" on the system that defines the file. The OS maintains the actual object descriptions for all types of objects.

In addition, there is the database catalog that is maintained by DB2. This is a SQL database that is mandated by the standard for SQL.

When you look at DSPFD, you generally see the OS description. The OS was around before SQL was available, and the object-based facilities still run everything behind the scenes. The database catalog is managed on top of the object-based facilities.

Dave's suggestions are the correct answer. The SQL LABEL ON and COMMENT ON statements essentially effect UPDATEs to the database catalog.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Train for your Pen Testing Engineer Certification

Enroll today in this bundle of courses to gain experience in the logistics of pen testing, Linux fundamentals, vulnerability assessments, detecting live systems, and more! This series, valued at $3,000, is free for Premium members, Team Accounts, and Qualified Experts.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now