RENAME

Syntax

RENAME {RECORD record | FIELD {field | record.field}}  AS new_name;

Description

Renames a PeopleSoft record, a field in one record, or a field in all records.

Note:

This command is not available in bootstrap mode.

WARNING:

Using RENAME only modifies a definition in the PeopleSoft tables. To write the record and field change to the system tables, you must use Application Designer to modify the affected definitions.

To rename a record field, you must qualify the original name of the field with the record name. If you don't qualify the record name, PeopleSoft Data Mover attempts to globally change the field name in all records.

Renaming a record field is only possible through PeopleSoft Data Mover.

To rename a record field:

  1. Perform the rename in PeopleSoft Data Mover.

    For example:

    RENAME FIELD RECORD.FIELD AS NEWFIELD; COMMIT;
  2. In Application Designer, create a project that includes the record that contains the field that you renamed, and save the project.

    In the case of a subrecord field rename, the subrecord along with all tables that contain that subrecord must be inserted into the project.

  3. Select Build, Settings.

    • Select the Alter tab.

    • Select Adds and Renames.

    • Clear Changes and Deletes.

      Note:

      Drop column and change column length do not apply.

    • Select the Scripts tab and select output settings.

    • Specify an output file and click OK.

  4. Select Build, Project.

    • Select Alter Tables (Create Indexes is selected by default).

    • Click Build.

    • Click Yes to continue the build process.

  5. Run the generated SQL script using the query tool.

    This adds the new field to the tables within the project.

    Note:

    For subrecord field renames only, data is not automatically migrated from the old field to the new field. You will need to migrate this data manually.

To remove the old field from the tables:

  1. In Application Designer, open the project that you created using the preceding steps.

    • Select Build, and then Settings.

    • Select the Alter tab.

    • Select Drop column if data present.

    • Select Deletes.

    • Clear Adds and Renames.

    • Select the Scripts tab.

    • Give the output file a different name and click OK.

  2. Select Build, Project.

    • Select Alter Tables (Create Indexes is automatically selected).

    • Click Build.

    • Click Yes to continue the build process.

  3. Run the generated SQL script using the query tool.

    The old field should no longer appear on the tables included in the project.

Parameters

LOG, NO COMMIT, and NO TRACE.

Example

Here's an example of how to rename a record:

RENAME RECORD absence_hist AS absent_hist;

Here's an example of how to globally rename a field:

RENAME FIELD effdt AS currdate;

Here's an example of how to rename a recfield:

RENAME FIELD course_tbl.duration_days AS duration_d;