Lasso Soft Inc. > Home

[Database_CreateTable]

[Database_CreateTable] creates a new table in an existing MySQL database. By calling the [Database_CreateTable] tag and a series of [Database_CreateField] tags a new table can be created entirely in LassoScript.

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 parameter that specifies in which database the table should be created. The database must already exist and the current user must have permission to execute -SQL actions.

The -Table parameter specifies the name of the table to be created.

The table is automatically created with a single field named ID. The field is set to be a primary key field and to auto-increment. In general, this field can be used as the primary key field for the table, or it can be deleted and a new primary key field can be created in its place.

The optional -Temporary parameter allows a temporary table to be created. Temporary tables are deleted when Lasso MySQL or MySQL restarts.

  • Syntax
  • Parameters
[Database_CreateTable: -Database='Database Name'
  -Table='Table Name']

[Database_CreateTable: -Database='Database Name'
  -Table='Table Name',
  -Temporary]
Required Parameters
-Database The name of the database to which the table should be added.
-Table The name of the table which should be added to the specified database.
Optional Parameters
-Temporary If specified, the created table will be temporary.
Examples

To create a new Lasso MySQL Table:

Use the [Database_CreateTable] tag. The following code creates a new table in the Site database named MyPreferences.

[Database_CreateTable: -Database='Site', -Table='MyPreferences']
Tag Link [Database_CreateTable] Category Database
Type Process Data Source MySQL
Support Preferred Version 5.0
Output Type None Security Tag
Implementation LDML Sets Lasso 8.5, Lasso 8.0, Lasso 7.0, Lasso 6.0, Lasso 5.0

Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft