Tag Link | [Database_ChangeField] | Category | Database |
---|---|---|---|
Type | Process | Source Available | Yes |
Support | Preferred | Version | 5.0 |
Change | Unchanged | Data Source | Lasso MySQL |
Output Type | None | Security | Tag |
Implementation | LDML | Sets | Lasso 8.5, Lasso 8.0, Lasso 7.0, Lasso 6.0, Lasso 5.0 |
[Database_ChangeField] changes an existing field in a MySQL database table. The syntax is very similar to [Database_CreateField] with the addition of an
This tag is certified to work with Lasso MySQL and MySQL data sources. It may also work with third party data sources that support the
This tag requires a
The
The
An optional default value for the field can be specified in the
The field is modified in place by default. The
Key fields can be created by specifying the option
A field can be set to accept NULL values by specifying the
The valid MySQL data types are as follows:
Integers: TINYINT, SMALLINT, MEDIUMINT, INT, BIGINT. Each integer type can also be unsigned as in TINYINT UNSIGNED.
Decimals: FLOAT, DOUBLE, DECIMAL(Length, Precision).
Strings: CHAR(Length), VARCHAR(Length), TINYTEXT, MEDIUMTEXT, TEXT, LONGTEXT.
Binary: CHAR(Length) BINARY, VARCHAR(Length) BINARY, TINYBLOB, MEDIUMBLOB, BLOB, LONGBLOB.
Dates: DATETIME, TIMESTAMP, DATE, TIME, YEAR.
[Database_ChangeField:
[Database_ChangeField:
[Database_ChangeField:
Required Parameters | |
---|---|
-Database | The name of the database in which the field should be modified. |
-Table | The name of the table in which the field should be modified. |
-Field | The new name of the field being modified. |
-Original | The name of the field which should be modified. |
-Type | The MySQL type of the field which should be added. |
-NotNull | Specifies that null values should not be allowed in the field. Cannot be used in conjunction with |
Optional Parameters | |
-Default | The default value the field should be set to on new records if no specific value for the field is defined. |
-AutoIncrement | If specified, the field will auto |
-Key | If specified, the field will be set as the primary key for the table. Only one primary key can exist per table. |
-Null | Specifies that null values are allowed in the field. The default. |
-AfterField | The name of the field after which this field should be created. Defaults to adding the field to the end of the table. Cannot be used in conjunction with |
-BeforeFirst | Specifies that the field should be inserted before the first field in the table. Cannot be used in conjunction with |
To change an existing field in a Lasso MySQL Table:
Use the [Database_ChangeField] tag. The following code changes the CreationDate field in the MyPreferences table of the Site database by adding the
[Database_ChangeField: