
    mytype = myname[0, 2]
    link = mytype + blname[0, 2]
    if link == "PHPH"
        raise "slotlink between two phones does not make sense"
    end
    if link == "PHHS" || link == "HSPH"
        raise "link of phone to hub does not make sense"
    end
    if link == "PHIF" || link == "IFPH"
        raise "link of phone to hub does not make sense"
    end
    if link == "PSWS" || link == "WSPS"
        raise "slotlink from patchslot to wallslot not permitted"
    end
    rel = case mytype
          when "PS"
              "PSlot"
          when "WS"
              "WSlot"
          when "IF"
              "IFace"
          when "HS"
              "HSlot"
          when "PH"
              "PHone"
          else
              raise "illegal slotlink beginning with <#{mytype}>"
          end
    rec = PL.exec("select * from #{rel} where slotname = '#{myname}'", 1)
    if ! rec
        raise "#{myname} does not exists in #{rel}"
    end
    if rec["slotlink"] != blname
       PL.exec("update #{rel} set slotlink = '#{blname}'
                    where slotname = '#{myname}'")
    end
