IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Comments in a field within a table on DB2


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
marcomosca

New User


Joined: 05 Feb 2009
Posts: 4
Location: Italy

PostPosted: Fri Feb 13, 2009 5:32 pm
Reply with quote

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
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Fri Feb 13, 2009 5:47 pm
Reply with quote

Marcomosca,

Can you post an example. It will be really helpful to help you.

Thank You,
Sushanth Bobby
Back to top
View user's profile Send private message
marcomosca

New User


Joined: 05 Feb 2009
Posts: 4
Location: Italy

PostPosted: Fri Feb 13, 2009 7:00 pm
Reply with quote

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
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Fri Feb 13, 2009 7:10 pm
Reply with quote

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
View user's profile Send private message
marcomosca

New User


Joined: 05 Feb 2009
Posts: 4
Location: Italy

PostPosted: Tue Feb 17, 2009 2:21 pm
Reply with quote

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
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Tue Feb 17, 2009 2:23 pm
Reply with quote

Thank You Marcomosca
Back to top
View user's profile Send private message
jose.jeyan

New User


Joined: 28 Jul 2006
Posts: 60
Location: Mumbai

PostPosted: Wed Feb 17, 2010 5:02 pm
Reply with quote

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
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Wed Feb 17, 2010 5:20 pm
Reply with quote

Tony,

By executing the statement COMMENT in SPUFI.
Code:
COMMENT ON COLUMN HLQ.tablename.columnname
IS 'TESTING for COMMENT';         


Sushanth
Back to top
View user's profile Send private message
venki3

New User


Joined: 20 Jan 2010
Posts: 3
Location: Chennai

PostPosted: Wed Feb 17, 2010 5:41 pm
Reply with quote

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
View user's profile Send private message
Kjeld

Active User


Joined: 15 Dec 2009
Posts: 365
Location: Denmark

PostPosted: Wed Feb 17, 2010 5:44 pm
Reply with quote

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
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Wed Feb 17, 2010 5:48 pm
Reply with quote

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
View user's profile Send private message
Kjeld

Active User


Joined: 15 Dec 2009
Posts: 365
Location: Denmark

PostPosted: Wed Feb 17, 2010 5:58 pm
Reply with quote

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
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Wed Feb 17, 2010 6:03 pm
Reply with quote

Kjeld,

Quote:
I guess no one here uses the feature


In my shop too.

Sushanth
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Wed Feb 17, 2010 6:11 pm
Reply with quote

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
View user's profile Send private message
ILdba

New User


Joined: 11 Feb 2010
Posts: 3
Location: Illinois, USA

PostPosted: Fri Feb 19, 2010 2:05 am
Reply with quote

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
View user's profile Send private message
Kjeld

Active User


Joined: 15 Dec 2009
Posts: 365
Location: Denmark

PostPosted: Fri Feb 19, 2010 3:48 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Load new table with Old unload - DB2 DB2 6
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Check data with Exception Table DB2 0
Search our Forums:

Back to Top