SET SERVEROUTPUT ON
SET FEEDBACK OFF
SET DEFINE ON

SPOOL &file_path/usermanager.log

PROMPT SETTING USER MANAGER IP and PORT

DECLARE
    ip_addr_   VARCHAR2(255);
    port_      VARCHAR2(255);
BEGIN
    ip_addr_ := '&IP_ADDRESS';
    port_    := '&PORT';

    IF (length(ip_addr_) > 0 AND length(port_) > 0) THEN
        UPDATE prm_system
        SET paramvalue = ip_addr_
        WHERE paramid = 'USERMANAGERIP';

        UPDATE prm_system
        SET paramvalue = port_
        WHERE paramid = 'USERMANAGERPORT';
        COMMIT;
        dbms_output.put_line('USER MANAGER SET TO ' || ip_addr_ || ':' || port_);
    ELSE
        dbms_output.put_line('UPDATE FAILED, NO VALUE SPECIFIED');
    END IF;
END;
/
SET FEEDBACK ON
SET SERVEROUTPUT OFF
SPOOL OFF
