When you update data in the DataWindow painter, PocketBuilder builds a SQL UPDATE statement in the background. The Date DBParm parameter determines how PocketBuilder specifies a date datatype when it builds the SQL UPDATE statement.
ODBC
The Database Profile Setup dialog box inserts special characters (quotes and backslashes) where needed, so you can specify just the date format.
In a PocketBuilder application script, you must use the following syntax. PocketBuilder parses the backslash followed by two single quotes (' \'') as a single quote when it builds the SQL UPDATE statement.
Date = ' \''date_format\'' '
Parameter |
Description |
---|---|
' \'' |
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. |
date_format |
The date format you want PocketBuilder 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 Users Guide. |
\'' ' |
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. |
If no value is specified for the Date DBParm parameter, PocketBuilder looks for a date format in the section for your ODBC driver in the pkodb25 initialization file. If no date format is found in the initialization file, PocketBuilder uses the ODBC date format escape sequence.
Assume you are updating a table named Employee by setting the Startdate column to 2007-04-23. This date is represented by the following date format:
yyyy-mm-dd
To specify that PocketBuilder should use this format for the date datatype when it builds the SQL UPDATE statement:
Database profile Type the following in the Date Format box on the Syntax tab in the Database Profile Setup dialog box:
yyyy-mm-dd
PocketBuilder application script Type the following in a PocketBuilder application script:
SQLCA.dbParm = "Date = ' \''yyyy-mm-dd\'' '"
What happens PocketBuilder builds the following SQL UPDATE statement to update the table:
UPDATE EMPLOYEE
SET STARTDATE = '2007-04-23'