Skip to content

Dynamic Procedures

This RMB will show you what the dynamic procedure will look like when you start the migration job. To be able to perform procedures with different parameter-layouts dynamically, we have made a standard encapsulation for them.
Procedures will be compiled when the job starts and will be removed depending on Rule definitions.

Naming convention

The name of stored procedures will follow this naming-convention: IC_<Job-ID>_ExecuteSequence.

In-parameters

The procedures have following parameters:

info_          IN OUT VARCHAR2,   
objid_         IN OUT VARCHAR2,   
objversion_    IN OUT VARCHAR2,   
attr_          IN OUT VARCHAR2,   
arg_attr_      IN VARCHAR2,   
in_action_     IN VARCHAR2

Local variables

All of the procedures parameters ( except for those who match the standard parameters above) are declared as local variables.

ARG_ATTR

This attribute-string will contain all IN-parameters for the procedure in question. This attribute-string will be unpacked and values stored in the local variables before executing the procedure itself.

Return-values

After the procedure has been executed, all OUT-variables are packed into the standard attribute-string and returned to MethodList for storage

Example

CREATE OR REPLACE PROCEDURE IC_MODINV_8 (  
    info_ IN OUT VARCHAR2,  
    objid_ IN OUT VARCHAR2,  
    objversion_ IN OUT VARCHAR2,  
    attr_ IN OUT VARCHAR2,  
    arg_attr_ IN VARCHAR2,  
    in_action_ IN VARCHAR2)  
IS  
    ptr_ NUMBER;  
    name_ VARCHAR2(30);  
    value_ VARCHAR2(2000);  
    action_ VARCHAR2(2000) := in_action_;  
    --  
    contract_ VARCHAR2(32000);  
    part_no_ VARCHAR2(32000);  
    purch_leadtime_ NUMBER;  
BEGIN  
    WHILE (Client_SYS.Get_Next_From_Attr(arg_attr_, ptr_, name_, value_)) LOOP  
        IF ( name_ = 'CONTRACT_' ) THEN  
            contract_:= Client_SYS.Get_Item_Value('CONTRACT_',arg_attr_);  
        ELSIF ( name_ = 'PART_NO_' ) THEN  
            part_no_:= Client_SYS.Get_Item_Value('PART_NO_',arg_attr_);  
        ELSIF ( name_ = 'PURCH_LEADTIME_' ) THEN  
            purch_leadtime_:= Client_SYS.Attr_Value_To_Number(  
                                Client_SYS.Get_Item_Value('PURCH_LEADTIME_',arg_attr_));  
        END IF;  
    END LOOP;  
    --  
    INVENTORY_PART_API.MODIFY_PURCH_LEADTIME(  
        contract_,  
        part_no_,  
        purch_leadtime_);  
    --  
END IC_MODINV_8;