postgresql7.1
select coalesce(a.column_name, a.attribute_name) as name,
a.pretty_name, a.attribute_id, a.datatype,
v.enum_value, v.pretty_name as value_pretty_name
from acs_object_type_attributes a left outer join
acs_enum_values v using (attribute_id),
(select t.object_type, tree_level(t.tree_sortkey) - tree_level(t2.tree_sortkey) as type_level
from acs_object_types t, acs_object_types t2
where t2.object_type = :start_with
and t.tree_sortkey between t2.tree_sortkey and tree_right(t2.tree_sortkey)) t
where a.object_type = :object_type
and t.object_type = a.ancestor_type $storage_clause
order by type_level, a.sort_order
select *
from ($package_object_view) dummy
where object_id = :object_id
select acs_attribute__drop_attribute(:object_type, :attribute_name)
select acs_attribute__create_attribute (
'$object_type',
'$attribute_name',
'$datatype',
'$pretty_name',
'$pretty_plural',
NULL,
NULL,
'$default_value',
'$min_n_values',
'$max_n_values',
NULL,
'type_specific',
'f'
);
select acs_attribute__drop_attribute(:object_type, :attribute_name, :drop_table_column_p)