Database Reference
In-Depth Information
Figure 18.25
Adding Comments
to Database
Schema Objects.
COMMENT ON TABLE ARTIST IS 'Artists';
COMMENT ON TABLE CDTRACK IS 'Tracks';
COMMENT ON TABLE INSTRUMENTATION
IS 'Guest Instruments Played';
COMMENT ON TABLE INSTRUMENT IS 'Musical Instruments';
COMMENT ON TABLE MUSICCD IS 'Audio Compact Disks';
COMMENT ON TABLE SONG IS 'Songs';
COMMENT ON TABLE GUESTAPPEARANCE IS 'Guest Artists';
COMMENT ON TABLE STUDIOTIME IS 'Studio Recording Time';
Comments added to tables can be viewed by querying the
USER_TAB_COMMENTS metadata view. These commands will show
the comments added. Figure 18.26 shows the results.
COLUMN TABLE_NAME FORMAT A32 HEADING "Table";
COLUMN COMMENTS FORMAT A32 HEADING "Comments";
SELECT TABLE_NAME, COMMENTS FROM USER_TAB_COMMENTS
WHERE COMMENTS IS NOT NULL;
Now we add some comments to the columns in a single table. Let's use
the ARTIST table.
COMMENT ON COLUMN ARTIST.ARTIST_ID
IS 'Artist unique identifier (internally generated)';
COMMENT ON COLUMN ARTIST.NAME IS 'The Artist';
COMMENT ON COLUMN ARTIST.STREET IS 'Street address';
 
Search WWH ::




Custom Search