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

ADDPROJECT

Add a new direct project to the HPD database.

Input

Parameter

Type

Description

v_created_by_in

NUMBER

ID of the user that created the project.

v_project_name

VARCHAR2

Name of the project. This is limited to 50 characters.

v_work_order

VARCHAR2

Assigned work order value. This is limited to 100 characters.

v_start_date

DATE

Date field. Specifies the date that the project was started.

v_process_time

VARCHAR2

Expected duration to process. This is limited to 10 characters.

v_type_in

NUMBER

ID of the project type from the lookup table project_type .

v_status_in

NUMBER

ID of the project status from the lookup table project_status .

v_priority_in

NUMBER

ID of the project priority from the lookup table sourceregistry_priority .

v_geom

sdo_geometry

Cover area of interest for this project.

v_external_id

VARCHAR2

ID of a record external to HPD. This is limited to 50 characters.

v_assignedusers

hpdnumber$table_type

List of IDs of users who can work on the project.

v_default_usage

NUMBER

Primary key of default usage.

Output

Type

Description

NUMBER

Primary key value of the newly created project.

Example

declare

  v_project_id     PROJECT.PJ_ID%TYPE;

  v_created_by     project.created_by%type := 1; -- user_id

  v_project_name   project.pj_name%type := 'test project';

  v_work_order     project.pj_work_order%type := 'WO-1001';

  v_start_date     project.pjdate_started%type := sysdate;

  v_process_time   project.pj_planned_process_time%type := '24 days';

  v_type_id        project.pte_project_type_id%type := 1;

  v_status_id      project_certification.project_status_id%type := 1;

  v_priority_id    project.spy_priority_id%type := 1;

  v_geom           project.geom%type := NULL;

  v_external_id    project.external_id%type := 1;

  v_assigned_user1 CONSTANT HPD_USER_VW.USER_ID%TYPE := 3;

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

  v_default_usage  usage.usage_id%type := NULL;

  

begin

  v_assigned_users.extend(1);

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

  v_project_id := p_project_manager.addproject(

                     v_created_by, v_project_name, v_work_order,

                     v_start_date, v_process_time,

                     v_type_id, v_status_id,

                     v_priority_id, v_geom,

                     v_external_id, v_assigned_users, v_default_usage );

  dbms_output.put_line('--*-- Created direct project ID: '|| v_project_id);

end;

/

Exceptions

• Project name cannot be null.

• Input project type does not exist.

• Input project status does not exist.

• Project start date cannot be null.

• Input project priority does not exist.

• Input responsible user ID does not exist.

• Input project name is already used by an existing project