Solaris Naming Administration Guide

Modifying Table Entries

Existing table entries are edited (modified) using either the -e or -E options. The Solaris operating environment release also supports use of the -m option for backwards compatibility with earlier releases. (All new applications and command line operations should use either the -e or -E options.)

To edit an existing entry (row) in a table, use nistbladm with either the -e or -E options followed by one or more column=value pairs that specify the new values and ending with an indexed name that identifies a particular row in a table as described in "nistbladm and Indexed Names".


nistbladm [-e | -E] column="value" \
 column="value" \
 ... indexedname

When adding new entry rows to a table with either -e or -E:

Editing a Table Entry With the -e Option

The -e option edits an entry in a table unless doing so would result in changing values in searchable columns in more than one entry row, in which case it returns an error. (The values in non-searchable columns are not taken into account.)


nistbladm column="value" \
 column="value" \
 ... indexedname

To use the -e option, you only need to specify the column values you are changing.

For example, suppose you had the table:

Dept 

Site 

Name 

Sales 

SanFran 

Tsosulu 

To change the value of the Name column to Chandar, you would enter:


master% nistbladm -e Name="Chandar" [Dept='Sales',Site='SanFran'],\
 depts.doc.com.

Now the table looks like this:

Dept 

Site 

Name 

Sales 

SanFran 

Chandar 

(Note that in the example above, the indexed name did not need to include the Name column because in these examples that column is not searchable.)

C-shell users should also use quotes to set off expressions using square brackets.

You can use the -e option to edit the values in searchable columns so long as the new values you specify affect only the single row identified by the indexed name. For example, to change the department to Manf, you would enter:


master% nistbladm -e Dept="Manf" [Dept='Sales',Site='SanFran'],\
 depts.doc.com.

Dept (searchable) 

Site (searchable) 

Name 

Manf 

SanFran 

Chandar 

However, if an entry row already existed with Manf and SanFran in the searchable columns, the -e option would return an error.

You can specify changes to multiple columns so long as they all apply to a single entry row. For example, to change both the Dept and Name values, you would enter:


master% nistbladm -e Dept="Manf" Name="Thi" \
 [Dept='Sales',Site='SanFran'],depts.doc.com.

Dept (searchable) 

Site (searchable) 

Name 

Manf 

SanFran 

Thi 

Editing a Table Entry With the -E Option

The -E option is designed for applications where you need to force nistbladm to overwrite an existing entry even if doing so will affect more than one entry.

For example, suppose your table had the following rows:

Dept (searchable) 

Site (searchable) 

Name 

Sales 

SanFran 

Chandar 

Sales 

Alameda 

Achmed 

Now you run the following command:


master% nistbladm -E Site="Alameda" Mgr="Chu" \
[Div='Sales',Site='SanFran'],depts.doc.com.

Which would change the Sales SanFran Chandar row to Sales Alameda Chu. But Sales Alameda are the key values identifying the Sales Alameda Achmed row, so that row would also be changed. The result would be a single row where once there had been two rows:

Dept (searchable) 

Site (searchable) 

Name 

Sales 

Alameda 

Chu 

The -e option would have returned an error, since the edit would affect more than one row. But the -E option allows you to affect more than one entry row.