Adding a column to an UltraLite table

You can add a new column easily if the table is empty. However, if the table already holds data, you can only add a column
if the column definition includes a default value or allows NULL values.

You can use either Sybase Central or execute a SQL statement (for example, Interactive SQL) to perform this task.

Sybase Central

In Sybase Central, you can perform this task while working with a selected table.

To add a new column to an UltraLite table (Sybase Central)

Connect to the UltraLite database.

In the left pane, double-click Tables.

Double-click a table.

Click the Columns tab, right-click the white space below the table and choose New » Column.

Set the attributes for the new column.

From the File menu, choose Save Table.

Interactive SQL

In Interactive SQL, you can only declare columns while creating or altering a table.

To add columns to a new UltraLite table (Interactive SQL)

Connect to the UltraLite database.

Execute a CREATE TABLE statement or ALTER TABLE, ensuring that you define columns by declaring the name, and other attributes
accordingly.

The following example creates a table for a library database to hold information about borrowed books. The default value for
date_borrowed indicates that the book is borrowed on the day the entry is made. The date_returned column is NULL until the
book is returned.