Time
database parameter
Description
When you update data in the DataWindow painter, PowerBuilder
builds a SQL UPDATE statement in the background. The Time parameter
determines how PowerBuilder specifies a time datatype when it builds the
SQL UPDATE statement.
Applies to
ODBC
O90 Oracle9i
O10 Oracle 10g
ORA Oracle (for 11g and later)
Syntax
The syntax you use to specify the Time 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 time
format.
In code, you must use the following syntax:
ODBC syntax
PowerBuilder parses the backslash followed by two single quotes
(”’) as a single quote when it builds the SQL UPDATE statement:
|
1 |
Time=' '''time_format''' ' |
Oracle syntax
PowerBuilder parses each set of four consecutive single quotes
(””) as a single quote when it builds the SQL UPDATE statement:
|
1 |
Time=' ''''time_format'''' ' |
|
Parameter |
Description |
|---|---|
|
‘
‘ |
ODBC syntax Type a single quote, Oracle Type a single quote, followed by one space, |
|
time_format |
The time format you want PowerBuilder to use when For more on display formats, see |
|
”’ ‘
”” |
ODBC syntax Type a backslash, followed Oracle Type four single quotes, followed by one |
Default value
The default value for Time depends on the DBMS you are
accessing:
|
DBMS |
Date default value |
|---|---|
|
ODBC |
If no value is specified for the Time parameter, |
|
Oracle |
The default Oracle date format. For |
Examples
About these examples
Assume you are updating a table named Workhours by setting the
Start column to 08:30. This time is represented by the following
PowerBuilder time format:
|
1 |
hh:mm |
Example 1 (ODBC syntax)
To specify that PowerBuilder 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 page
in the Database Profile Setup dialog box:1hh:mm -
Application
Type the following in code:
1SQLCA.DBParm="Time=' '''hh:mm''' '"
What happens
PowerBuilder builds the following SQL UPDATE statement to update
the table:
|
1 2 |
UPDATE WORKHOURS SET START='08:30' |
Example 2 (Oracle syntax)
To specify that PowerBuilder should use this format for the time
datatype when it builds the SQL UPDATE statement:
-
Database profile
Type hh:mm in the Time Format box on the Syntax page in the
Database Profile Setup dialog box. -
Application
Type the following in code:
1SQLCA.DBParm="Time=' ''''hh:mm'''' '"
What happens
PowerBuilder builds the following SQL UPDATE statement to update
the table:
|
1 2 |
UPDATE WORKHOURS SET START='08:30' |
See also