Chapter 3 DBMS Reference Guide


Defining an extended attribute in a DBMS

Each extended attribute has the following properties:

Entry property Description
Name Name of category or entry
Comment Description of selected category or entry
Data type Predefined or user-defined extended attributes types
Default value Default value from the list of values. This depends on the selected data type

Steps To add an extended attribute:

  1. Right-click a metaclass category in the Profile category and select New→Extended Attributes from the contextual menu.

    A new extended attribute is created.
  2. Type a name in the Name box.
  3. Type a comment in the Comment box.
  4. Select a data type from the Data Type dropdown list box.
  5. <optional> Select a default value in the Default Value dropdown list box.
  6. Click Apply.

Example

In DB2 UDB 7 OS/390, extended attribute WhereNotNull allows you to add a clause that specifies that index names must be unique provided they are not null.

In the Create index order, WhereNotNull is evaluated as shown below:

create [%INDEXTYPE% ][%UNIQUE% [%WhereNotNull%?where not null ]]index [%QUALIFIER%]%INDEX% on [%TABLQUALIFIER%]%TABLE% (

%CIDXLIST%

)

[%OPTIONS%]

If the index name is unique, and if you set the type of the WhereNotNull extended attribute to True, the "where not nul" clause will be inserted in the script.

In the SqlListQuery entry:

{OWNER, TABLE, INDEX, INDEXTYPE, UNIQUE, INDEXKEY, CLUSTER, WhereNotNull}

select 
   tbcreator,
   tbname,
   name,
   case indextype when '2' then 'type 2' else 'type 1' end,
   case uniquerule when 'D' then '' else 'unique' end, 
   case uniquerule when 'P' then 'primary' when 'U' then 'unique' else '' end, 
   case clustering when 'Y' then 'cluster' else '' end,
   case uniquerule when 'N' then 'TRUE' else 'FALSE' end
from
   sysibm.sysindexes 
where 1=1
[  and tbname=%.q:TABLE%]
[  and tbcreator=%.q:OWNER%]
[  and dbname=%.q:CATALOG%]
order by
   1 ,2 ,3

 


Copyright (C) 2005. Sybase Inc. All rights reserved.