4.4 Work with Annotations

Use the following commands to add, get, edit, and delete metadata annotations on database objects.

Syntax

annotation <command> [options]

4.4.1 Add an Annotation

This command enables you to add a new annotation to an object. An object can have multiple annotations using different labels.

Syntax

annotation annotate
-type <object-type>
-name <object-name>
-label <annotation-label>
-value <annotation-value>
[-debug]
[-verbose]

For descriptions of all options, see ANNOTATION.

Example

annotation annotate -type 'TABLE COLUMN' -name SHOTS.PEAK_BALL_SPEED_KMH 
-label DESCRIPTION -value 'Maximum ball speed in kilometers per hour recorded after the shot was taken'

This adds a DESCRIPTION annotation to the PEAK_BALL_SPEED_KMH column in the SHOTS table.

4.4.2 Get an Annotation

This command enables you to read the value of an existing annotation.

Syntax

annotation get-annotation
-type <object-type>
-name <object-name>
-label <annotation-label>
[-debug]
[-verbose]

Example

annotation get-annotation -type 'TABLE COLUMN' 
-name SHOTS.PEAK_BALL_SPEED_KMH -label DESCRIPTION

This returns the DESCRIPTION annotation attached to the PEAK_BALL_SPEED_KMH column in the SHOTS table.

4.4.3 Edit an Annotation

This command enables you to replace the value of an existing annotation.

Syntax

annotation edit-annotation
-type <object-type>
-name <object-name>
-label <annotation-label>
-value <new-annotation-value>
[-debug]
[-verbose]

Example

annotation edit-annotation -type 'TABLE COLUMN' -name SHOTS.PEAK_BALL_SPEED_KMH 
-label DESCRIPTION -value 'Maximum ball speed in kilometers per hour recorded right after the shot was taken'

This updates the existing DESCRIPTION annotation on the PEAK_BALL_SPEED_KMH column in the SHOTS table.

4.4.4 Delete an Annotation

Use this command to remove an existing annotation from an object by using its label, object name, and object type.

Syntax

annotation delete-annotation
-type <object-type>
-name <object-name>
-label <annotation-label>
[-debug]
[-verbose]

Example

annotation delete-annotation -type 'TABLE COLUMN' 
-name SHOTS.PEAK_BALL_SPEED_KMH -label DESCRIPTION

This removes the DESCRIPTION annotation from the PEAK_BALL_SPEED_KMH column in the SHOTS table. It does not delete the column, the table, or any other annotations attached to that object.