Project and Portfolio Management Practitioners Forum
cancel

Insert Or Delete user in Resource Pool with use sql script.

SOLVED
Go to solution
Highlighted
RsmARSLN
Regular Contributor.

Insert Or Delete user in Resource Pool with use sql script.

Hi,

 

I want to resource add or delete in resource pool with use sql script. Is it impossible?. I have added resource in RSC_RP_DISTRIBUTION_ENTRIES table but this is not working. Can I add record other table?

 

 

Thanks a lot.

2 REPLIES
Erik Cole
Acclaimed Contributor.
Solution

Re: Insert Or Delete user in Resource Pool with use sql script.

Hi...it's possible, but you also have to insert in KNTA_PENDING_ROLLUPS too so it will recalculate the pool capacity. Here is an example snippet:

        insert into RSC_RP_DISTRIBUTION_ENTRIES
        (
            RP_DISTRIBUTION_ENTRY_ID
          , VERSION
          , START_TIME
          , DISTRIBUTION_PERCENT
          , RESOURCE_POOL_ID
          , RESOURCE_ID
          , CREATED_BY
          , CREATION_DATE
          , LAST_UPDATED_BY
          , LAST_UPDATE_DATE
          , RESOURCE_DIST_SEQ
        ) VALUES
        (
           RSC_RP_DISTRIBUTION_ENTRIES_S.nextval
         , 0 -- Version
         , to_date(substr(l_START_DATE,1,10), 'YYYY-MM-DD')
         , 100
         , l_pool_id
         , l_resource_id
         , 1
         , l_date
         , 1
         , l_date
         , 0
        );
       
     insert into knta_pending_rollups
     (   CREATED_BY
       , CREATION_DATE
       , LAST_UPDATED_BY
       , LAST_UPDATE_DATE
       , PENDING_ROLLUP_ID
       , PERIOD_ID
       , RESOURCE_USER_ID
       , SOURCE_ENTITY_ID
       , SOURCE_ENTITY_PRIMARY_KEY
       , TARGET_ENTITY_ID
       , TARGET_ENTITY_PRIMARY_KEY
     ) values
     (    1
        , l_date
        , 1
        , l_date
        , KNTA_PENDING_ROLLUPS_S.nextval
        , NULL -- Period ID
        , l_resource_id
        , 410 -- Resource
        , l_resource_id
        , 405 -- Resource Pool
        , l_pool_id
     );

RsmARSLN
Regular Contributor.

Re: Insert Or Delete user in Resource Pool with use sql script.

Hi Erik,

 

Thanks a lot. It is working.

 

Have Good day.