CARIS HPD : HPD® Server API : Projects : P_PROJECT_MANAGER : UPDATEPROJECT
 

UPDATEPROJECT

Change the metadata values on an existing project. If an input parameter is set to NULL, that value is not updated.

Input

Parameter

Type

Description

v_project_id

NUMBER

The primary key value of the project.

v_new_created_by

NUMBER

The ID of the user that created the project. Use NULL to leave the existing value unchanged.

v_new_name

VARCHAR2

The name of the project. This is limited to 50 characters. Use NULL to leave the existing value unchanged.

v_new_workorder

VARCHAR2

New work order value. This is limited to 100 characters. Use NULL to leave the existing value unchanged.

v_new_startdate

DATE

A date field. Specifies the date that the project was started. Use NULL to leave the existing value unchanged.

v_new_time

VARCHAR2

New expected time to complete project. This is limited to 10 characters. Use NULL to leave the existing value unchanged.

v_new_project_type

NUMBER

The ID of the project type from the lookup table project_type. Use NULL to leave the existing value unchanged.

v_new_status_id

NUMBER

The ID of the project status from the lookup table project_status. Use NULL to leave the existing value unchanged.

v_new_priority_id

NUMBER

The ID of the project priority from the lookup table sourceregistry_priority. Use NULL to leave the existing value unchanged.

v_external_id

VARCHAR2

The ID of a record external to HPD. Used to link a project to an external database or workflow system. This is limited to 50 characters. Use NULL to leave the existing value unchanged.

v_assignedusers

hpdnumber$table_type

A list of IDs of users who can work on the project.

Example 1

declare

  v_project_ID       CONSTANT PROJECT.PJ_ID%TYPE := 3;

  v_new_created_by   CONSTANT HPD_USER_VW.USER_ID%TYPE:= 4; -- user_id

  v_NEW_NAME         CONSTANT PROJECT.PJ_NAME%TYPE := 'Load Data TEST 2B';

  v_NEW_WORKORDER    CONSTANT PROJECT.PJ_WORK_ORDER%TYPE := 'WO-133-TEST';

  v_NEW_STARTDATE    CONSTANT PROJECT.PJDATE_STARTED%TYPE := SYSDATE+5;

  v_NEW_TIME         CONSTANT PROJECT.PJ_PLANNED_PROCESS_TIME%TYPE := NULL;

  v_NEW_PROJECT_TYPE CONSTANT PROJECT.PTE_PROJECT_TYPE_ID%TYPE := NULL;

  v_NEW_STATUS_ID    CONSTANT PROJECT_certification.PROJECT_STATUS_ID%TYPE := NULL;

  v_NEW_PRIORITY_ID  CONSTANT PROJECT.SPY_PRIORITY_ID%TYPE := NULL;

  v_EXTERNAL_ID      CONSTANT project.external_id%type := NULL;

  v_assigned_user1   CONSTANT HPD_USER_VW.USER_ID%TYPE := 5;

  v_assigned_users   HPDNUMBER$TABLE_TYPE := hpdnumber$table_type();

begin

  v_assigned_users.extend(1);

  v_assigned_users(1) := hpdnumber$row_type(v_assigned_user1);

  P_PROJECT_MANAGER.UPDATEPROJECT(v_project_ID,

    v_new_created_by,

    v_NEW_NAME,

    v_NEW_WORKORDER,

    v_NEW_STARTDATE,

    v_NEW_TIME,

    v_NEW_PROJECT_TYPE,

    v_NEW_STATUS_ID,

    v_NEW_PRIORITY_ID,

    v_EXTERNAL_ID,

    v_assigned_users);

end;

/

Example 2

Only the attributes being updated need to be referenced in the function call. This example shows how to change the assigned to user.

declare

  in_project_id    CONSTANT PROJECT.PJ_ID%TYPE := 3;

  v_assigned_user1 CONSTANT HPD_USER_VW.USER_ID%TYPE := 5;

  v_assigned_users CONSTANT HPDNUMBER$TABLE_TYPE :=

                    hpdnumber$table_type(hpdnumber$row_type(v_assigned_user1));

begin

  p_project_manager.updateproject(

    v_project_id => in_project_id,

    v_assignedusers => v_assigned_users);

end;

/

Exceptions

Input project ID does not exist.

Could not get record linked to PROJECT_ID.

Input project type does not exist.

Input status type does not exist.

Input priority ID does not exist.

Input assigned created by user does not exist.

Input assigned to user does not exist.

Input project name is already used by another project.

No changes detected to make to project.

Error in UPDATEPROJECT: (SQL code).