CARIS HPD : HPD® Server API : Workspaces : P_WORKSPACE_MGMT : ADDUPDATEWORKSPACE
 

ADDUPDATEWORKSPACE

Add or update a workspace definition. This procedure will add a new workspace with the parameters passed if the workspace ID passed is 0. All parameters are mandatory.

Input

Parameter

Type

Description

v_workspace_id

NUMBER

Primary key to workspace to be modified. Use zero to make a new workspace.

v_description

VARCHAR2

The description for the workspace. This is limited to 1000 characters.

v_name

VARCHAR2

Name for the workspace. This is limited to 100 characters.

v_min_x

NUMBER

Longitude coordinate for lower-left corner of workspace

v_min_y

NUMBER

Latitude coordinate for lower-left corner of workspace

v_max_x

NUMBER

Longitude coordinate for upper-right corner of workspace

v_max_y

NUMBER

Latitude coordinate for upper-right corner of workspace

v_usage_id

NUMBER

Primary key of the default usage.

Example

DECLARE

   CURSOR c_wrkspc_info (v_wrkspc_id IN INTEGER) IS

      SELECT *

        FROM workspace

       WHERE workspace_id = v_wrkspc_id;

   v_workspace_id    INTEGER         := &workspace_id;

   v_description     VARCHAR2(1000)  := NULL; -- Add a new description here

   v_name            VARCHAR2(100)   := NULL; -- Add a new name here

   v_usage_id        INTEGER         := NULL; -- Change the default usage here

   -- new max min values

   v_min_long        CONSTANT NUMBER := 1;

   v_min_lat         CONSTANT NUMBER := 1;

   v_max_long        CONSTANT NUMBER := 2;

   v_max_lat         CONSTANT NUMBER := 2;

BEGIN

   FOR REC IN c_wrkspc_info(v_workspace_id) LOOP

      IF v_description IS NULL THEN

         v_description := REC.description;

      END IF;

      IF v_name IS NULL THEN

         v_name := REC.NAME;

      END IF;

      IF v_usage_id IS NULL THEN

         v_usage_id := REC.usage_id;

      END IF;

      p_workspace_mgmt.addupdateworkspace(

         v_workspace_id, v_description, v_name,

         v_min_long, v_min_lat, v_max_long, v_max_lat, v_usage_id);

   END LOOP;

END;

/

Exceptions

None