Migrating Sybase "timestamp" data type to Oracle DB

Hi,
We are migrating huge Application currently running on Sybase database
to Oracle 10.2.0.3 (500+ Tables and Stored Procedures).
Have following questions regarding this Migration.
1) Many of the Sybase Tables have column which is of Sybase data type "timestamp".
Do you have any recommendation what is the data type to be used in Oracle for
migrating "timestamp" data type in Sybase?
2) How should we migrate existing data and business logic residing in Sybase for
data columns of Sybase data type "timestamp" ?
Given below are details on how we use Sybase timestamp Column in our Application
and we are trying to arrive at the best Solution that is possible for migrating
all those Tables and related business logic to Oracle.
We have following Control Table in Sybase which has column of timestamp data type and
some other Business keys.
sp_help EQP_IES_CRE_TIMESTAMP (This is similar to desc <table> command in Oracle)
EQP_IES_CRE_TIMESTAMP,dbo,user table
default,Nov 14 2001 10:39AM
CRE_TIMESTAMP ,timestamp,8,,,0,,,,0
REF_NUM ,char,30,,,0,,,,0
REC_UPD_DT ,datetime,8,,,1,,,,0
EQP_IES_CRE_TIMESTAMPI1,clustered, unique located on default, CRE_TIMESTAMP, REF_NUM, REC_UPD_DT,0,0,0,
Following is the overall logic used in Sybase
-- Step 1: Based on Event, populate Control Table with new Row.
-- CRE_TIMESTAMP timestamp Column gets auto-populated by Sybase
insert EQP_IES_CRE_TIMESTAMP (REF_NUM, REC_UPD_DT)
values (@uuid_ref_num, @event_cre_dt)
Since CRE_TIMESTAMP is auto-populated, it does not appear in above INSERT statement.
-- Step 2: Store timestamp value populated by Sybase in previous step,
-- to variable @event_timestamp. This value would be referenced
-- later in other SQL statements
select @event_timestamp = CRE_TIMESTAMP
from EQP_IES_CRE_TIMESTAMP
where REF_NUM = @uuid_ref_num
and REC_UPD_DT = @event_cre_dt
-- Sample value for @event_timestamp could be '001c0000182f2089'
-- It is not very readable or understandable
-- Step 3: Delete Control Table entry made in Step 1
delete EQP_IES_CRE_TIMESTAMP from EQP_IES_CRE_TIMESTAMP
where CRE_TIMESTAMP = @event_timestamp
-- Step 4: Make use of saved timestamp value from Step 2 to trigger queries
-- against other Tables that have timestamp Columns
-- Some sample queries are as shown below
delete eqp_staging
where event_timestamp > @event_timestamp;
insert into eqp_movement values(@event_timestamp, ......other columns) ;
Any idea how above Table and logic could be migrated to Oracle DB
We would also like to know how data values that currently exist
in Sybase Tables should be populated in Oracle .
Any suggestions or tips would be greatly appreciated
Thanks
Auroprem

Hi All,
Thanks for your responses.
We have decided on Solution to migrate "timestamp" Column from Sybase to Oracle, that is
specific to our Application needs.
Following is what we decided:
1) Create RAW Column in Oracle which would contain data Replicated from Sybase "timestamp" Column as is.
2) Create additional Column of INTEGER data type to store number equivalent of Sybase "timestamp" column
which would be more usable and consummable in Oracle as compared to RAW datatype.
3) Write Row-Level INSERT/UPDATE Trigger on migrated Oracle Table to populate INTEGER Column using
SQL Function TO_NUMBER(<raw_column_value>, 'xxxxxxxx').
4) Applications that access this Table, upon migration to Oracle, will now start referencing INTEGER Column
newly defined, and populated via Trigger.
Please let us know if you see any issues with this approach
Thanks
user641521

Similar Messages

  • How to migrate SQL Server image data type to Oracle 8 BLOB data type?

    Hi,
    I have to migrate data from sql server to Oracle 10 g.
    I am unable to migrate image data type from sql server to blob data type in oracle.
    Iam using Oracle Heterogenous Services to migrate the data,Using Merge statement and database link.
    I am getting the following error-
    ERROR at line 7:
    ORA-00932: inconsistent datatypes: expected BLOB got LONG BINARY
    Can any one suggest me how to migrate Image datatype to BLOB???

    Hi you might want to post your question in General Forum.
    General Database Discussions
    There's very few users visit this forum.

  • ....Date Type in Oracle

    Hi All,
    Just to clear a few misconception/ambiguities regarding the DATE data type in Oracle.
    We hve a table which stores the date of insertion of a record. The front end application is in PHP while backend is in oracle.
    When i query the table, it shows the date as dd-mon-yy , but it does not show the time. I have tried to query it throgh sqlPLus , TOAD and the PHP Application, but it doesnt show the time.
    Is it not storing the time. The data type of the column is ( Insertdate date).
    If you query sysdate, it definitly stores time, ... but what is in this case. Is it just storing the date and not the time. ???
    How to alter so that it stores time as well.
    Regards

    U have to use the conversion function to_date to
    store date along with time. No, you use to_date to convert a string to a date. That's it. A date column will ALWAYS store the time (it just won't always display it)
    When u need to retrieve the data use to_char function. Not necessarily:
    SQL> create table x (dte date);
    Table created.
    SQL> insert into x values(sysdate);
    1 row created.
    SQL> insert into x values(sysdate+1);
    1 row created.
    SQL> select * from x;
    DTE
    11-jul-2007 09:13:11
    12-jul-2007 09:13:11
    if u want to store time u can use timestamp data typeNope, You use timestamp if you want to store fractions of seconds (down to nano seconds)
    The key point is. The date datatype ALWAYS stores:
    Century, Year, Month, Day, Hour, Minute, Second

  • UNDERSTAND THE NEW DATE AND TIME DATA TYPES IN ORACLE 9I

    제품 : SQL*PLUS
    작성날짜 : 2001-08-01
    UNDERSTAND THE NEW DATE AND TIME DATA TYPES IN ORACLE 9I
    ========================================================
    PURPOSE
    Oracle 9i 에서 소개되는 새로운 datetime data type 에 대해 소개한다.
    Explanation
    Example
    1. Datetime Datatypes
    1) TIMESTAMP
    : YEAR/MONTH/DAY/HOUR/MINUTE/SECOND
    2) TIMESTAMP WITH TIME ZONE
    : YEAR/MONTH/DAY/HOUR/MINUTE/SECOND/
    TIMEZONE_HOUR/TIMEZONE_MINUTE( +09:00 )
    or TIMEZONE_REGION( Asia/Seoul )
    3) TIMESTAMP WITH LOCAL TIME ZONE
    : YEAR/MONTH/DAY/HOUR/MINUTE/SECOND
    4) TIME WITH TIME ZONE
    : HOUR/MINUTE/SECOND/TIMEZONE_HOUR/TIMEZONE_MINUTE
    2. Datetime Fields
    1) YEAR/MONTH/DAY/HOUR/MINUTE
    2) SECOND(00 to 59.9(N) is precision) : Range 0 to 9, default is 6
    3) TIMEZONE_HOUR : -12 to 13
    4) TIMEZONE_MINUTE : 00 to 59
    5) TIMEZONE_REGION : Listed in v$timezone_names
    3. DATE 와 TIMESTAMP 와의 차이점
    SQL> select hiredate from emp;
    HIREDATE
    17-DEC-80
    20-FEB-81
    SQL> alter table employees modify hiredate timestamp;
    SQL> select hiredate from employees;
    HIREDATE
    17-DEC-80 12.00.00.000000 AM
    20-FEB-81 12.00.00.000000 AM
    단, 해당 Column 에 Data 가 있다면 DATE/TIMESTAMP -> TIMESTAMP WITH
    TIME ZONE 으로 Convert 할 수 없다.
    SQL> alter table employees modify hiredate timestamp with time zone;
    alter table employees modify hiredate timestamp with time zone
    ERROR at line 1:
    ORA-01439: column to be modified must be empty to change datatype
    4. TIMESTAMP WITH TIME ZONE Datatype
    TIMESTAMP '2001-05-24 10:00:00 +09:00'
    TIMESTAMP '2001-05-24 10:00:00 Asia/Seoul'
    TIMESTAMP '2001-05-24 10:00:00 KST'
    5. TIMESTAMP WITH LOCAL TIME ZONE Datatype
    SQL> create table date_tab (date_col TIMESTAMP WITH LOCAL TIME ZONE);
    SQL> insert into date_tab values ('15-NOV-00 09:34:28 AM');
    SQL> select * from date_tab;
    DATE_COL
    15-NOV-00 09.34.28.000000 AM
    SQL> alter session set TIME_ZONE = 'EUROPE/LONDON';
    SQL> select * from date_tab;
    DATE_COL
    15-NOV-00 12.34.28.000000 AM
    6. INTERVAL Datatypes
    1) INTERVAL YEAR(year_precision) TO MONTH
    : YEAR/MONTH
    : Year_precision default value is 2
    SQL> create table orders (warranty interval year to month);
    SQL> insert into orders values ('2-6');
    SQL> select warranty from orders;
    WARRANTY
    +02-06
    2) INTERVAL DAY (day_precision) TO SECOND (fractional_seconds_precision)
    : DAY/HOUR/MINUTE/SECOND
    : Logon time 확인시 주로 사용
    : day_precision range 0 to 9, default is 2
    SQL> create table orders (warranty interval day(2) to second);
    SQL> insert into orders values ('90 00:00:00');
    SQL> select warranty from orders;
    WARRANTY
    +90 00:00:00.000000
    7. Interval Fields
    - YEAR : Any positive or negative integer
    - MONTH : 00 to 11
    - DAY : Any positive or negative integer
    - HOUR : 00 to 23
    - MINUTE : 00 to 59
    - SECOND : 00 to 59.9(N) where 9(N) is precision
    8. Using Time Zones
    1) Database operation
    - Defined at CREATE DATABASE
    - Can be altered with ALTER DATABASE
    - Current value given by DBTIMEZONE
    2) Session operation
    - Defined with environment variable ORA_SDTZ
    - Can be altered with ALTER SESSION SET TIME_ZONE
    - Current value given by SESSIONTIMEZONE
    3) TIMESTAMP WITH LOCAL TIMEZONE
    - TIME_ZONE Session parameter
    : O/S Local Time Zone
    Alter session set time_zone = '-05:00';
    : An absolute offset
    Alter session set time_zone = dbtimezone;
    : Database time zone
    Alter session set time_zone = local;
    : A named region
    Alter session set time_zone = 'America/New_York';
    Reference Document
    ------------------

    Hi ,
    I am facing the same problem and my scenario is also same (BAPI's).
    So can you please tell me how you overcome this problem .
    Thanks,
    Rahul

  • Queries involving where clause with timestamp data type

    I need to use milliseconds in my tables and do queries where I compare the time in the table to a specific time. I changed the column to the TIMESTAMP data type (from DATE) to accommodate the milliseconds.
    I am accessing the data via a C++ program using ODBC to access the Oracle 10g XE database and a SQLBindParameter statement to set up the comparisons.
    Below is a table that looks like mine but simplified to just a few fields:
    . DATA_ID NOT NULL NUMBER(10)
    . START_TIME NOT NULL TIMESTAMP(6)
    . STOP_TIME NOT NULL TIMESTAMP(6)
    My query is:
    . string sql("select "\
    . "to_Char(rv.start_time, 'YYYYMMDD HH24:MI:SS.FF3'), "\
    . "to_Char(rv.stop_time, 'YYYYMMDD HH24:MI:SS.FF3'), "\
    . "rv.data_id "\
    . "from "\
    . "Reservation rv "\
    . "where "\
    . "rv.data_id = ? and "\
    . "rv.stop_time >= to_timestamp(?, 'YYYYMMDD HH24:MI:SS.FF3') and "\
    . "rv.start_time <= to_timestamp(?, 'YYYYMMDD HH24:MI:SS.FF3');");
    MY C++ code (minus the usual statement preparation material) is:
    . string startTime("20090826 15:42:02.000");
    . string stopTime("20110828 02:04:52.000");
    . SQLRETURN rc = SQL_SUCCESS;
    . SQLINTEGER sqlRsrcInstanceId = resource->getResourceInstanceId();
    . SQLLEN sqlRsrcInstanceIdLI = 0;
    . rc |= SQLBindParameter( stmtHandle, 1, SQL_PARAM_INPUT,
    . SQL_C_LONG, SQL_INTEGER, 0, 0,
    . &sqlRsrcInstanceId, 0, &sqlRsrcInstanceIdLI );
    . SQLCHAR sqlStartTime[24];
    . memset(sqlStartTime, 0, 24);
    . SQLLEN sqlStartTimeLI = SQL_NTS;
    . strncpy( (char*)sqlStartTime, startTime, 23);
    . rc |= SQLBindParameter( stmtHandle, 2, SQL_PARAM_INPUT,
    . SQL_C_CHAR, SQL_CHAR,
    . sizeof(sqlStartTime)-1, 0,
    . &sqlStartTime, sizeof(sqlStartTime)-1,
    . &sqlStartTimeLI);
    . SQLCHAR sqlStopTime[24];
    . memset(sqlStopTime, 0, 24);
    . SQLLEN sqlStopTimeLI = SQL_NTS;
    . strncpy( (char*)sqlStopTime, stopTime, 23);
    . rc |= SQLBindParameter( stmtHandle, 3, SQL_PARAM_INPUT,
    . SQL_C_CHAR, SQL_CHAR,
    . sizeof(sqlStopTime)-1, 0,
    . &sqlStopTime, sizeof(sqlStopTime)-1,
    . &sqlStopTimeLI);
    When the statement is executed, I get the following error:
    . ODBC Return Code: SQL Error.
    . Native Error Code/Message:
    . 932/[Oracle][ODBC][Ora]ORA-00932: inconsistent datatypes: expected - got -
    Any suggestions on what is wrong or a better way to perform the query?

    The only way to test a query is to get out of your environment and fire up SQL*Plus (command line).
    I can not read all of what you wrote but the error you are generating should show up there along with sufficient information to quickly fix it.
    Once you have working statement put it back into your environment.

  • Working with timestamp data type.

    Hi all!,
    I have some problems working with the timestamp data type.
    Let's say that i have a table named order, where i store (in two timestamps) the date where the order was made, and the date where the order was executed.
    I want:
    1) first to find the difference between these to timestamps, let me call them a,b,
    2) to find the average time of the difference of timestamps. With that i mean if my table has 60 typles for examples to get (b-a)/60.
    Can these happen?
    Thanks in advance,

    I would do this with a view and a stored procedure within oracle.
    Create a view that contains the two timestamp fields & the difference between them (along with any primary keys from the original table), then use this view in a stored procedure to average the values.

  • Problem loading PostgreSQL Bytea data type to Oracle Raw data type

    We are migrating our database from PostgreSQL to Oracle. First, we convert the BYTEA data type in PostgreSQL to Oracle RAW. The BYTEA data type is variable bytes array. How can we load the BYTEA data type to Oracle RAW data type? Or I have to convert to different data type. thanks.
    Peter,

    hi,
    Instead of 'interval day to second' in method declaration use internal datatype 'DSINTERVAL_UNCONSTRAINED'.
    There are more unconstrained types in oracle.
    Bartek

  • How to add TIMESTAMP data type in  Enterprise Architect...?

    Hi all
    There is no data type of timestamp in Enterprise Architech. There is only
    DATE type. I have ERD prepared from Enterprise Architech. How to modify
    DATE type to TIMESTAMP type.
    How to add TIMESTAMP data type in Enterprise Architect or in ERD ?
    Thanks in advance,
    Pal

    Have you asked this question of the vendor of Enterprise Architect? They may have a later version that supports the various TIMESTAMP data types. If your ERD tool doesn't support a data type, other than talking to the vendor or working around the problem (i.e. generate DDL to a text file and edit it before applying it to the database), you're probably out of luck.
    Justin

  • Pdf file stored as BLOB data type on Oracle

    I store PDF file as BLOB data type on Oracle. There are cases
    where I get multiple records from the database, that means I get
    multiple PDF files. They have to be merged and displayed on the web
    page. I tried CFContent which can display only one PDF file at a
    time but not more than one, whereas cfdocument is having problem
    converting binary data to string. I am kind of stuck.
    Can you anybody please help me out? Please let me know if you
    have any questions or this does not make sense to you.
    Thank you in advance.

    BALAJI_JAY wrote:
    > Can you anybody please help me out? Please let me know
    if you have any
    > questions or this does not make sense to you.
    if by "merge" you mean 3 pdf into 1 pdf, try cfpdf (if on
    cf8) or see this
    thread if cf version less than 8:
    http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=1&catid=7&threadid=11 14635&messageid=4032202

  • Is there a auto-increment data type in Oracle

    Is there a auto-increment data type in Oracle ?
    How to do it if there is no auto-increment data type in Oracle ?
    null

    jackie (guest) wrote:
    : Is there a auto-increment data type in Oracle ?
    : How to do it if there is no auto-increment data type in Oracle
    Hi,
    I think you need unique ID's, for this purpose you use sequences
    in Oracle. Example:
    create table xy (
    id number,
    name varchar2(100)
    alter table xy
    add constraint xy_pk primary key(id);
    create sequence xy_seq start with 1 maxvalue 99999999999;
    (there are many other options for create sequence)
    create or replace trigger xy_ins_trg
    before insert on xy
    for each row
    begin
    select xy_seq.nextval
    into :new.id
    from dual;
    end;
    This produces a unique value for the column id at each insert.
    Hope this will help.
    peter
    null

  • Cannot get the correct data type in Oracle JDBC

    Dear ALL:
    I used JDBC ResultSetMetaData to get the column data type for Oracle Database. I created a table including 2 columns AAA, which is NUMBER type, BBB which is FLOAT type.
    However, I found a problem that either NUMBER or FLOAT data types are reported as NUMBER type in JDBC.
    IN SQL 2000, it is okay. SMALLINT, INT, TINYINT, etc..can be reported correctly.
    Can anybody tell me that what's wrong here? I will be very appreciated.

    hi,
    i guess its a bug which is fixed with 10i.
    Elango.

  • Bea and nvarchar2 data type in oracle

    Does weblogic server supports nvarchar2 data type in Oracle?..
    I use CMP with java data type String mapped to nvarchar2 data type to oracle.when
    i try to create a bean it throws "java.sql.SQLException: ORA-12704: character set
    mismatch". Is there any configuration in the server to set the character set?..
    can anyone help me on this?...

    Does weblogic server supports nvarchar2 data type in Oracle?..
    I use CMP with java data type String mapped to nvarchar2 data type to oracle.when
    i try to create a bean it throws "java.sql.SQLException: ORA-12704: character set
    mismatch". Is there any configuration in the server to set the character set?..
    can anyone help me on this?...

  • XML Data Type in oracle

    I am a developer in .NET with having experience working on SQL server.
    I want to know whether there is an xml data type in oracle.
    I have an xml in my front end and want to insert record in the database for the values inside that xml. What i am doing currently is that i am retreiving the value in the xml in the .NET code and passing the values a parameter to a stored procedure in oracle. what i want to do is to pass the xml directly to stored procedure in oracle and retrieve the values there (using Xquery) and insert the records.
    This is possible with SQL server 2005. I want to know is this possible with Oracle.
    Thanks and regards,
    Sameer J Narkar

    Wonderful - a documentation question!
    You will find your answer by going to the general documentation portal at http://tahiti.oracle.com following the path to the database version of interest, and looking in the SQL Reference manual. Chapter 2 discusses all data types, including the several supported for XML.
    In addition, under the 'Books' tab, there are several XML-developer specific reference manuals.
    (Oracle's support for XML generally blows away the others. The price for the extreme flexibility is an ease-of-use hit.)
    Message was edited by:
    Hans Forbrich
    removed the punctuation from the displayed URL which resulted in an automatically included trailing comma.

  • BOOLEAN  data type in oracle is it there?

    is there any data type in oracle which stores BOOLEAN data?

    >
    There are inevitably problems with three-valued logic. To be consistent with the 3VL world of SQL one would expect a 3 value logical type (not strictly a "boolean" type at all). The standard chose not to do that and opted for just TRUE and FALSE with NULL as a sort of substitute for the third value. That in itself creates some logical conundrums but it's probably impossible to come up with any system that makes sense of SQL's 3VL. Probably that's why most DBMS vendors leave it out.
    >
    No problem. Just define it as NOT NULL and you will have traditional 2VL Boolean algebra.

  • Oracle/java timestamp data type error.. please help

    Im having trouble with a SQL query of mine. Im trying to get a timestamp using JDBC from an oracle database however i get the following error:
    java.sql.SQLException: ORA-00932: inconsistent datatypes: expected %s got %s
    Now when i put the java.util.timestamp into the DB it appears to change.
    When I printout the value of the timestamp in my console it prints the following:
    07-06-26 17:28:09.414
    When i check the value from SQL PLUS it gives me this value
    07-06-26 17:28:09,000000
    Does anyone have any idea why this happens? and more importantly how I can retrieve the timestamp again.
    Im using BEA workshop which means i dont have any means of manipulating the data before presenting to the frontend.
    The database is Oracle 9.2.0.1

    user582245,
    Please provide the following:
    1. Entire error message and stack trace you are getting.
    2. Part of your code where the error occurs.
    3. JDK version you are using.
    4. Oracle data-type of the problematic column.
    Good Luck,
    Avi.

Maybe you are looking for

  • How can I share my music library with someone else's ipod?

    how can I share my music with someone's else ipod?

  • How to determine IE type(32 bit or 64 bit) in a task sequence while updating Java

    How to determine IE type(32 bit or 64 bit) in a task sequence Hi, Currently i have to update new version of Java after removing all the previous existing version of Java by using TS in SCCM 2007. we have both 32 bit and 64 bit browser in the environm

  • Saving a JPanel as an image

    Hi peeps, I've written the following code after reading many threads about how to save a JPanel as an image. On the whole, it works. But the JPanel itself contains many different bits such as Line2D objects and other shapes, as well as ImageIcons. So

  • How to pass the session_id in the destination URI?

    Hi, How can I pass the database session_id (sid) via the destination URI of my navigation button, which I created via personalizations, on a standard Oracle page? I am currently using: OA.jsp?page=/xxxe/oracle/apps/ar/webui/XXXMyPagePG&retainAM=Y. Is

  • Scripts To Check Database Growth in Oracle 10g

    Hi All, I need your help developing a script to find out the database growth in Oracle 10G on daily, weekly and monthly basis. In our production database tablespace growth is huge and we are adding data files frequently. Management is asking about th