Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / December 2005

Tip: Looking for answers? Try searching our database.

Help- Migrating timestamp from Sybase to DB2

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
pankaj_wolfhunter@yahoo.co.in - 09 Dec 2005 06:50 GMT
Greetings,
                In Sybase, a timestamp column is automatically loaded
by the DB engine and its in some hex format. This is shown below

id          timestamp_value
----------- ------------------
          1 0x0000000000001031
          1 0x0000000000001046

when i try to load this timestamp data into DB2 timestamp column, it
gives me incorrect format for the datetime value.
I know this hex value is giving me problem. From the Sybase, the
timestamp field always yields data into hex fields only.
I just want to know any workaround where i can import or load this hex
timestamp data into db2 timestamp column without any error?

Any help will be appreciated

TIA
Joe Weinstein - 09 Dec 2005 16:49 GMT
> Greetings,
>                  In Sybase, a timestamp column is automatically loaded
[quoted text clipped - 15 lines]
>
> TIA

Sybase's timestamp column has nothing to do with human times and dates.
The Sybase DATETIME column type is for that. A Sybase timestamp column
is for OPTIMISTIC LOCKING, so you can read a row without locking it,
and later do a transaction that says 'WHERE timestampcol = XXX' (XXX is
the value you read before). This will only update the row if some other
transaction has not altered it since you read it.
That's the purpose. If your application uses that column, you will have
to do some deeper understanding of your application, and likely have
to alter it's SQL and/or augment DB2 to implement this sort of behavior.

Joe Weinstein at BEA
Serge Rielau - 10 Dec 2005 01:15 GMT
>> Greetings,
>>                  In Sybase, a timestamp column is automatically loaded
[quoted text clipped - 27 lines]
>
> Joe Weinstein at BEA

Ah.... In that case I propose an IDENTITY column in conjuction with a
BEFORE UPDATE trigger. a SET versionid = DEFAULT; on the identity column
will force re-issuance.

Cheers
Serge

Signature

Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab

pankaj_wolfhunter@yahoo.co.in - 10 Dec 2005 03:04 GMT
thnx for the replies.
Joe, i didnt quite get u. i mean if we have a column with that data
type and
we want to migrate it, how exactly should i do it.
i mean can u ellaborate on that with some example.

TIA
Joe Weinstein - 10 Dec 2005 16:28 GMT
> thnx for the replies.
> Joe, i didnt quite get u. i mean if we have a column with that data
[quoted text clipped - 3 lines]
>
> TIA

Serge posted a way to do the DBMS-side implementation, but it seems
you have the job of porting an application from one DBMS to another,
and that is much more complicated a task than simply creating tables.
You fundamentally have to understand how your application is using
the Sybase timestamp column (and likely many other design semantics)
before you have a hope of a successful performant conversion.
   The DBMS is never a simple row store in any performant application,
and what works well in one DBMS type works differently or not at all
in another.
Joe Weinstein at BEA Systems
pankaj_wolfhunter@yahoo.co.in - 12 Dec 2005 03:13 GMT
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.