Matching Cases to Records

When adding fields (columns) to an existing table or replacing the values of existing fields, you need to make sure that each case (row) in the active dataset is correctly matched to the corresponding record in the database.

  • In the database, the field or set of fields that uniquely identifies each record is often designated as the primary key.
  • You need to identify which variable(s) correspond to the primary key field(s) or other fields that uniquely identify each record.
  • The fields don't have to be the primary key in the database, but the field value or combination of field values must be unique for each case.

To match variables with fields in the database that uniquely identify each record:

  1. Drag and drop the variable(s) onto the corresponding database fields.

    or

  2. Select a variable from the list of variables, select the corresponding field in the database table, and click Connect.

    To delete a connection line:

  3. Select the connection line and press the Delete key.

Note: The variable names and database field names may not be identical (since database field names may contain characters not allowed in IBM® SPSS® Statistics variable names), but if the active dataset was created from the database table you are modifying, either the variable names or the variable labels will usually be at least similar to the database field names.