XenoGuard Documentation

Create Table

Actions » Windows » Database » Create Table 

The action Create Table adds a new table to an existing database and sets column fields to hold data records.


[-] Hide
  1. Open the Windows node in the Workspace Explorer.
  2. Open the Database node, and select the Create Table action.

Parameters:

The action has the following input parameters:


name Description
Connection String
The string used to authenticate and connect to the database.

Allowed Context Scopes [Fixed, Local, Global]
Allowed Context Type [Variable, Parameter, Enum]
Table
The name of the table to be created.

Allowed Context Scope [Fixed, Local, Global]
Allowed Context Type [Variable, Parameter, Enum]
Fields
The fields of the table that are to be created.

Parameters of the Field sub-branch:

  • Name - the given field name
  • Primary Key - the boolean value that sets a field as a primary key
  • Auto Increment - the boolean value that sets the field to auto increment
  • Length - the data length of the field
  • Type - the data type of the field
  • Allow Null - the boolean value that sets the field as required or optional
Allowed Context Scope [Fixed, Local, Global] 
Allowed Context Type [Variable, Parameter, Enum]

Information The "Provider" and "Data Source" must be included in the string to ensure an established connection.

Results:

The action returns the following results:


name
description
Result
The returned boolean value as a result of creating the table.

Accepted Value: True or False

Allowed Context Scope [Fixed, Variable, Global]
Allowed Context Type [Variable, Parameter]

Example 1 (Count the fields of a created database table):

This example creates a connection with a Microsoft Access database named 'customerdb.accdb'. When the connection is established, a database table named 'loans' is then created having five (5) fields and set 'id' field as primary key and applies an auto-increment. The number of fields in the table is then iterated and the last count was incremented to display the correct number of fields. A notice that the table is created is then displayed via Message Box.


See other database operations:

Create Connection
Select Table
Insert Table
Update Table
Delete Table