
erase(+Key, ?Value)

   Succeeds if the term Value associated with key Key is removed as an entry
in the indexed database.



Arguments
   +Key                Atom or compound term.
   ?Value              Any Prolog term.

Type
   Recorded Database

Description
   Finds the first term associated with Key that can be unified with Value
   and removes its entry from the indexed database.  It fails if such an
   entry cannot be found.  If Value is uninstantiated, the first value
   under the key Key is removed.  In the case of compound terms, all keys
   of the same name and arity are treated as equal.  Backtracking through
   calls of erase/2 does not undo an erasure.




Resatisfiable
      No.

Fail Conditions
      Fails if Value associated with Key is not a record in the indexed
   database.



Exceptions
     4 --- Key is not instantiated.
     5 --- Key is neither an atom nor a compound term.

Examples
   
   Success:
   [eclipse]: record(whiskey,jameson),
   >        record(whiskey,bushmills),
   >        record(whiskey,glenfiddich),
   >        record(whiskey,dimple).
   yes.
   [eclipse]: erase(whiskey,dimple),erase(whiskey,Value).
   Value = jameson
   yes.
   [eclipse]: recorded(whiskey,L).
   L = bushmills     More? (;)
   L = glenfiddich     More? (;)
   no (more) solution.
   Fail:
   erase(whiskey,jameson).
   Error:
   erase(Key,anything).                   (Error 4)
   erase("whiskey",anything).             (Error 5)





See Also
   erase_all / 1
