Home > Net >  PLSQL BLOCK keeps executing
PLSQL BLOCK keeps executing

Time:12-10

DECLARE
    attrbVal VARCHAR2(5);
    updateAttrbVal varchar2(1);
BEGIN
    Select Attrb_val into attrbVal from system_feature_config where feature_attrb = 'Distributor Group';
    DBMS_OUTPUT.PUT_LINE(attrbVal);
    IF (attrbVal = 'ON') then
        updateAttrbVal := '1';
    ELSE
        updateAttrbVal := '0';
    END IF;
        EXECUTE IMMEDIATE 'Update system_feature_config SET Attrb_val= '''||updateAttrbVal||''' WHERE feature_attrb=''VA_STATE_TAX_TYPE''';
    COMMIT;
END;

plsql block keeps executing and have to stop execution manually

CodePudding user response:

If "keeps executing" means that it never finishes, I presume that it is because table to be updated (system_feature_config) has been modified in another session which wasn't committed (or rolled back) yet, so your code has to wait until it is released.

What to do? Commit, or roll back.

  • Related