The ATTRIBUTE command is used to format attributes of an Oracle8 object type. It functions like the COLUMN command, but with fewer parameters. Chapter 4 talks about this command.
ATTRIBUTE [object_type
.attribute
|attribute_alias
[ALI[AS]alias
| CLE[AR]| FOR[MAT]format_spec
| LIKEsource_attribute
| ON| OFF...]]
where:
Is the command. Issuing the ATTRIBUTE command with no parameters gets you a list of all current attribute settings.
Is the name of an Oracle8 object type.
Is the name of an attribute of the specified object type, and is the attribute you are formatting. If you stop here and don’t supply any other parameters, the current display settings for this attribute are shown.
May be abbreviated ALI. ALIAS allows you to specify an alternate name for this attribute that is meaningful to SQL*Plus.
Is an alternate name for the attribute that may be used in other ATTRIBUTE commands, in place of having to spell out the full object type and attribute name again.
May be abbreviated to CLE. CLEAR erases any format settings for the attribute in question. This puts things back the way they were before any ATTRIBUTE commands were issued for the attribute.
May be abbreviated to FOR, and allows you to control how the data for the attribute is displayed. For text fields, the format controls the maximum display length. For numeric fields, you can control the width, placement of commas, placement of the dollar sign, and so on.
Is a string that specifies the display format for the attribute. Appendix B describes the format specification elements that may be used with the ATTRIBUTE command.
Causes the attribute to be defined with the same format attributes as another attribute.
Is the name of the source attribute used with the LIKE parameter. This may be either an alias or a complete attribute reference using the standard dot notation.
Causes SQL*Plus to print the attribute using the format you have specified. This is the default behavior. You don’t need to use ON unless you have previously used OFF.
Disables the format settings for the attribute. SQL*Plus acts as if you had never issued any ATTRIBUTE commands for the attribute in question.
When used with text attributes, formats such as A10 specify a maximum length to be displayed. Longer values are truncated to match the length specified, and shorter values are left alone.