ATTRIBUTE

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|
                      LIKE source_attribute|
                      ON|
                      OFF...]]

where:

ATTRIBUTE

Is the command. Issuing the ATTRIBUTE command with no parameters gets you a list of all current attribute settings.

object_type

Is the name of an Oracle8 object type.

attribute

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.

ALI[AS] alias

May be abbreviated ALI. ALIAS allows you to specify an alternate name for this attribute that is meaningful to SQL*Plus.

alias

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.

CLE[AR]

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.

FOR[MAT]

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.

format_spec

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.

LIKE

Causes the attribute to be defined with the same format attributes as another attribute.

source_column

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.

ON

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.

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.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.222.109.4