TimeStamp database parameter
Description
Specifies whether PowerBuilder should map DateTime and Time
datatypes to the Oracle TimeStamp datatype.
Controls
-
OLE DB
-
O90 Oracle9i
-
O10 Oracle 10g
-
ORA Oracle 11g
-
SQLNCLI10
Syntax
1 |
TimeStamp=<span>value</span> |
Parameter |
Description |
---|---|
value |
Specifies whether PowerBuilder should map
|
Default
TimeStamp=1
Usage
Oracle9i and later databases and the
O90 and O10 interfaces support the Oracle timestamp datatype.
This datatype includes the date and the time including milliseconds.
The existing Oracle Date datatype does not
include millisecond information. In a DataWindow object, both the Oracle Timestamp and Date datatypes
are mapped to the PowerBuilder DateTime datatype,
which supports millisecond information.
If you use the O90 or O10 interface with an Oracle9i or
higher server, DateTime and Time datatypes
are mapped to the Oracle TimeStamp datatype
by default. If you want DateTime and Time to
be mapped to the Oracle Date datatype, set
the TimeStamp database parameter to 0.
In PowerBuilder 8 and earlier, millisecond information was truncated
when used with the Oracle Date datatype. In PowerBuilder 9.0
and later, millisecond information is not truncated. As a result,
when performing multiple updates to a DateTime field
that maps to a Date column, the first update
succeeds, but subsequent updates fail with a “row changed
between retrieve and update error.”
If you are using an interface with a database that uses only
the TimeStamp datatype, PowerBuilder handles
updates correctly. If the database uses the Oracle Date datatype
only, set the DbParameter TimeStamp to 0 to truncate millisecond
information.
If you are using a database that uses both Date and TimeStamp datatypes,
you must determine which columns use each datatype, and strip the
milliseconds from the Date columns using code
like the following:
1 |
datetime dt <br>dt=datetime (date(string( today() ,"dd/mm/yyyy")), &<br>   time(string ( today() ,"hh:mm:ss "))) <br>   dw_1.setitem(1,3,dt) |
Examples
To set the TimeStamp value to treat DateTime and
Time DataWindow datatypes as Oracle Date datatypes:
-
Database profile
Clear the Map DateTime/Time to Oracle Timestamp check
box on the Syntax page in the Database Profile Setup dialog box. -
Application
Type the following in code:
1SQLCA.DbParameter="TimeStamp=0"