DateTimeAllowed

Description

For those interfaces that support it, DateTimeAllowed controls whether columns having a DateTime datatype can appear as unique key columns in the WHERE clause of a SQL UPDATE or DELETE statement. PowerBuilder generates an UPDATE statement or a DELETE statement followed by an INSERT statement to update the database from a DataWindow object.

When you are working in the DataWindow painter, you specify which columns to include in the WHERE clause by selecting them from the Unique Key Columns list in the Specify Update Properties dialog box.

By default, DateTimeAllowed is set to 0 to prohibit DateTime columns from displaying in the Unique Key Columns list and consequently from appearing in the WHERE clause of an UPDATE or DELETE statement. When you set DateTimeAllowed to 1, any DateTime columns in your database table display in the Unique Key Columns list and can be selected to appear in the WHERE clause of an UPDATE or DELETE statement.

NoteWhen to specify DateTimeAllowed You must specify a value for DateTimeAllowed before connecting to the database.

Applies to

Syntax

DateTimeAllowed=value

Parameter

Description

value

Specifies whether you can use DateTime columns as unique key columns in a WHERE clause of a SQL UPDATE or DELETE statement generated by PowerBuilder to update the database. Values are:

Default

DateTimeAllowed=0

Usage

When to set To allow the use of DateTime columns as unique key columns in the WHERE clause of an UPDATE or DELETE statement when you are updating the database from a DataWindow object, set DateTimeAllowed to 1.

For instructions on using the Specify Update Properties dialog box to specify update characteristics for a DataWindow object, see the chapter on controlling updates in the Users Guide.

What happens when you save the DataWindow object When you set DateTimeAllowed to 1, select a DateTime column to appear in the WHERE clause, and then save the DataWindow object, this column continues to display in the Unique Key Columns list even if you set DateTimeAllowed to 0 on a subsequent connection.

Examples

Example 1

To allow the use of DateTime columns in the WHERE clause of an UPDATE or DELETE statement: