/wiki/spaces/QG/pages/24674321

Overview
Offers the ability to INSERT and UPDATE Reporting Entities. Performs all data validations and returns a status code and error message. The update function will update ALL columns, so if a column is not passed in the function will update it to NULL. The functions are:
Function Name | Purpose |
---|
insert_entity | Inserts entity into the reporting_entities table. | update_entity | Updates entity in the reporting_entities table. | delete_entity | Deletes entity from the reporting_entities table. |
|
reporting_entities_api.INSERT_ENTITY()
- Function returns BOOLEAN to indicate a successful/unsuccessful action.
- Default values on parameters indicate that the parameter is optional and the default value will be inserted into the corresponding column.
Parameter | In/Out | Type | Default Value |
---|
i_hierarchy_code | IN | VARCHAR2(10) |
| i_reporting_level_code | IN | VARCHAR2(10) |
| i_reporting_entity_code | IN | VARCHAR2(10) |
| i_reporting_entity_desc | IN | VARCHAR2(240) |
| i_parent_reporting_level_code | IN | VARCHAR2(10) |
| i_parent_reporting_entity_code | IN | VARCHAR2(10) |
| i_reporting_entity_location | IN | VARCHAR2(20) |
| o_reporting_entity_id | OUT | NUMBER(10) |
| o_return_status
*procedure only | OUT | VARCHAR2 | Possible values: | o_return_code | OUT | NUMBER | Possible values: - 0 – Success
- -20001 – Handled Application Error
- -20000 – Generic Error
| o_return_message | OUT | VARCHAR2 | Insert ‘Successful’ or ‘Failure’ or error message |
|
reporting_entities_api.UPDATE_ENTITY()
- Function returns BOOLEAN to indicate a successful/unsuccessful action
- Default values on parameters indicate that the parameter is optional and the default value will be inserted into the corresponding column.
Parameter | In/Out | Type | Default Value |
---|
i_reporting_entity_id | IN | NUMBER(10) |
| i_reporting_entity_desc | IN | VARCHAR2(240) |
| i_parent_reporting_entity_code | IN | VARCHAR2(10) |
| i_reporting_entity_location | IN | VARCHAR2(20) |
| o_return_status
*procedure only | OUT | VARCHAR2 | Possible values: | o_return_code | OUT | NUMBER | Possible values: - 0 – Success
- -20001 – Handled Application Error
- -20000 – Generic Error
| o_return_message | OUT | VARCHAR2 | Insert ‘Successful’ or ‘Failure’ or error message |
|
reporting_entities_api.DELETE_ENTITY()
- Function returns BOOLEAN to indicate a successful/unsuccessful action.
- Default values on parameters indicate that the parameter is optional and the default value will be inserted into the corresponding column.
Parameter | In/Out | Type | Default Value |
---|
i_reporting_entity_id | IN | NUMBER(10) |
| o_return_status
*procedure only | OUT | VARCHAR2 | Possible values: | o_return_code | OUT | NUMBER | Possible values: - 0 – Success
- -20001 – Handled Application Error
- -20000 – Generic Error
| o_return_message | OUT | VARCHAR2 | Insert ‘Successful’ or ‘Failure’ or error message |
|
Error Messages for ENTITY() Functions
Message | Explanation |
---|
Hierarchy Code does not exist | The specified Hierarchy code cannot be found. | Invalid AFE | The AFE specified is invalid. | Invalid CC | The Cost Centre specified is invalid. | This record has children attached to it. Delete not allowed | The entity has children attached to it in the hierarchy. An entity may only be deleted when there are no children. | This reporting/entity combination is attached to a budget entity | Make sure there are no budget entity accounts attached to the reporting entity id. | This Reporting/Entity combination is attached to a budget Derivation | Make sure there are no derivation rules attached. | xxxx must be supplied | Required value is NULL or not included in parameters. | Invalid Reporting Level Code and Hierarchy Code combination | The Reporting Level Code and Hierarchy Code combination provided is invalid. | Invalid Parent Reporting Level Code | The Parent Reporting Level Code supplied is invalid. | Invalid Parent Entity Code | The Parent Entity Code supplied is invalid. | Reporting Entity does not exist | The Reporting Entity supplied does not exist. | Hierarchy Code/Reporting Level Code/Reporting Entity Code combination already exists | The Hierarchy, Reporting Level, and Reporting Entity Codes already exist in the specified combination. |
|