Link to home
Start Free TrialLog in
Avatar of HelpDeskGeiger
HelpDeskGeigerFlag for United States of America

asked on

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?
Avatar of Member_2_2484401
Member_2_2484401
Flag of United States of America image

You'd use SQL's "LABEL ON" and "COMMENT ON" command. Give me a minute, and I'll whip up a couple examples.

HTH,
DaveSlash
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
Avatar of HelpDeskGeiger

ASKER

I should have mentioned this is for tables that already exist. I don't think they were created with sql either.
ASKER CERTIFIED SOLUTION
Avatar of Member_2_2484401
Member_2_2484401
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Member_2_276102
Member_2_276102

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.

Tom