DateFormat database parameter
Description
When you update data in the DataWindow painter, PowerBuilder builds
a SQL UPDATE statement
in the background. The DateFormat parameter determines how PowerBuilder specifies
a date datatype when it builds the SQL UPDATE statement.
Controls
-
ADO.NET
-
OLE DB
-
SNC SQL Native Client for Microsoft SQL Server
Syntax
|
1 |
DateFormat='<span>date_format</span> ' |
|
Parameter |
Description |
|---|---|
|
date_format |
The date format you want PowerBuilder to For more on display formats, see the Users |
Default
If no value is specified for the DateFormat parameter, PowerBuilder does
not use a date datatype.
Usage
When you call stored procedures, the database server might
not accept the date format built by PowerBuilder. If this occurs,
you can try to use another format. For example, for Microsoft SQL Server, try this format:
|
1 |
DateFormat=''''yyyy-mm-dd'''' |
Examples
Assume you are updating a table named Employee by
setting the Startdate column to 2006-04-23. This date is represented
by the date format yyyy-mm-dd.
To specify that PowerBuilder should use this format for the
date datatype when it builds the SQL UPDATE statement:
-
Database
profileType the following in the Date Format box on the Syntax page
in the Database Profile Setup dialog box:1yyyy-mm-dd -
Application
Type the following in code:
1SQLCA.DbParameter="DateFormat='yyyy-mm-dd'"
What happens PowerBuilder builds
the following SQL UPDATE statement
to update the table:
|
1 |
UPDATE EMPLOYEE |
|
1 |
SET STARTDATE='2006-04-23' |