Modifying a column with user-defined datatypes  Errors and warnings generated by alter table modify

Chapter 8: Creating Databases and Tables

Errors and warnings from alter table

Most errors you encounter when running alter table inform you of schema constructs that prevent the requested command (for example, if you try to drop a column that is part of an index). You must fix the errors or warnings that refer to schema objects that depend on the affected column before you reissue the command. To report error conditions:

  1. Set showplan on.

  2. Set noexec on.

  3. Perform the alter table command.

After you have changed the command to address any reported errors, set showplan and noexec to off so that Adaptive Server actually performs the work.

alter table detects and reports certain errors when actually running the command (for example, if you are dropping a column, the presence of a referential constraint). All runtime data-dependent errors (for example, errors of numeric overflow, character truncation, and so on) can be identified only when the statement is executed. You must change the command to fit the data available, or fix the data value(s) to work with the required target datatypes the statement specifies. To identify these errors, you must run the command with noexec turned off.





Copyright © 2005. Sybase Inc. All rights reserved. Errors and warnings generated by alter table modify

View this book as PDF