<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>https://wiki.sftserv.ru/index.php?action=history&amp;feed=atom&amp;title=ALTER_TABLE</id>
		<title>ALTER TABLE - История изменений</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.sftserv.ru/index.php?action=history&amp;feed=atom&amp;title=ALTER_TABLE"/>
		<link rel="alternate" type="text/html" href="https://wiki.sftserv.ru/index.php?title=ALTER_TABLE&amp;action=history"/>
		<updated>2026-05-13T17:38:27Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.26.3</generator>

	<entry>
		<id>https://wiki.sftserv.ru/index.php?title=ALTER_TABLE&amp;diff=30733&amp;oldid=prev</id>
		<title>Hisava: Новая страница: «Advantage SQL Engine  This is the first topic  This is the last topic  Feedback on: Advantage Database Server - ALTER TABLE Advantage SQL Engine master_Alter_tabl…»</title>
		<link rel="alternate" type="text/html" href="https://wiki.sftserv.ru/index.php?title=ALTER_TABLE&amp;diff=30733&amp;oldid=prev"/>
				<updated>2018-09-03T07:33:37Z</updated>
		
		<summary type="html">&lt;p&gt;Новая страница: «Advantage SQL Engine  This is the first topic  This is the last topic  Feedback on: Advantage Database Server - ALTER TABLE Advantage SQL Engine master_Alter_tabl…»&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Advantage SQL Engine&lt;br /&gt;
 This is the first topic  This is the last topic  Feedback on: Advantage Database Server - ALTER TABLE Advantage SQL Engine master_Alter_table Advantage Web Development &amp;gt; Django &amp;gt; Advantage Django Backend / Dear Support Staff, Mail us feedback on this topic!    &lt;br /&gt;
ALTER TABLE&lt;br /&gt;
&lt;br /&gt;
Advantage SQL Engine&lt;br /&gt;
 This is the first topic  This is the last topic  Mail us feedback on this topic!    &lt;br /&gt;
Modifies the structure of a table and adds or deletes column constraints&lt;br /&gt;
&lt;br /&gt;
Syntax&lt;br /&gt;
&lt;br /&gt;
ALTER TABLE &amp;lt;table-name&amp;gt;&amp;lt;action&amp;gt;[&amp;lt;action&amp;gt;…]&lt;br /&gt;
&lt;br /&gt;
action ::= ADD [COLUMN] &amp;lt;column-info&amp;gt; [&amp;lt;position-info&amp;gt;] |&lt;br /&gt;
&lt;br /&gt;
ALTER [COLUMN] &amp;lt;original-column-identifier&amp;gt; &amp;lt;column-info&amp;gt; [&amp;lt;position-info&amp;gt;] |&lt;br /&gt;
&lt;br /&gt;
ALTER [COLUMN] &amp;lt;column-identifier&amp;gt; DROP &amp;lt;drop-column-constraint&amp;gt; |&lt;br /&gt;
&lt;br /&gt;
DROP [COLUMN] &amp;lt;column-identifier&amp;gt; |&lt;br /&gt;
&lt;br /&gt;
DROP &amp;lt;drop-table-constraint&amp;gt;&lt;br /&gt;
&lt;br /&gt;
column-identifier ::= A user defined column name.&lt;br /&gt;
&lt;br /&gt;
original-column-identifier ::= The existing (or original) user-defined column name.&lt;br /&gt;
&lt;br /&gt;
column-info ::= &amp;lt;column-identifier&amp;gt; &amp;lt;data-type&amp;gt; [&amp;lt;vfp-option&amp;gt;…] [&amp;lt;column-constraints&amp;gt;… ]&lt;br /&gt;
&lt;br /&gt;
data-type ::= type-name | type-name (integer) | type-name (integer, integer)&lt;br /&gt;
&lt;br /&gt;
type-name ::= A supported data type (see the next section Supported Data Types).&lt;br /&gt;
&lt;br /&gt;
position-info ::= [ POSITION integer ] A 1 based index of the column’s position in the table after the restructure.&lt;br /&gt;
&lt;br /&gt;
column constraints ::=&lt;br /&gt;
 [CONSTRAINT NOT NULL] |&lt;br /&gt;
&lt;br /&gt;
[CONSTRAINT MINIMUM &amp;lt;max-column-value&amp;gt;] |&lt;br /&gt;
&lt;br /&gt;
[CONSTRAINT MAXIMUM &amp;lt;min-column-value&amp;gt;] |&lt;br /&gt;
&lt;br /&gt;
[CONSTRAINT ERROR MESSAGE &amp;lt;error-message&amp;gt;] |&lt;br /&gt;
&lt;br /&gt;
[DEFAULT &amp;lt;default-column-value&amp;gt;]&lt;br /&gt;
 &lt;br /&gt;
vfp-option ::=&lt;br /&gt;
 NULL | NOT NULL | NOCPTRANS&lt;br /&gt;
&lt;br /&gt;
These options apply to Visual FoxPro tables (ADS_VFP) and can be used with free tables and data dictionary tables. The NULL (and NOT NULL) option indicate whether the column will be able to physically hold a NULL value. This is different from a NOT NULL constraint. If a Visual FoxPro column is created without the NULL option, then an error will be generated if an attempt is made to store a NULL in that column. The NOCPTRANS option applies to Visual FoxPro character and memo field types. If this option is provided, the data will not be translated across codepages (ANSI/OEM conversions).&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
drop-column-constraint::= NOT NULL | MINIMUM | MAXIMUM | ERROR MESSAGE | DEFAULT&lt;br /&gt;
&lt;br /&gt;
drop-table-constraint ::= [CONSTRAINT] PRIMARY KEY&lt;br /&gt;
&lt;br /&gt;
error-message ::= A string literal to be returned as the error message when the column constraints are violated.&lt;br /&gt;
&lt;br /&gt;
max-column-value ::= A string literal (i.e., surrounded by single quotes) containing an Advantage expression. The evaluated expression result must be of the same type as the column type. The result will be used as the maximum value for the column. (For more information about expressions, see Advantage Expression Engine.)&lt;br /&gt;
&lt;br /&gt;
min-column-value ::= A string literal (i.e., surrounded by single quotes) containing an Advantage expression. The evaluated expression result must be of the same type as the column type. The result will be used as the minimum value for the column. (For more information about expressions, see Advantage Expression Engine.)&lt;br /&gt;
&lt;br /&gt;
default-column-value::= A string literal (i.e., surrounded by single quotes) containing an Advantage expression. The evaluated expression result must be of the same type as the column type. The result will be used as default value for the column when new records are added or the ADS_DD_RI_SETDEFAULT rule is used in referential integrity. (For more information about expressions, see Advantage Expression Engine.)&lt;br /&gt;
&lt;br /&gt;
Remarks&lt;br /&gt;
&lt;br /&gt;
If the table is a database table, that is, if the table is associated with an Advantage Data Dictionary, the table can only be altered by users with ALTER permissions for that specific table. If the table is free table, the table can only be altered on a free connection.&lt;br /&gt;
&lt;br /&gt;
If dropping a primary key table-constraint, the primary key setting for the associated index will be set to False. The index will still remain, however. Should the index need to be removed, use the DROP INDEX statement.&lt;br /&gt;
&lt;br /&gt;
Note When restructuring a table and changing an integer field to an auto increment (autoinc) field type, Advantage does not verify the uniqueness of the existing integer values. It preserves the existing values and sets the next auto increment value (for the next appended record) to be the maximum existing integer value plus one. You can test the uniqueness of integer field values prior to changing the structure of the table by building a unique index on the field.&lt;br /&gt;
&lt;br /&gt;
Example&lt;br /&gt;
&lt;br /&gt;
ALTER TABLE salesreps ADD COLUMN region char(40)&lt;br /&gt;
&lt;br /&gt;
ALTER TABLE customers ADD address3 char(40) ADD COLUMN refund integer&lt;br /&gt;
&lt;br /&gt;
ALTER TABLE orders ALTER COLUMN price price curdouble&lt;br /&gt;
&lt;br /&gt;
ALTER TABLE offices ALTER COLUMN mgr mgr integer DEFAULT '104'&lt;br /&gt;
&lt;br /&gt;
ALTER TABLE salesreps ALTER name name char(40) CONSTRAINT NOT NULL&lt;br /&gt;
&lt;br /&gt;
ALTER TABLE demo10&lt;br /&gt;
&lt;br /&gt;
ADD COLUMN test char(20)&lt;br /&gt;
&lt;br /&gt;
 DEFAULT ‘abcde’&lt;br /&gt;
&lt;br /&gt;
 CONSTRAINT MINIMUM ‘A’&lt;br /&gt;
&lt;br /&gt;
 CONSTRAINT MAXIMUM ‘z’&lt;br /&gt;
&lt;br /&gt;
 CONSTRAINT NOT NULL&lt;br /&gt;
&lt;br /&gt;
CONSTRAINT error message ‘A bad value was input for the column named test’ &lt;br /&gt;
&lt;br /&gt;
ADD COLUMN test2 SHORT&lt;br /&gt;
&lt;br /&gt;
 DEFAULT ‘45’&lt;br /&gt;
&lt;br /&gt;
 CONSTRAINT MINIMUM ‘2’&lt;br /&gt;
&lt;br /&gt;
 CONSTRAINT MAXIMUM ‘169’&lt;br /&gt;
&lt;br /&gt;
 CONSTRAINT NOT NULL&lt;br /&gt;
&lt;br /&gt;
 CONSTRAINT error message ‘An invalid values was set in the column named test2’&lt;br /&gt;
&lt;br /&gt;
ALTER COLUMN lastname lastnamechanged char(40)&lt;br /&gt;
&lt;br /&gt;
 DEFAULT ‘Donahue’&lt;br /&gt;
&lt;br /&gt;
 CONSTRAINT MINIMUM ‘A’&lt;br /&gt;
&lt;br /&gt;
 CONSTRAINT MAXIMUM ‘Z’&lt;br /&gt;
&lt;br /&gt;
 CONSTRAINT error message ‘An invalid lastnamechanged was input’&lt;br /&gt;
&lt;br /&gt;
ALTER COLUMN firstname firstnamechanged char(30)&lt;br /&gt;
&lt;br /&gt;
DROP deptnum&lt;br /&gt;
&lt;br /&gt;
DROP dateofhire&lt;br /&gt;
&lt;br /&gt;
ALTER table demo10&lt;br /&gt;
&lt;br /&gt;
ALTER COLUMN lastnamechanged DROP DEFAULT &lt;br /&gt;
&lt;br /&gt;
ALTER COLUMN lastnamechanged DROP MINIMUM &lt;br /&gt;
&lt;br /&gt;
ALTER COLUMN lastnamechanged DROP MAXIMUM &lt;br /&gt;
&lt;br /&gt;
ALTER COLUMN lastnamechanged DROP error message &lt;br /&gt;
&lt;br /&gt;
ALTER COLUMN lastnamechanged DROP NOT NULL &lt;br /&gt;
&lt;br /&gt;
ALTER TABLE table1 DROP CONSTRAINT PRIMAY KEY&lt;br /&gt;
&lt;br /&gt;
ALTER TABLE table1 DROP PRIMARY KEY&lt;/div&gt;</summary>
		<author><name>Hisava</name></author>	</entry>

	</feed>