[ Recorded Database | Reference Manual | Alphabetic Index ]

# referenced_record(+DBRef, -Value)

Succeeds if Value is the Term recorded under the database reference DBRef.

DBRef
  A database reference.
Value
  An arbitrary term.

## Description

The database reference DBRef must refer to a term that has previously been recorded in the record database. Database references can be obtained from the predicates recorda/3, recordz/3 and recorded/3. Value is unified with a copy of the recorded term. Note that this is the case even if the original database entry has been removed since the database reference was obtained (logical update semantics).

### Modes and Determinism

- referenced_record(+, -) is det

### Exceptions

(4) instantiation fault
  DBRef is not instantiated.
(5) type error
  DBRef is neither a variable nor a database reference.

## Examples

       [eclipse]: recordz(beer, paulaner, Ref), referenced_record(Ref, X).
       Ref = $&(dbref,"370gf3")
       X = paulaner
       yes.

       [eclipse]: recorded(beer, _, Ref), referenced_record(Ref, X).
       Ref = $&(dbref,"370gw3")
       X = paulaner     More? (;)
       yes.

       [eclipse]: recorded(beer, _, Ref), erase(Ref), referenced_record(Ref, X).
       Ref = $&(dbref,"370gw3")
       X = paulaner     More? (;)
       yes.

    Error:
       referenced_record(_, Value).         (Error 4)
       referenced_record(123, Value).       (Error 5)

## See Also

recorda / 3, recordz / 3, recorded / 3, erase / 1, referenced_record / 2