Replacing Values in Existing Fields

To replace values of existing fields in a database:

  1. From the menus in the Data Editor window for the dataset that you want to use to replace field values in the database table, choose:

    File > Export to Database

  2. Select the database source. See the topic Selecting a Data Source for more information.
  3. In the Choose how to export the data panel of the Export to Database Wizard, select Replace values in existing fields.
  4. In the Select a table or view panel, select the database table. See the topic Selecting a Table for more information.
  5. In the Match cases to records panel, match the variables that uniquely identify each case to the corresponding database field names. See the topic Matching Cases to Records for more information.
  6. For each field for which you want to replace values, drag and drop the variable that contains the new values into the Source of values column, next to the corresponding database field name.
  • As a general rule, the basic data type (string or numeric) for the variable should match the basic data type of the database field. If there is a data type mismatch that cannot be resolved by the database, an error results and no data is exported to the database. For example, if you export a string variable to a database field with a numeric data type (for example, double, real, integer), an error will result if any values of the string variable contain non-numeric characters. The letter a in the icon next to a variable denotes a string variable.
  • You cannot modify the field name, type, or width. The original database field attributes are preserved; only the values are replaced.

User-Missing Values

There are two options for the treatment of user-missing values when data from variables are exported to database fields:

  • Export as valid values. User-missing values are treated as regular, valid, nonmissing values.
  • Export numeric user-missing as nulls and export string user-missing values as blank spaces. Numeric user-missing values are treated the same as system-missing values. String user-missing values are converted to blank spaces (strings cannot be system-missing).