Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Does Sybase allow adding comment to an object or a column?

3 posts in Cluster Last posting was on 2008-09-12 15:15:39.0Z
Tony Posted on 2008-09-11 18:08:51.0Z
Sender: 2523.48c95bff.1804289383@sybase.com
From: Tony
Newsgroups: sybase.public.ase.cluster
Subject: Does Sybase allow adding comment to an object or a column?
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <48c95eb3.259c.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 11 Sep 2008 11:08:51 -0700
X-Trace: forums-1-dub 1221156531 10.22.241.41 (11 Sep 2008 11:08:51 -0700)
X-Original-Trace: 11 Sep 2008 11:08:51 -0700, 10.22.241.41
Lines: 12
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.cluster:93
Article PK: 48376

I am new to sybase community. I am trying to find the
equivalent of Oracle "comment on" command so that we can add
comment/description to a column or an object. The samples
are

comment on table some_table is 'some hopefully meaningful
comment for some_table';

comment on column some_table.col_1 is 'Be sure to really
give some meaningful comment';

any suggestion is appreciated.


Cory Sane Posted on 2008-09-12 03:34:37.0Z
From: "Cory Sane" <cory!=sane>
Newsgroups: sybase.public.ase.cluster
References: <48c95eb3.259c.1681692777@sybase.com>
In-Reply-To: <48c95eb3.259c.1681692777@sybase.com>
Subject: Re: Does Sybase allow adding comment to an object or a column?
Lines: 21
MIME-Version: 1.0
Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Windows Mail 6.0.6001.18000
X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6001.18049
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <48c9e34d@forums-1-dub>
Date: 11 Sep 2008 20:34:37 -0700
X-Trace: forums-1-dub 1221190477 10.22.241.152 (11 Sep 2008 20:34:37 -0700)
X-Original-Trace: 11 Sep 2008 20:34:37 -0700, vip152.sybase.com
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.cluster:94
Article PK: 48374

You may need to repost thing in the ase.general group.
But I do not know of a way to do this.


--
Cory Sane
[TeamSybase]
Certified Sybase Associate DBA for ASE 15.0

"Tony" wrote in message news:48c95eb3.259c.1681692777@sybase.com...
>I am new to sybase community. I am trying to find the
> equivalent of Oracle "comment on" command so that we can add
> comment/description to a column or an object. The samples
> are
>
> comment on table some_table is 'some hopefully meaningful
> comment for some_table';
>
> comment on column some_table.col_1 is 'Be sure to really
> give some meaningful comment';
>
> any suggestion is appreciated.


Bret Halford Posted on 2008-09-12 15:15:39.0Z
From: Bret Halford <bret@sybase.com>
User-Agent: Thunderbird 2.0.0.16 (Windows/20080708)
MIME-Version: 1.0
Newsgroups: sybase.public.ase.cluster
Subject: Re: Does Sybase allow adding comment to an object or a column?
References: <48c95eb3.259c.1681692777@sybase.com>
In-Reply-To: <48c95eb3.259c.1681692777@sybase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <48ca879b$1@forums-1-dub>
Date: 12 Sep 2008 08:15:39 -0700
X-Trace: forums-1-dub 1221232539 10.22.241.152 (12 Sep 2008 08:15:39 -0700)
X-Original-Trace: 12 Sep 2008 08:15:39 -0700, vip152.sybase.com
Lines: 76
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.cluster:95
Article PK: 48377


Tony wrote:
> I am new to sybase community. I am trying to find the
> equivalent of Oracle "comment on" command so that we can add
> comment/description to a column or an object. The samples
> are
>
> comment on table some_table is 'some hopefully meaningful
> comment for some_table';
>
> comment on column some_table.col_1 is 'Be sure to really
> give some meaningful comment';
>
> any suggestion is appreciated.

ASE doesn't provide/include any specific syntax or procedures to
add comments to objects. There is evidence that long ago something
like that was planned - the syscomments table, which mainly stores the
source code for procedures, triggers, views, etc, does have a "texttype"
column, for which value "1" is reserved for "comments".

You can create your own stored procedure to insert your comments into
syscomments, for example:


sp_configure 'allow updates', 1
go

create procedure ins_comment @object_id int, @comment varchar(255) as

insert into syscomments values

(@objid, 0, 1, 1, 1, @comment, 0)
go

sp_configure "allow updates", 0
go

declare @object_id int
select @object_id = obj_id("rates_table")
execute ins_comment 123456888, 'This table tracks interest rates over
the last fiscal year.'
go

After executing ins_comment, execute sp_helptext to retrieve comments
about an object:

execute sp_helptext rates_table
go

# Lines of Text

---------------

1

(1 row affected)

text




-----------------------------------------

This table tracks interest rates over the last

fiscal year.

(1 row affected, return status = 0)


However, there is no really compelling reason to use syscomments,
particularly if you want to comment about particular columns -
you might be better off creating your own table to hold comments
and procedures to insert and display them at whatever level of
granularity you choose.