To use the DeleteMetadata method to delete an object
from a SAS Metadata Repository, submit a metadata property string
identifying the object that you want to delete in the method's INMETADATA
parameter. Specify the SAS namespace in the NS parameter, and set
the OMI_TRUSTED_CLIENT (268435456) flag in the FLAGS parameter.
When a SAS namespace
metadata type is specified for removal, the server responds as follows:
-
If the specified metadata type
is a PrimaryType subtype in the SAS Metadata Model, the server checks
to see whether the object has a value in the PublicType attribute.
If a value is found, and it matches the TypeName value in a type definition
in the SAS type dictionary, the server deletes the specified object
and any associated objects that are indicated for the object in the
type definition, unless you specify a user-defined template.
The purpose of
the SAS type dictionary is to hide the details of an object’s
logical metadata definition from clients. You can override the SAS
type dictionary by setting the OMI_TEMPLATE (4) flag, and submitting
a user-defined template.
-
If the specified metadata type is a
PrimaryType subtype and the PublicType attribute does not have a value,
or is a SecondaryType subtype in the SAS Metadata Model, then only
the specified object and any associated objects that have a 1..1 association
to the object are deleted, unless you specify a user-defined template.
An object that is a
SecondaryType subtype in the SAS Metadata Model is considered to be
owned by a PrimaryType object, and is thus deleted when the PrimaryType
object is deleted, although it does not have to be. SecondaryType
subtypes and PrimaryType subtypes that do not store a value in the
PublicType attribute are treated as independent objects by the DeleteMetadata
method.
DeleteMetadata is typically
used to delete one metadata entity at time (logical metadata definition
or independent object). If you want to delete two or more entities,
specify additional property strings in the INMETADATA parameter.
Note: When you specify multiple
independent objects, take care not to specify associated objects that
have a 1..1 cardinality in the same DeleteMetadata request. A 1..1
cardinality indicates a required relationship. When one object in
the association is deleted, the metadata server automatically deletes
the other object as well. If you specify the partner object for deletion,
the metadata server attempts to locate objects that have already
been deleted, and cancels the Delete operation when they are not found.
You can prevent the operation from being canceled by setting the OMI_IGNORE_NOTFOUND
(134217728) flag, but it is better to avoid specifying the associated
objects instead.
DeleteMetadata does not list the IDs of associated object
instances that are deleted by default. To include them in the output
listing, set the OMI_RETURN_LIST (1024) flag.