LassoScript Utility
Basics Browse Detail

[Database_RemoveColumn]

Tag Link [Database_RemoveColumn] Category Database
Type Process Source Available Yes
Support Synonym 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

Description

[Database_RemoveColumn] removes a field from an existing MySQL database table. Any data in the specified field will be permanently destroyed.

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 -SQL command tag.

This tag requires a -Database and a -Table parameters that specify the database and table from which the field should be deleted. The current user must have permission to execute -SQL actions.

The -Field parameter specifies the name of the field to be deleted.

Syntax

[Database_RemoveColumn:
  -Database='Database Name',
  -Table='Table Name',
  -Field='Field Name']

Parameters

Required Parameters
-Database The name of the database from which the field should be removed.
-Table The name of the table from which the field should be removed.
-Field The name of the field to be removed.

Examples

To remove a field from a Lasso MySQL Table:

Use the [Database_RemoveColumn] tag. The following code removes a field named CreationDate from the MyPreferences table in the Site database.

All of the data in this field as wll as all the field definition will be removed permanently. There is no way to undo this action.

[Database_RemoveColumn-Database='Site', 
  -Table='MyPreferences',
  -Field='CreationDate']