
    mytype = myname[0, 2]
    link = mytype + blname[0, 2]
    if link == "PLPL"
        raise "backlink between two phone lines does not make sense"
    end
    if link == "PLWS" || link == "WSPL"
        raise "direct link of phone line to wall slot not permitted"
    end
    rel = case mytype
          when "PS"
              "PSlot"
          when "WS"
              "WSlot"
          when "PL"
              "PLine"
          else
              raise "illegal backlink beginning with #{mytype}"
          end
    rec = PL.exec("select * from #{rel} where slotname = '#{myname}'", 1)
    if ! rec
        raise "#{myname} does not exist in #{rel}"
    end
    if rec["backlink"] != blname
       PL.exec("update #{rel} set backlink = '#{blname}'
                    where slotname = '#{myname}'")
    end
