When you update data in the DataWindow painter, PocketBuilder builds a SQL UPDATE statement in the background. The Time DBParm parameter determines how PocketBuilder specifies a time 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 time 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:
Time = ' \''time_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 time format. |
time_format |
The time 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 time format and the backslash. |
If no value is specified for the Time DBParm parameter, PocketBuilder looks for a time format in the section for your ODBC driver in the pkodb25 initialization file. If it finds no time format in the pkodb25 initialization file, PocketBuilder uses the ODBC time format escape sequence.
Assume you are updating a table named Workhours by setting the Start column to 08:30. This time is represented by the following PocketBuilder time format:
hh:mm
To specify that PocketBuilder should use this format for the time datatype when it builds the SQL UPDATE statement:
Database profile Type the following in the Time Format box on the Syntax tab in the Database Profile Setup dialog box:
hh:mm
PocketBuilder application script Type the following in a PocketBuilder application script:
SQLCA.dbParm = "Time = ' \''hh:mm\'' '"
What happens PocketBuilder builds the following SQL UPDATE statement to update the table:
UPDATE WORKHOURS
SET START = '08:30'