HelpDeskGeiger
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?
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?
Something like this should do it:
-- DaveSlash
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';
-- DaveSlash
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
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
HTH,
DaveSlash