DateTime – PB Docs 2017

DateTime

database parameter

Description

When you update data in the DataWindow painter,
PowerBuilder builds a SQL UPDATE statement in the background. The
DateTime parameter determines how PowerBuilder specifies a DateTime
datatype when it builds the SQL UPDATE statement. (A DateTime datatype
contains both a date value and a time value.)

Applies to

JDB JDBC

ODBC

O90 Oracle9i

O10 Oracle 10g

ORA Oracle 11g

Syntax

The syntax you use to specify the DateTime 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
DateTime format.

In code, you must use the following syntax:

JDBC and ODBC syntax

PowerBuilder parses the backslash followed by two single quotes
(”’) as a single quote when it builds the SQL UPDATE statement.

Oracle syntax

PowerBuilder parses each set of four consecutive single quotes
(””) as a single quote when it builds the SQL UPDATE statement.

Parameter

Description


”’

 

 

 

‘ ””

JDBC and 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 DateTime 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.

DateTime_format

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

For more on display formats, see the
the section called “Defining display formats” in Users Guide.

”’ ‘

 

 

 

”” ‘

JDBC and 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 DateTime format and the four single
quotes.

Default value

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

DBMS

Date default value

JDBC

If no value is specified for the DateTime database
parameter, PowerBuilder looks for a DateTime format in the
section for your JDBC driver in the registry. If no DateTime
format is found in the registry, PowerBuilder uses the JDBC
DateTime format escape sequence.

ODBC

If no value is specified for the DateTime database
parameter, PowerBuilder looks for a DateTime format in the
section for your ODBC driver in the PBODB170 initialization
file. If no DateTime format is found in the initialization file,
PowerBuilder uses the ODBC DateTime format escape
sequence.

Oracle

The default Oracle DateTime format.

For
information, see your Oracle documentation.

Examples

About these examples

Assume you are updating a table named Files by setting the
Timestamp column to 4/2/06 3:45 pm. This DateTime is represented by the
following DateTime format:

Example 1 (JDBC, ODBC, and OLE DB
syntax)

To specify that PowerBuilder should use this format for the
DateTime datatype when it builds the SQL UPDATE statement:

  • Database profile

    Type the following in the DateTime Format box on the Syntax
    page in the Database Profile Setup dialog box:

  • Application

    Type the following in code:

What happens

PowerBuilder builds the following SQL UPDATE statement to update
the table:

Example 2 (Oracle syntax)

To specify that PowerBuilder should use this format for the
DateTime datatype when it builds the SQL UPDATE statement:

  • Database profile

    Type the following in the DateTime Format box on the Syntax
    page in the Database Profile Setup dialog box:

  • Application

    Type the following in code:

What happens

PowerBuilder builds the following SQL UPDATE statement to update
the table:

See also

Date

Time


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x