Convert Data type from Oracle Data time string to SQL Date time data type

I have a time stamp column pulled from oracle into a SQL server db table varchar datatype column.
Now i want to change that column to date time.
Following is the data present in the table:
01-APR-11 02.15.00.026000 AM -08:00
01-APR-11 04.15.00.399000 AM -08:00
01-APR-11 06.15.00.039000 AM -08:00
I want to convert this data into sql server datetime data type.
Please advice.
Thanks,
Sam.
I am unable to find the solution in other sites which is why I have posted it in Oracle forum for seeking solution.
Thanks in Advance.
Sam.

Sam,
How are you actually loading the data into SQL*Server - are you using something like an Oracle gateway, BCP or another Microsoft utility of some sort ?
If you are using an Oracle problem then we may be able to help but if using a Microsoft utility then you should really follow up with Microsoft to know what format the data should be in to use a Microsoft utility.
Regards,
Mike

Similar Messages

  • Problem with date format from Oracle DB

    Hi,
    I am facing a problem with date fields from Oracle DB sources. The date format of the field in DB table is 'Date base type is DATE and DDIC type is DATS'.
    I mapped the date fields to Date characters in BI. Now the data that comes to PSA is in weird format. It shows like -0.PR.09-A
    I have changing the field settings in DataSource  to internal and external and also i have tried mapping these date fields to text fields with out luck. All delivers the same format.
    I have also tried using conversion routines like, CONVERSION_EXIT_IDATE_INPUT to change format. It also delivers me the same old result.
    If anybody of you have any suggestions or if anybody have you experienced such probelms, Please share your experience with me.
    Thanks in advance.
    Regards
    Varada

    Thanks for all your reply. I can only the solutions creating view in database. I want some solution to be done in BI. I appreciate if some of you have idea in it.
    The issue again in detail
    I am facing an issue with date fields from oracle data. The data that is sent from Oracle is in the format is -0.AR.04-M. I am able to convert this date in BI with conversion routine in BI into format 04-MAR-0.
    The problem is,  I am getting data of length 10 (Output format) in the format -0.AR.04-M where the month is not in numericals. Since it is in text it is taking one character spacing more.
    I have tried in different ways to convert and increased the length in BI, the result is same. I am wondering if we can change the date format in database.
    I am in puzzle with the this date format. I have checked other Oracle DB connections data for date fields in BI, they get data in the format 20.081.031 which will allow to convert this in BI. Only from the system i am trying creating a problem.
    Regards
    Varada

  • DATA EXTRACTION FROM ORACLE & SYBASE

    Hello members...
    Good day. This is my first posting in this site. I am new to Oracle and have a question regarding Data extraction from Oracle and Sybase.
    My project has two applications one having Oracle as the database and the other has Sybase as the database. On the proposed production schedule, there would be a interface data update from the Oracle database to the Sybase database.
    My aim is to check if the data update is in sync after the update. We plan to extract the data from the two databases (Oracle and Sybase) and compare in a Third Party tool. We have the tool to compare. Can any of you suggest a nice data extraction tool. I have to set this data extraction as a batch in the nightly batch schedule.
    Thanks in advance,
    Regards,
    Krishna Kumar...

    Sybase provides the best data extraction utility called BCP. You can load and extract data. It is very user friendly. From your unix prompt if you type in BCP ? you will all the switches and
    help messages you need to use. It is so simple.
    Oracle dosn't have such a utility to extract data from table.
    You need to write a Stored procedure and use UTF_FILE package to
    extract data from table and write into a file.

  • SQL Server 2005 data pull from Oracle

    Hi, I am learning how to use Oracle and I ran into this problem.
    My database is running on SQL Server 2005.
    I have an ODBC connection to Oracle. I also have a VB .Net script that queries the Oracle table that the data resides in.
    When the job is running, and if it stalls, I do not get a timeout error. It locks down my database and no other source systems can feed data to me; these are back logged in the queue.
    Is there an easier way for me to make a connection that will pull data on a consistent basis? Please help ...
    Student Learner

    Learning how to use Oracle does not include taking data from Oracle and putting it into SQL Server.
    From your description of what is happening I agree with BluShadow. This is not an Oracle issue. This is a coding in VB .NET issue.
    Posting the statements you are executing against some unknown version of Oracle would be a good starting point.

  • Data transfer from oracle database(external database) to sap database

    Hi Abapers,
    I have a requirment like excel data upload from oracle database(external database) to SAP database .Plz any one can help me how to create a bdc program for this requarment.
    Advance thanks you.
    Jnana

    HI
    use function module 'ASLM_EXCEL_TO_INTERNAL_TABLE' TO UPLOAD DATA FROM EXCEL SHEET TO INTERNAL TABLE. FROM THERE U CAN SAVE IT TO DATABASE USING BDC FUNCTION MODULES.

  • How to make data base link from oracle 11g r2 to microsoft sql 2008 express

    I need to make data base link from oracle 11g r2 to microsoft sql 2008 express to make replication between then
    please help me !
    I didn't know what is the user and password in the command which create database link

    To replicate data you can ude Database Gateway for ODBC or Database Gatewy for MS SQl Server. Please use the search engine of this forum if you ant to get more details about each product.
    Some SQl Servers are set up to use Windows authentication only. In this case you won't be able to connect to the SQL Server as Windows authentication isn't supported with the gateways. You have to make sure your SQL server is supporting username and password authentication - a common user is the "sa" user. Regarding the username/password, please get in touch with your SQL Server Admin.

  • Stack type from oracle website

    I am trying to create the stack type from oracle's site:
    http://download.oracle.com/docs/cd/B10500_01/appdev.920/a96624/10_objs.htm#4139
    However, I don't know how to use it exactly as it yields NULL SELF error every time I try to initialize it! How do I pop and push?
    CREATE TYPE Stack AS OBJECT (
    max_size INTEGER,
    top INTEGER,
    position IntArray,
    MEMBER PROCEDURE initialize,
    MEMBER FUNCTION full RETURN BOOLEAN,
    MEMBER FUNCTION empty RETURN BOOLEAN,
    MEMBER PROCEDURE push (n IN INTEGER),
    MEMBER PROCEDURE pop (n OUT INTEGER)
    Finally, you write the object type body:
    CREATE TYPE BODY Stack AS
    MEMBER PROCEDURE initialize IS
    BEGIN
    top := 0;
    /* Call constructor for varray and set element 1 to NULL. */
    position := IntArray(NULL);
    max_size := position.LIMIT; -- get varray size constraint
    position.EXTEND(max_size - 1, 1); -- copy element 1 into 2..25
    END initialize;
    MEMBER FUNCTION full RETURN BOOLEAN IS
    BEGIN
    RETURN (top = max_size); -- return TRUE if stack is full
    END full;
    MEMBER FUNCTION empty RETURN BOOLEAN IS
    BEGIN
    RETURN (top = 0); -- return TRUE if stack is empty
    END empty;
    MEMBER PROCEDURE push (n IN INTEGER) IS
    BEGIN
    IF NOT full THEN
    top := top + 1; -- push integer onto stack
    position(top) := n;
    ELSE -- stack is full
    RAISE_APPLICATION_ERROR(-20101, 'stack overflow');
    END IF;
    END push;
    MEMBER PROCEDURE pop (n OUT INTEGER) IS
    BEGIN
    IF NOT empty THEN
    n := position(top);
    top := top - 1; -- pop integer off stack
    ELSE -- stack is empty
    RAISE_APPLICATION_ERROR(-20102, 'stack underflow');
    END IF;
    END pop;
    END;

    I would write it using a collection rather than a varray myself:
    SQL> create type IntArray AS table of integer
      2  /
    Type created.
    SQL>
    SQL> CREATE TYPE Stack AS OBJECT (
      2    max_size INTEGER,
      3    top INTEGER,
      4    position IntArray,
      5    MEMBER PROCEDURE initialize(p_max_size IN INTEGER),
      6    MEMBER FUNCTION full RETURN BOOLEAN,
      7    MEMBER FUNCTION empty RETURN BOOLEAN,
      8    MEMBER PROCEDURE push (n IN INTEGER),
      9    MEMBER PROCEDURE pop (n OUT INTEGER)
    10    );
    11  /
    Type created.
    SQL>
    SQL> CREATE TYPE BODY Stack AS
      2    MEMBER PROCEDURE initialize(p_max_size IN INTEGER) IS
      3    BEGIN
      4      max_size := p_max_size;
      5      top := 0;
      6      position := IntArray(NULL);
      7      position.EXTEND(max_size - 1, 1);
      8    END initialize;
      9    --
    10    MEMBER FUNCTION full RETURN BOOLEAN IS
    11    BEGIN
    12      RETURN (top = max_size); -- return TRUE if stack is full
    13    END full;
    14    --
    15    MEMBER FUNCTION empty RETURN BOOLEAN IS
    16    BEGIN
    17      RETURN (top = 0); -- return TRUE if stack is empty
    18    END empty;
    19    --
    20    MEMBER PROCEDURE push (n IN INTEGER) IS
    21    BEGIN
    22      IF NOT full THEN
    23        top := top + 1; -- push integer onto stack
    24        position(top) := n;
    25      ELSE -- stack is full
    26        RAISE_APPLICATION_ERROR(-20101, 'stack overflow');
    27      END IF;
    28    END push;
    29    --
    30    MEMBER PROCEDURE pop (n OUT INTEGER) IS
    31    BEGIN
    32      IF NOT empty THEN
    33        n := position(top);
    34        top := top - 1; -- pop integer off stack
    35      ELSE -- stack is empty
    36        RAISE_APPLICATION_ERROR(-20102, 'stack underflow');
    37      END IF;
    38    END pop;
    39  END;
    40  /
    Type body created.
    SQL>
    SQL> DECLARE
      2    v_stack Stack := Stack(null,null,null);
      3    v_n INTEGER;
      4  BEGIN
      5    v_stack.initialize(10);
      6    FOR i in 1..20
      7    LOOP
      8      IF NOT v_stack.full THEN
      9        v_stack.push(i);
    10        dbms_output.put_line('Pushed: '||i);
    11      ELSE
    12        dbms_output.put_line('Stack Full: '||i);
    13      END IF;
    14    END LOOP;
    15    FOR i in 1..20
    16    LOOP
    17      v_stack.pop(v_n);
    18      dbms_output.put_line('Popped: '||i||' : '||v_n);
    19    END LOOP;
    20  END;
    21  /
    Pushed: 1
    Pushed: 2
    Pushed: 3
    Pushed: 4
    Pushed: 5
    Pushed: 6
    Pushed: 7
    Pushed: 8
    Pushed: 9
    Pushed: 10
    Stack Full: 11
    Stack Full: 12
    Stack Full: 13
    Stack Full: 14
    Stack Full: 15
    Stack Full: 16
    Stack Full: 17
    Stack Full: 18
    Stack Full: 19
    Stack Full: 20
    Popped: 1 : 10
    Popped: 2 : 9
    Popped: 3 : 8
    Popped: 4 : 7
    Popped: 5 : 6
    Popped: 6 : 5
    Popped: 7 : 4
    Popped: 8 : 3
    Popped: 9 : 2
    Popped: 10 : 1
    DECLARE
    ERROR at line 1:
    ORA-20102: stack underflow
    ORA-06512: at "SCOTT.STACK", line 36
    ORA-06512: at line 17
    SQL>When you instantiate the object, you have to supply values for the object attributes, but those values can simply be null. This is the nature of object instantiation because, without values, it wouldn't be an object, it would just be a null declaration of the object class. You don't have to declare variables outside of the object and pass those in, as you did for your varray.

  • Data Types from Oracle Sample Schema

    Hi,
    I was trying to push some data from an Oracle Sample schema (Schema: OE Table: Customers) to a target schema. The interface was erroring out because of undefined data types in the model.
    I chkd the model, only to find that some of the data types were undefined.
    I DESCribed the table in the using SQL Client, The data types returned were
    CUST_ADDRESS_TYP
    PHONE_LIST_TYP
    MDSYS.SDO_GEOMETRY
    I DESCribed the datatypes, They seem to be flexfields of some kind,
    Please advise on how to define these data types into ODI:
    Heres the DESC output
    SQL> desc customers;
    Name Null? Type
    CUSTOMER_ID NOT NULL NUMBER(6)
    CUST_FIRST_NAME NOT NULL VARCHAR2(20)
    CUST_LAST_NAME NOT NULL VARCHAR2(20)
    CUST_ADDRESS CUST_ADDRESS_TYP
    PHONE_NUMBERS PHONE_LIST_TYP
    NLS_LANGUAGE VARCHAR2(3)
    NLS_TERRITORY VARCHAR2(30)
    CREDIT_LIMIT NUMBER(9,2)
    CUST_EMAIL VARCHAR2(30)
    ACCOUNT_MGR_ID NUMBER(6)
    CUST_GEO_LOCATION MDSYS.SDO_GEOMETRY
    DATE_OF_BIRTH DATE
    MARITAL_STATUS VARCHAR2(20)
    GENDER VARCHAR2(1)
    INCOME_LEVEL VARCHAR2(20)
    SQL> desc CUST_ADDRESS_TYP;
    Name Null? Type
    STREET_ADDRESS VARCHAR2(40)
    POSTAL_CODE VARCHAR2(10)
    CITY VARCHAR2(30)
    STATE_PROVINCE VARCHAR2(10)
    COUNTRY_ID CHAR(2)
    SQL> desc phone_list_typ;
    phone_list_typ VARRAY(5) OF VARCHAR2(25)

    To create MDSYS.SDO_GEOMETRY datatype, goes to Topology module, Oracle Techonology, Datatypes, and add a new datatype GEOMETRY. (try to fill all information fields with GEOMETRY and see what happens maybe you have to ajust this after but it is a start point).
    add information in from and to tabs according your source and target desired tech.
    Reverse againg your model, or change the datatype in the model datastore. Re-run your interface

  • Importing Date fields from Oracle always defaults to DT_DBDATETIME, and won't accept chages

    Hi
    I am trying to import date fields in an Oracle database in to SQL Server 2012, using SSIS. The package is using DT_DBTIMESTAMP type in the Data Flow, but this has the same range as SQL Server datetime, and it bombs out all the time.
    I have tried to change the type used to DT_DBDATE, but no matter what I do the data type on the input columns is readonly and will not change.
    Any help would be much appreciated
    Andy
    CRM 4, SQL Server and .Net developer using C#

    Hi Andy,
    From the Mapping of Integration Services Data Types to Database Data Types section of the document, we can get the detailed information about mapping the Oracle data types to Integration Services data types. To change the data type from DT_DBTIMESTAMP to
    DT_DBDATE, we can use the following two methods:
    Method 1:
    Right click on the Source component and click “Show Advanced Editor”.
    Switch to the “Input and Output Properties” tab, expand the XX Source Output node, and expand the Output Columns node.
    Click the target column, and change the DataType property to DT_DBDATE.
    Method 2:
    Add a Data Conversion component to the Data Flow Task
    Double click the Data Conversion component to open the Data Conversion Transformation Editor
    Select the target input column, and change the Data Type to database date [DT_DBDATE].
    If I have anything misunderstood, please feel free to let me know.
    Regards,
    Mike Yin
    If you have any feedback on our support, please click
    here
    Mike Yin
    TechNet Community Support

  • Data source from Oracle 10g problem

    Dear Sir,
    We met a problem when we moved on Oracle 10g from Oracle 9i in the loading process. The scenario is that SQL Server as Data Warehouse, SSIS as ETL tool. But the length of string column as data source table in SSIS grows up 4 times when using Oracle 10g. For example, ABC table x varchar2(8) --> x varchar(32) -->x varchar(8) --> x varchar(8) {Oracle 10g        SSIS(source) }
    This doesn’t influence the loaded result (I did not find any problem until now), but that influence loading performance and we worry about potential problems.
    Do you have any idea or have you met the same problem before? Is I need setup some parameters like "code page"
    Thanks,
    Jacob

    You could try General Database Discussions the main db foum.
    What are you using to migrate your database? Why is it being mapped from varchar2(8) to varchar2(32). It sounds like someone/something is intervening here.
    Barry

  • Passing a value for date parameter from Oracle Forms to BIP

    Hi
    I have created a report with the following SQL query:
    select
    d_tables.d_seq,
    to_date(d_tables.d_created) creation_date,
    d_tables.d_created_by created_by,
    d_tables.d_pk,
    d_tables.table_name,
    d_tables.comments
    from
    d_tables, d_applications
    where
    d_tables.d_ppk = d_applications.d_pk
    and to_date(d_tables.d_created) >= nvl(:P_CRE_DATE_FROM, to_date(d_tables.d_created))
    and to_date(d_tables.d_created) <= nvl(:P_CRE_DATE_TO, to_date(d_tables.d_created))
    The parameters P_CRE_DATE_FROM and P_CRE_DATE_TO have been set up as date in BI Publisher with format dd-MMM-yyyy
    The report works fine when launched in BI Publisher.
    I want to call this report from Oracle Forms and I'm trying to pass the values for both the parameters. However, the report does not generate output based on values passed.
    Does it have to do with datatype? Does anyone know a solution for this?
    Kind regards,
    Aparna

    Thanks for your suggestion. I am already referring to the whitepaper and have integrated Forms with BI Publisher. The parameter passing is working fine for a varchar2 type of parameter. However, for a date type, there seems to be some problem.

  • Increment the number with date/time string. when ever the next date come's it should reset again with initial number

     i want to store the number of records in a file. Every time when ever i run the program the record will be incremented well i using forloop with count value 1 as a constant .in the for loop i am using autoincrement with the  feedback node . to view the number i have attached the indicatator .the number will be increment every time . i am using number to time time stamp  that is connected to get date/time string. from that we can view the date string and time string . so , my issue is when ever i close the code again it is coming with intial value . i should get from that number only where ever i close the code . after the date completed again it should come from intial value . i am attaching the code so that u guys can solve my problem.
    Attachments:
    record.doc ‏34 KB

    here you can see.......the file path in case structure in that i have included my requirement of increment the number 
    -> if the case is true then it goes in ok file path and the no of records string will pass in the file by seeing these code u will get the clarity
    my requirement is the number of records should increase ........ whnever the program runs...that i made it. by the next day again it should begain with the intial value.........that is my requirement. i hope u understand .
    suggest me how can i use the  intial  value .......
    Attachments:
    code.vi ‏35 KB

  • Data migration from Oracle to MS SQL using SSIS

    Hi friends,
    I know this question must have been asked by many who are beginners to SSIS like me about migrating data from oracle database to sql server database but i still would like to raise this query again.
    I have table called tbl_employee_oracle in oracle database from where i need to retrive the latest records(eg. latest record of each employee) from the table and populate the result into the sql server database table which is tbl_employee_sqlserver
    using ssis.
    The logic i thought of doing this is as below;
    1. Retrive all employees records from oracle database table.
    2. Dump these records into a temporary table(will have same table structure as in oracle database) in sql server.
    3. Creating a stored procedure in sql server which will contain logic to select the most recent records from this temporary table.
    4. Populate this result set into the final table of sql server.
    Please suggest me if working on this logic is worth and any alternate logic to accomplish this task.

    There are many opitons, but choose among for your scenario
    1. If your employee table is small with less than a few hundreds of record, you want to choose SCD Type 1 if not preserving histoy, incase of preserving history of records choose SCD2,
    2. If you have less than few millions of records you can choose look up to direct unmatched records to insert into Sql Server Destination and direct matched records could be updated using OLEDB Destination or Try Merge Left outer Join
    transform.
    3. If you have several millions of records, you may want to use your above method.
    4. Configuring to use CDC could be last option where there are large volumes of updates and inserts every few min to hours. But I'm not sure if this option can be set in Oracle Source.
    Please mark this post as answer if it resolves your Problem. You may even mark it as helpful. Thanks

  • Data MIgration from Oracle to SQL Server 2005

    HI Gurus,
    Kindly please advice me how to migrate Data from oracle to MS SQL Server or Vice Versa.
    I came to know about 2 methods:
    1) Using SQL Developer
    2) USing ODBC.
    KIndly let me know which method is better. I am in confusion about both option
    Kindly advice over the same
    Thanks

    Usually such questions asked and answered on forums of a target system. In this case on MS SQL forums.
    But I will answer.
    You should create a LINKED SERVER in MS SQL that connects to Oracle.
    Then issue couple of SELECT * INTO <TARGET_TABLE> FROM <ORACLE LINKED SERVER>..<SRC SCHEMA>.<SRC TABLE>.
    Install Oracle Client and OLE DB driver on SQL Server machine.
    Also, Oracle is case sensitive by default. MS SQL is case insensitive by default. If there are primary/unique keys that have mixed case values in Oracle, then in MS SQL you need to set case sensitive collation for them.
    PS. If you need not only migrate data one time, but also to have a real time replication during an application transition period, you can take a look on heterogeneous replication solutions like Golden Gates or DataCurrents.

  • Data Transfer from Oracle database 10g to Oracle database 9i

    Hi Experts,
    We need to insert records at the speed of min 10,000 records per sec in the following condition.
    Source : Oracle 10 g and Oracle 9i
    We need to select the data from Oracle 10g and insert into Oracle 9i database.
    Here we not allowing to create database link and also not allowing to create view or materialized view
    because this two database is not on same network.
    So we developing the small java application on intermediate server where we write process to get the connection of this two database servers.
    From java application we call the procedure for selecting data from Oracle 10g and insert into oracle 9i database.
    What is the best way to achieve?
    Or You also suggest any other way to achieve
    ( As per this scenario materialized view is working ? )

    Thanks freiser,
    But it create another problem as per my business logic, There will be two database server , one is online server where online user fill the form which is generated by java, spring , hibernate and using database 10 g.
    at day end i need to execute a process that transferring data from online server to offline server that is in oracle database 9i. This process is scheduled. Some security reason client do not kept this two database on same network.
    My challenge is that transfer data from online server to offline server with applying client security norms.
    I have option like
    1) Using Oracle replication method, creating materialized view on remote server , refreshing it at regular interval. but database connectivity is not contineous, should i go for that ?
    2) Write java application on intermediate server where we write process to get the connection of this two database servers. From java application we call the procedure for selecting data from Oracle 10g and insert into oracle 9i database and using flag on both data to identified how many rows are transfered and how many remaining for trasfer.
    Please tell me what is best way to acheive this ?

Maybe you are looking for

  • Last data update

    Hi, How I can find the last data update information(date and time) of multiprovider in BW? Kindly help on this. Regards Mukul Singhal

  • WM-production order supply quantity is not reduced after confirmation,GRN

    Dear Gurus                i am configured the WM-PP , in the production order after material staging and TR-TO process , i did confirmed the                production order and GRN.  Raw material stock is not reduced from the storage type 100....    

  • Transport Org Structure without Org Data

    Hello HR experts, I have a simple org structure - one org unit, one postion and 4 users assigned to that position in Dev client. How do I transport this request to Q without re-creating it? Also, When we transport this, by default, does it carry the

  • Article Change Documents for Custom Fields

    Hi, We have lot of custom fields defined in the article master. When the custom fields are changed through the online transaction, the changes are recorded in the change document tables (CDHDR / CDPOS). If the changes are made through the "BAPI_MATER

  • Panel Customizable not showing Oracle BI under Mashups, when in Composer mode

    I had created a page with panel Customizable: <?xml version='1.0' encoding='UTF-8'?> <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"           xmlns:f="http://java.sun.com/jsf/core"           xmlns:h="http://java.sun.com/jsf/html"