CARIS HPD : HPD® Server API : Source Data : P_HPDSOURCEAPI : SETFEATUREATTRIBUTE
 

SETFEATUREATTRIBUTE

Changes the value of a feature attribute. This can change or set an attribute to UNDEFINED or UNKNOWN, or some other value.

Input

Parameter

Type

Description

v_foid

NUMBER

The feature object identifier (FOID) as a number. See FOID Conversion Functions.

v_attributeAcronym

VARCHAR2

The attribute acronym of the attribute to change.

v_value

CLOB

The value of the attribute.

v_setUnknown

BOOLEAN

TRUE - Sets the value to Unknown. Mutually exclusive with v_setUndefined. FALSE - Does nothing.

v_setUndefined

BOOLEAN

TRUE - Sets the value to Undefined. Mutually exclusive with v_setUnknown. FALSE - Does nothing.

v_task_id

NUMBER

The ID of the task created for the transaction. See AddTask.

To set an attribute to UNKNOWN:

v_value = NULL

v_setUnknown = TRUE

v_setUndefined = FALSE.

To set an attribute to UNDEFINED:

v_value = NULL

v_setUnknown = FALSE v_setUndefined = TRUE.

To set an attribute to any other value:

v_value is not NULL

v_setUnknown = FALSE

v_setUndefined = FALSE.

The value will be parsed depending upon the type of attribute being processed:

List attributes are expected to be in the S-57 format with "," and "/" separators. For example, "1,2/3,4"

Enumeration and list values are expected as their numeric values. For example, COLOUR "3" instead of "red".

Numeric attributes must be numeric.

Output

Type

Description

NUMBER

The id of the feature version created by the modification.

Example

The following example shows the use of this function in a PL/SQL block.

declare

  v_project_id      CONSTANT NUMBER := 1;

  foid              CONSTANT NUMBER := foidStringToNumber('1C 0000009949 00001');

  acronym           CONSTANT objectclass_vw.acronym%type := 'OBJNAM';

  value             CONSTANT CLOB := 'object name';

  v_task_id         task.task_id%type;

  v_rwf_id          NUMBER;

begin

   P_SAVE_MANAGER.StartNewSave(v_project_id);

   v_task_id := P_SAVE_MANAGER.AddTask('your comments here');

   v_rwf_id := P_HPDSOURCEAPI.SetFeatureAttribute(

      foid, acronym, value, false, false, v_task_id);

   DBMS_OUTPUT.PUT_LINE('--*-- New Feature Version ID: ' || v_rwf_id);

end;

/

Exceptions

FOID cannot be NULL.

FOID 'FOID' does not exist.

FOID 'FOID' is not current.

ACRONYM cannot be NULL.

Attribute Acronym 'ACRONYM' does not exist.

setUnknown cannot be NULL.

setUndefined cannot be NULL.

SetUnknown and setUndefined cannot both be TRUE.

Value cannot be NULL when setUnknown and setUndefined are FALSE.

Value must be NULL when setUnknown or setUndefined are TRUE.

The attribute acronym 'ACRONYM' is not allowed on this object in the current profile.

Task ID cannot be NULL.

Task ID 'TASK_ID' does not exist.

Feature 'FOID' is Proposed Deleted.

Value 'VALUE' must be an integer.

Value 'VALUE' must be a real number.

Value 'VALUE' is not valid for this attribute.

User 'USERNAME' must have the 'Source Editor (Source)' role.

User is not authorized

Feature 'FOID' is locked by another user/process.