UPDATE-RECORDS-FROM-INSTANCE
Prev | Object Oriented Data Manipulation Language (OODML) | Next

## Name

UPDATE-RECORDS-FROM-INSTANCE — Update database from view class object.Function

## Syntax

          update-records-from-instance object &key database =>

## Arguments and Values

`object`

  An instance of a View Class.

`database`

  database object. This will default to the value of *default-database*.

## Description

Using an instance of a View Class, `object`, update the table that stores its instance data. `database` specifies the database in which the update is made only if `object` is not associated with a database. In this case, a record is created in the appropriate table of `database` using values from the slot values of `object`, and `object` becomes associated with `database`.

## Examples

    (select [email] :from [employee] :where [= [emplid] 1] :field-names nil :flatp t)
    => ("lenin@soviet.org")
    (defvar *e1* (car (select 'employee :where [= [slot-value 'employee 'emplid] 1] :flatp t)))
    => *E1*
    (slot-value *e1* 'email)
    => "lenin@soviet.org"
    (setf (slot-value *e1* 'email) "v.lenin@soviet.org")
    => "v.lenin@soviet.org"
    (update-records-from-instance *e1*)
    =>
    (select [email] :from [employee] :where [= [emplid] 1] :field-names nil :flatp t)
    => ("v.lenin@soviet.org")

## Side Effects

Modifies the database.

## Affected by

Nothing.

## Exceptional Situations

Database errors.

## See Also

`update-record-from-slot`
`update-record-from-slots`
`update-records`

## Notes

None.

Prev | Up | Next
DELETE-INSTANCE-RECORDS | Home | UPDATE-RECORD-FROM-SLOT