View previous topic :: View next topic
|
Author |
Message |
marcomosca
New User
Joined: 05 Feb 2009 Posts: 4 Location: Italy
|
|
|
|
Hello, i'm not really expert of DB2 (sorry if the question is so easy),
but how long can be the COMMENT in a field (row) within a table?
I've tried to search in the net but i haven't found anything.. |
|
Back to top |
|
|
sushanth bobby
Senior Member
Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
Marcomosca,
Can you post an example. It will be really helpful to help you.
Thank You,
Sushanth Bobby |
|
Back to top |
|
|
marcomosca
New User
Joined: 05 Feb 2009 Posts: 4 Location: Italy
|
|
|
|
well.. it's a simple comment.. for example
Code: |
COMMENT ON COLUMN DB.NAME IS 'HELLO MY NAMES IS JOHN'; |
(maybe i written "Row" sorry.. it's "Column") |
|
Back to top |
|
|
sushanth bobby
Senior Member
Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
Marcomosca,
In DB2 V8, the number is 762.
Why don't you just try it out & post it.
Will be interesting!!!!
Can i know , for what reason you are using COMMENT ?
Sushanth Bobby |
|
Back to top |
|
|
marcomosca
New User
Joined: 05 Feb 2009 Posts: 4 Location: Italy
|
|
|
|
Thanks for the reply
but I think I can insert only 80/81 chars.. (maybe the version of the db2 i'm working on, is different)
The reason is just for descriptive informations... |
|
Back to top |
|
|
sushanth bobby
Senior Member
Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
Thank You Marcomosca |
|
Back to top |
|
|
jose.jeyan
New User
Joined: 28 Jul 2006 Posts: 60 Location: Mumbai
|
|
|
|
Hi Marcomosca,
Can you please explain how did you comment in the db2 table column fields. As you have explained above .
<<COMMENT ON COLUMN DB.NAME IS 'HELLO MY NAMES IS JOHN'; >>
Thanks,
Tony Jose. |
|
Back to top |
|
|
sushanth bobby
Senior Member
Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
Tony,
By executing the statement COMMENT in SPUFI.
Code: |
COMMENT ON COLUMN HLQ.tablename.columnname
IS 'TESTING for COMMENT'; |
Sushanth |
|
Back to top |
|
|
venki3
New User
Joined: 20 Jan 2010 Posts: 3 Location: Chennai
|
|
|
|
Hi Sushanth,
I was not aware of comments in a DB2 table.
Could you please tell where will this comment be stored in the DB2 table? And how is it possible to retrive/view the comment at a later point of time?
Thanks,
Venkateswari |
|
Back to top |
|
|
Kjeld
Active User
Joined: 15 Dec 2009 Posts: 365 Location: Denmark
|
|
|
|
sushanth bobby wrote: |
Marcomosca,
In DB2 V8, the number is 762.
Why don't you just try it out & post it.
Will be interesting!!!!
|
Reference section 5.20 in the DB2 SQL reference manual from the IBM manuals link above. The V9 also specifies a max. of 762 characters for a comment. Comments can specified for a lot of DB2 objects, provided you have proper authority.... |
|
Back to top |
|
|
sushanth bobby
Senior Member
Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
Venki,
Quote: |
where will this comment be stored in the DB2 table |
In DB2 catalog, look at respective object(like for columns look in syscolumns). Column name is REMARK.
Sushanth |
|
Back to top |
|
|
Kjeld
Active User
Joined: 15 Dec 2009 Posts: 365 Location: Denmark
|
|
|
|
venki3 wrote: |
Hi Sushanth,
I was not aware of comments in a DB2 table.
Could you please tell where will this comment be stored in the DB2 table? And how is it possible to retrive/view the comment at a later point of time?
Thanks,
Venkateswari |
At my installation it is in the column REMARKS in the DB2 catalog tables for various objects. I have not found any rows with value <> NULL, so I guess no one here uses the feature. |
|
Back to top |
|
|
sushanth bobby
Senior Member
Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
Kjeld,
Quote: |
I guess no one here uses the feature |
In my shop too.
Sushanth |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
Comments on column do not apply to the data in indivdual rows/columns, they are a part of the definition of a table as a whole. |
|
Back to top |
|
|
ILdba
New User
Joined: 11 Feb 2010 Posts: 3 Location: Illinois, USA
|
|
|
|
marcomosca,
In your original post you said you can only get 80 characters...Are you by any chance failing to continue the comment onto the next line? |
|
Back to top |
|
|
Kjeld
Active User
Joined: 15 Dec 2009 Posts: 365 Location: Denmark
|
|
|
|
If you are using IBM DB2 Admin tools, you might have set (or your installation has done as default) the max char fields to show in the editor to 80. Spufi has has a similar setting in it's defaults. |
|
Back to top |
|
|
|