SQL*Plus User's Guide and Reference
Release 8.1.5

A66736-01

Library

Product

Contents

Index

Prev Up Next

Command Reference, 9 of 52


ATTRIBUTE

Purpose

Specifies display characteristics for a given attribute of an Object Type column, such as format for NUMBER data.

Also lists the current display characteristics for a single attribute or all attributes.

Syntax

ATTRIBUTE [type_name.attribute_name [option ...]]

where option represents one of the following clauses:

ALI[AS] alias
CLE[AR]
FOR[MAT] format
LIKE {type_name.attribute_name|alias}
ON|OFF

Terms and Clauses

Enter ATTRIBUTE followed by type_name.attribute_name and no other clauses to list the current display characteristics for only the specified attribute. Enter ATTRIBUTE with no clauses to list all current attribute display characteristics.

Refer to the following list for a description of each term or clause:

type_name.attribute_name

      Identifies the data item (typically the name of an attribute) within the set of attributes for a given object of Object Type, type_name.

      If you select objects of the same Object Type, an ATTRIBUTE command for that type_name.attribute_name will apply to all such objects you reference in that session.

ALI[AS] alias

      Assigns a specified alias to a type_name.attribute_name, which can be used to refer to the type_name.attribute_name in other ATTRIBUTE commands.

CLE[AR]

      Resets the display characteristics for the attribute_name. The format specification must be a text constant such as A10 or $9,999--not a variable.

FOR[MAT] format

      Specifies the display format of the column. The format specification must be a text constant such as A10 or $9,999--not a variable.

LIKE {type_name.attribute_name|alias}

      Copies the display characteristics of another attribute. LIKE copies only characteristics not defined by another clause in the current ATTRIBUTE command.

ON|OFF

      Controls the status of display characteristics for a column. OFF disables the characteristics for an attribute without affecting the characteristics' definition. ON reinstates the characteristics.

Usage Notes

You can enter any number of ATTRIBUTE commands for one or more attributes. All attribute characteristics set for each attribute remain in effect for the remainder of the session, until you turn the attribute OFF, or until you use the CLEAR COLUMN command. Thus, the ATTRIBUTE commands you enter can control an attribute's display characteristics for multiple SQL SELECT commands.

When you enter multiple ATTRIBUTE commands for the same attribute, SQL*Plus applies their clauses collectively. If several ATTRIBUTE commands apply the same clause to the same attribute, the last one entered will control the output.

Examples

To make the ENAME attribute of the Object Type EMP_TYPE 20 characters wide, enter

SQL> ATTRIBUTE EMP_TYPE.ENAME FORMAT A20

To format the SAL attribute of the Object Type EMP_TYPE so that it shows millions of dollars, rounds to cents, uses commas to separate thousands, and displays $0.00 when a value is zero, enter

SQL> ATTRIBUTE EMP_TYPE.SAL FORMAT $9,999,990.99

Prev Up Next
Oracle
Copyright © 1999 Oracle Corporation.

All Rights Reserved.

Library

Product

Contents

Index