What field data type do you use for comment fields

3052
5
07-24-2012 06:53 AM
JoseSanchez
Frequent Contributor
Hi all

What   field data type do you use to store comments ?

thanks
0 Kudos
5 Replies
BenLin
by
Regular Contributor
Hi Jose,

I believe for SQL Server, you can use VARCHAR(MAX), NVARCHAR(MAX); for Oracle, you may use VARCHAR2(4000), NVARCHAR2(4000).

See following web help document for the TEXT field.
http://resources.arcgis.com/en/help/main/10.1/index.html#//019v00000002000000

Thanks,
Ben
0 Kudos
VinceAngelo
Esri Esteemed Contributor
It depends on what you want to do with them, and the chracter set in which
they've been encoded.  While CLOB/NCLOB types may seem attractive, they
are not nearly as efficent as VARCHAR for most of the functions you would
usually want to run on them, and anyone who can't comment in 2000 or 4000
characters isn't likey to generate a comment you'd want to use anyway.

- V
0 Kudos
JoseSanchez
Frequent Contributor
How do you declare a comment field type varchar with ArcCatalog that is pointing to an SDE Oracle 11G database?

Do you create a text with length 2000?

Thanks




It depends on what you want to do with them, and the chracter set in which
they've been encoded.  While CLOB/NCLOB types may seem attractive, they
are not nearly as efficent as VARCHAR for most of the functions you would
usually want to run on them, and anyone who can't comment in 2000 or 4000
characters isn't likey to generate a comment you'd want to use anyway.

- V
0 Kudos
VinceAngelo
Esri Esteemed Contributor
I almost exclusively use SQL or ArcSDE command-line utilities to create database tables.

- V
0 Kudos
KimPeter
Esri Contributor
Jose,

What data type gets created in your database will depend on the encoding you are using.  If your database is not using a Unicode character set, you can create a varchar field by choosing Text and specifying a length of up to 4,000 from ArcGIS Desktop. If you go over 4,000, a CLOB field will be created in the database.

If your database is using a Unicode character set, it will depend on what specific language you are storing. Characters in Latin-based alphabets use 2 bytes, but there are other character sets that use 3 bytes and some use 4 bytes. As long as you stay under 4,000 bytes, though, an nvarchar field will be created in the database. Above that, an NCLOB is created.

As Vince said, though, I would think you'd want to set a comment field at a length lower than 4,000 bytes, but I suppose it depends on your particular application. 🙂
0 Kudos