Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Comments in a field within a table on DB2

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: Comments in a field within a table on DB2
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: 1013
Location: India

PostPosted: Fri Feb 13, 2009 5:47 pm    Post subject:
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    Post subject:
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: 1013
Location: India

PostPosted: Fri Feb 13, 2009 7:10 pm    Post subject:
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    Post subject:
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: 1013
Location: India

PostPosted: Tue Feb 17, 2009 2:23 pm    Post subject:
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    Post subject: how to comment
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: 1013
Location: India

PostPosted: Wed Feb 17, 2010 5:20 pm    Post subject:
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    Post subject:
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    Post subject:
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: 1013
Location: India

PostPosted: Wed Feb 17, 2010 5:48 pm    Post subject:
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    Post subject:
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: 1013
Location: India

PostPosted: Wed Feb 17, 2010 6:03 pm    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 24 Tue Dec 06, 2016 8:04 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts Amount field is getting corrupted whe... thesumitk SYNCSORT 5 Tue Oct 18, 2016 8:20 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us