BEGIN DECLARE l_instance_no number; BEGIN SELECT instance_number INTO l_instance_no FROM v$instance; INSERT INTO OWBSYS.OWBRTPS(key, value) VALUES ('%vers[' || l_instance_no || ']','%home'); COMMIT; EXCEPTION WHEN DUP_VAL_ON_INDEX THEN DBMS_OUTPUT.PUT_LINE('OWBRTPS entry already exists for %vers['||l_instance_no||']'); END; END; /