Date

Description

When you update data in the DataWindow painter, DataWindow Designer builds a SQL UPDATE statement in the background. The Date parameter determines how DataWindow Designer specifies a date datatype when it builds the SQL UPDATE statement.

Applies to

Syntax

The syntax you use to specify the Date parameter differs slightly depending on the database.

The Database Profile Setup dialog box inserts special characters (quotes and backslashes) where needed, so you can specify just the date format.

In code, you must use the following syntax:

ODBC syntax DataWindow Designer parses the backslash followed by two single quotes (\'') as a single quote when it builds the SQL UPDATE statement.

Date=' \''date_format\'' '

Oracle syntax DataWindow Designer parses each set of four consecutive single quotes ('''') as a single quote when it builds the SQL UPDATE statement.

Date=' ''''date_format'''' '

Parameter

Description

' \''

' ''''

ODBC syntax Type a single quote, followed by one space, followed by a backslash, followed by two single quotes. There is no space between the two single quotes and the beginning of the date format.

Oracle syntax Type a single quote, followed by one space, followed by four single quotes. There is no space between the four single quotes and the beginning of the date format.

date_format

The date format you want DataWindow Designer to use when it builds a SQL UPDATE statement to update a data source in the DataWindow painter.

For more on display formats, see the User’s Guide.

\'' '

'''' '

ODBC syntax Type a backslash, followed by two single quotes, followed by one space, followed by a single quote. There is no space between the end of the date format and the backslash.

Oracle syntax Type four single quotes, followed by one space, followed by a single quote. There is no space between the end of the date format and the four single quotes.

Default

The default value for Date depends on the DBMS you are accessing, as summarized in the following table:

DBMS

Date default value

ODBC

If no value is specified for the Date parameter, DataWindow Designer looks for a date format in the section for your ODBC driver in the PBODB110 initialization file. If no date format is found in the initialization file, DataWindow Designer uses the ODBC date format escape sequence.

Oracle

The default Oracle date format.

For information, see your Oracle documentation.

Examples

About these examples

Assume you are updating a table named Employee by setting the Startdate column to 2006-04-23. This date is represented by the following date format:

yyyy-mm-dd

Example 1 (ODBC syntax)

To specify that DataWindow Designer should use this format for the date datatype when it builds the SQL UPDATE statement:

What happens DataWindow Designer builds the following SQL UPDATE statement to update the table:

UPDATE EMPLOYEE

SET STARTDATE='2006-04-23'

Example 3

Example 2 (Oracle syntax) To specify that DataWindow Designer should use this format for the date datatype when it builds the SQL UPDATE statement:

What happens DataWindow Designer builds the following SQL UPDATE statement to update the table:

UPDATE EMPLOYEE

SET STARTDATE='2006-04-23'

See also