cancel
Showing results for 
Search instead for 
Did you mean: 

SQL Syntax to read field or table comments

patrickbachmann
Active Contributor
0 Kudos

Hi folks,

I'm trying to read comments from specific table fields or the table itself via SQL editor in studio.  For example I know I can easily add a comment to a field like this;

COMMENT ON TABLE "MYSCHEMA"."LFM2" is 'Vendor Master Record: Purchasing Data'

COMMENT ON COLUMN "MYSCHEMA"."LFM2"."MANDT" is 'Client'

Now what is the syntax to READ these comment values via SQL editor?

Thanks

-Patrick

Accepted Solutions (1)

Accepted Solutions (1)

former_member184768
Active Contributor
0 Kudos

Hi Patrick,

I am bit confused, but could you not get the comments from TABLES and TABLE_COLUMNS

select table_name, comments from tables where table_name = 'my_table_name';

select table_name, column_name, comments from table_columns where table_name = 'my_table_name' and column_name = 'my_column_name';

It works for me.

OR

Are you looking for something else.

Regards,

Ravi

patrickbachmann
Active Contributor
0 Kudos

Ok thanks Ravi this seems to work for myself as well.  I was trying to select comments from each individual source table rather than these system tables called table_columns and tables. 

-Patrick

Answers (0)