Using Attribute Table Article ID : 100006 Software : ArcGIS Desktop 9.x Platform : Windows 2000, Windows XP Date : September 30, 2005 Background Sometimes the function provided in Attribute Table was overlooked or even treated as just a flat file representation of the database. However, it s not true. Within Attribute Table, it provides a lot of functions to help user to eliminate the tedious process. In this article, we will introduce some useful tools in the Attribute Table. Attribute Table Attribute table is the database component of geographic datasets, whether that dataset is a shapefile, coverage or geodatabase. All attribute tables are stored in a database format. For example, shapefiles are stored in dbase while personal geodatabases are stored in Microsoft Access. To open the Attribute Table, simply right-click the layer in the TOC, and select Open Attribute Table, then the attribute table for that layer will be opened like below: All rights reserved. P. 1 of 5
Each field in the table is the attribute contained by each feature Each row in the table is the representation of each feature Move to first record Previous record Current record Next Record Move to last record Show all records or selected records Click for additional table options Adding Fields We can easily add a new field to an attribute table by clicking the options button in the Attribute Table and select Add Field. Then, enter the Name, select the data type and set the precision and scale if applicable. All rights reserved. P. 2 of 5
Note for entering the field name: 1. In Shapefiles, field names are limited to 10 characters and can only use numbers, letters, hyphens and underscores. No spaces or other special characters are allowed. 2. In personal geodatabases, field names can be up to 64 characters long and include any combination of letters, numbers, spaces and special characters except periods (.), exclamation points (!), accent graves (`), double quotation marks ( ) and brackets ([ ]). Moreover, it cannot being with leading spaces or includes control characters. 3. It should be bear in mind that when exporting the geodatabase data to shapefile, field names will be truncated to 10 characters if its length is longer than 10 characters and it may become difficult to tell the difference between fields. Use common or easily interpreted abbreviations for field names. Note for choosing the data type: 1. There are 6 common data types supported by ArcGIS. Data Type Size Range/format Description Short 2 bytes +/- 32,768 One bit states if the number is positive or negative Integer and the remaining 15 translate to a numeric value with five significant digits. Can store only real numbers, no fraction number allowed Long 4 bytes +/- 2.14 billion One bit stores the positive or negative nature of the Integer number while the remaining bits translate to a numeric value with 10 significant digits. Can store only real numbers, no fraction number allowed Float 4 bytes Approximately Store up to 7 significant digits -3.4E38 to 1.2E38 Double 8 bytes Approximately Store up to 15 significant digits -2.2E308 to 1.8E308 Date 8 bytes mm/dd/yyyy When you enter date fields in the table, they will be hh:mm:ss converted to this format. AM/PM Text Varies Varies It depends on which data format is used, Shapefile could only store up to 255 characters Figure 1: Common data types supported by ArcGIS 2. Always use the smallest byte-size data type as this will not only minimize the amount of storage required for your geodatabase but will also improve the performance. All rights reserved. P. 3 of 5
3. Consider the need for exact numbers versus approximate numbers. If the field values will not include fractional numbers, choose either a short or long integer. 4. Float and double data types have precision and scale field properties. Precision refers to the number of digits used to store numbers. Scale refers to the number of decimal places to the right of the decimal point. Precision 1234.5678 Scale Deleting Fields To delete a field from attribute table, simply right-click the field name, select Delete Field and click Yes. You can add or remove fields from a table as long as the following conditions are met: You have write access to the data. You're not currently editing the data in ArcMap. No other users or applications are accessing the data including other ArcMap or ArcCatalog sessions. All rights reserved. P. 4 of 5
Field Calculator Field Calculator is another useful tool. It can help to copying, concatenating or calculating values to the selected records or all the records of the specified field. It can be used within or outside the edit session, the difference between them is the calculation can be undone within the edit session. However, if the fields in a geodatabase feature class with topology or a network, the Calculate Values command will only be available within an edit session. To open the Field Calculator, open attribute table, right-click the field name and select Calculate Values. The calculated values will apply to all selected records; so if you want to apply the result to one record only, select that record. If you want all the records to be affected, either select all the records or do not select any records. You could also use the Select by Attributes and Select by Location to select the specific records that you want to modify. The End All rights reserved. P. 5 of 5