# Defining a schema in a Job script

Use the addSchema {} function to define a schema in a Job script.

## addSchema {} properties

| Function/parameter | Description | Mandatory? |
| --- | --- | --- |
| NAME | Give a name to the schema. | Yes |
| CONNECTOR | Type in the connection type of the schema, for example: FLOW,<br>REJECT, and so on. | Yes |
| addColumn {} | Add a column to your schema and define its parameters:<br><br><ul> <li> <span>NAME</span>: Type in the label of the column.</li> <li> <span>TYPE</span>: Type in the type of data contained in this column.</li> <li> <span>KEY</span> (optional): Define the column as the primary key by setting                this parameter to <kbd>true</kbd>.</li> <li> <span>NULLABLE</span> (optional): Define the column as nullable by setting                this parameter to <kbd>true</kbd>.</li> <li> <span>DEFAULTVALUE</span> (optional): Type in the default value of the column                if no value is retrieved at Job execution.</li> <li> <span>LENGTH</span> (optional): Type in the length of the column.</li> <li> <span>PRECISION</span> (optional): Defines the number of digits to the right                of the decimal point.</li> <li> <span>COMMENT</span> (optional): Type in any useful comment.</li> </ul><br><br>You can use this function to add as many columns as your schema needs. | Yes |

## Example

The following Job script example defines a schema for component tFileInputDelimited\_1, which contains two columns: firstName and lastName, both of type String.

```
	addSchema {
		NAME: "tFileInputDelimited_1",
		CONNECTOR: "FLOW"
		addColumn {
			NAME: "firstName",
			TYPE: "id_String"
		}
		addColumn {
			NAME: "lastName",
			TYPE: "id_String"
		}
	}
```