DTS is Reading Created_Date column "2007-08-20 10:46:00.710000000" as DBTYPE_STR and causing datatype mismatch with destination (DBTYPE_DBTIMESTAMP)

We have internal and external load Step 1 is internal load from source sql to destination flat file  and step 2 is external load from source flat file to destination sql
Step 1 :Using DTS I am extracting DateTime source Field"2007-08-20 10:46:00.710" from SQL Server
and loading into destination text file as "2007-08-20 10:46:00.710000000"
Step 2 :Using DTS when I try to load "2007-08-20 10:46:00.710000000" from text file
to SQL Server it gives the error (Source column 'CREATED_DATE(DBTYPE_STR),destination column
'CREATED_DATE(DBTYPE_DBTIMESTAMP),Cannot parse input data string beginning at "2007-08-20 10:46:00.710000000"
My question here DTS is extracting the DateTime source Field "2007-08-20 10:46:00.710000000" as string (DBTYPE_STR)
instead of DBTIMESTAMP

Hi shimjith,
According to the error message, it indicates that there are data type mismatch between the Source column CREATED_DATE and Destination column CREATED_DATE in the package. Since the text file is already created from the step1, the data type for the CREATED_DATE
column should be DBTIMESTAMP. It seems that the data type for the column is changed in the Flat file.
Here, to fix this issue, please refer to the following suggestions:
Change the data type for the CREATED_DATE column from DBTYPE_STR to DBTYPE_DBTIMESTAMP in the flat file.
Use some transformation components (like Data Conversion or Derived Column Transformation in later SSIS versions) to change the type for the Source column, then map the new column to the destination column in the SQL table.
If I understand correctly, you are using SQL Server 2000. For better support, I suggest you can upgrade the SQL Server to later versions.
Thanks,
Katherine Xiong
If you have any feedback on our support, please click
here.
Katherine Xiong
TechNet Community Support

Similar Messages

  • Initially stating No authorization required using Adobe.  When I try to change it so I can transfer downloaded books by my Nook e-reader it I get an error message stating the Adobe user name and password is associated with another computer.  What gives?

    When I set up Adobe reader on my computer to be able to download books from a library and then transfer to my Nook e-reader, I initially stating No authorization required using Adobe.  When I try to change it so I can transfer downloaded books by my Nook e-reader it I get an error message stating the Adobe user name and password is associated with another computer.  What gives?

    This is pretty surprising and wierd that even Reader 10.1.1 is crashing on your system. It works pefectly for me.
    Would it be possible for you to get the crash dump, and upload it, so that I can have a look at the same.
    Download PROCDUMP from <http://technet.microsoft.com/en-us/sysinternals/dd996900.aspx> and extract it to a folder, say, c:\temp\procdump.exe
    Open cmd prompt and type "cd c:\temp".
    Launch the browser and open the PDF.
    Open task manager, sort processed by name. Two AcroRd32.exe instances  should have been launched. Note the PID (a small integer like 5588) corresponding to the AcroRd32.exe with the higher memory usage; this is the process that must be crashing. Note this PID.
    On the cmd window, type "procdump -e -ma 5588 c:\temp\01.dmp" (replace 5588 with the actual PID of the process noted in Step 4). Procdump will now wait for the aoolication to crash. If it throws a EULA, accept it.
    Perform your steps to cause the crash.
    Procdump will have created a dump file at "c:\temp\01.dmp". Zip it up (since it will be 100s of MBs otherwise) and share with me.
    Thanks in advance for all your help
    Ankit

  • Script task to read the column names dynamically and create a table in database based on excel column structure

    Hello,
    Can anyone help me out to write a vb.net script.
    I need to read the column names from excel and based on that column names I need to create a table in database(I have more than one sheet in excel).
    For each sheet columns will be changing and should create a table dynamically for each sheet.
    Any help would be appreciated.

    Refer the below script to read columns in each sheet.
    Dim excelfile As String = Dts.Variables("ExcelPath").Value.ToString
    Dim connectionstring As String = "Provider=Microsoft.Jet.OLEDB.4.0;" +
    "Data Source=" + excelfile + ";Extended Properties=Excel 8.0"
    Dim oledbcon As New OleDb.OleDbConnection(connectionstring)
    oledbcon.Open()
    Dim dt As DataTable
    Dim schemaTable As DataTable
    Dim OLEDBCMD As New OleDb.OleDbCommand
    Dim oledbdatareader As OleDb.OleDbDataReader
    Dim columns As String = ""
    dt = oledbcon.GetSchema("Tables")
    Dim TABCOMMAND(20) As String
    Dim TABCOUNT As Integer = 0
    For Each row As DataRow In dt.Rows
    TABCOMMAND(TABCOUNT) = "SELECT * FROM [" & row.Item("TABLE_NAME").ToString & "]"
    OLEDBCMD.CommandText = TABCOMMAND(TABCOUNT)
    OLEDBCMD.Connection = oledbcon
    oledbdatareader = OLEDBCMD.ExecuteReader(CommandBehavior.KeyInfo)
    schemaTable = oledbdatareader.GetSchemaTable()
    For Each myfield As DataRow In schemaTable.Rows
    For Each myproperty As DataColumn In schemaTable.Columns
    If myproperty.ColumnName = "ColumnName" Then
    columns = columns & myfield(myproperty).ToString & ","
    MsgBox(myfield(myproperty).ToString)
    End If
    Next
    Next
    oledbdatareader.Close()
    OLEDBCMD.Dispose()
    Next
    oledbcon.Close()
    Regards, RSingh

  • How to read BLOB column from a table in SQL or PL/SQL

    I have table which is having one BLOB data type column . Ihave inserted few rows in that table . Now i want to see wheather BLOB column has been inserted properly or not . How to read that column through SQL or PL/SQL.
    Can anyone help me to do this.

    You can only manipulate LOBs in PL/SQL because you have to use the DBMS_LOB package.
    Check out the Oracle Developer's Guide

  • Read only column in tabular form

    There is a not null column ( say SEQ) in a tabular form that is getting an auto value from other process. 2 more columns need user input on each row.I need to make this column(SEQ) as read only.
    If I make this column (SEQ) as standard report column then when I submit the newly added row , I always get ORA-20001 error- can not insert NULL into SEQ.. even though I can see there is a value there. Switch ithe column back to text field, the insert went just fine .
    How do you solve this read only column issue ?
    Thanks a bunch for your help.
    Tai

    thank you for your reply.
    Nope, SEQ is not the first column. Primary Key is and I leave the pK alone.
    When I press ADDROW button , tabular form is like the following: ( table alreay has 2 rows), I auto populate SEQ column and I like to make this SEQ column display only.
    -- represents checkbox
    PK      SEQ      col1           col2
    --     1     890          test1
    --     2     675          test2
    --     3     

  • How can I read a column of numbers saved as .txt and display as a wave?

    Hi Tiano
    LabVIEW General
    Ask:
    Please enter a one-line summary of your question
    Resources
    • Technical Support
    • Development Library
    • Measurement Encyclopedia
    "data/time reading into chart"
    "In the attached file, I am trying to read the first column of data, and the next column is the value on the x-axis I want it plotted at. How do I read two columns of different data? I have looked in the books I have access to and the help within Labview but am still having trouble.
    Thank you,
    Ellie"
    data_set (Plain Text, 3K)
    -posted by Ellie on 9/11/2001
    markwysong on 9/11/2001 answered:
    "Ellie,
    The first thing you need to do is to read your file in as a spreadsheet file. Then, you display it in a chart.
    That sounds simple, but looking at your dataset, there's a few things you should know. First, the "read from spreadsheet VI" is looking for data in columns, like your data set, but columns separated by tabs. Therefore, your data must be saved that way; currently, it doesn't seem that it is. Another thing; you must skip the header portion (labels) of your file when reading.
    Next, it would be easier if your time was first, and your data was second in your columns, but that can be overcome. In the VI I am including, I have copied your data set into a file called data.txt, and I've removed the header and separated the columns with a tab. Then, I read in the data, and I break out each column so I can put the time first, and then I combine them again into a cluster so it can be displayed on an XY chart.
    Take a look!
    Mark"
    Graph data from file (Binary Executable, 20K)
    data.txt (Plain Text, 3K)
    This answer has not yet been rated.
    Rate this answer:
    Mikael Garcia on 9/11/2001 answered:
    "Ellie,
    Here is one way of doing it. Take a look at this example (compatible with LabVIEW 4.1 and up) and post comments if you need further help. Basically, I read your file as text; split it; and make use of the Spread sheet string to Array function before I plot your data. Hope this helps./ Mikael"
    ExtractAndPlot.vi (Binary Executable, 36K)
    This answer has not yet been rated.
    Rate this answer:
    Ellie on 9/12/2001 commented:
    "Thank you. I am trying to get the data from the text file into a string and am having some trouble. I am reading the file from a spreadsheet, and sending the output array to "Array to Spreadsheet String", but I'm not sure this is what I want to do. Is there another way to make an array into a string? Do I need to reformat my data?
    Can you offer me any advice?
    Thank you."
    data_1 (Plain Text, 3K)
    Mikael Garcia on 9/12/2001 commented:
    "I noticed that you changed your file format according to what was said here. Yes, this new file of yours is easier to use but your original file does not have to be changed. Take a look at this example. I now added the file-read part. It will give you a dialog to locate your data file (use this VI with your original file with the header since this VI includes a string split function). Hope this helps. /Mikael"
    ReadExtractandPlot.vi (Binary Executable, 35K)
    Niko on 9/12/2001 answered:
    "If you read this file with the "read from spreadsheet file.vi" you get you
    data in a 2-D-array. Now it is easy with array- and cluster-functions to
    handle the data the way you want.
    hope that helps, Niko"
    This answer has not yet been rated.
    Rate this answer:
    I intend to read from a .txt file that contains a column of numbers. After reading I want to display it as a waveform. In fact the numbers represent points along a waveform/graph of Flow vs. time. Thus I want to have this info in the chart or graph with flow in the y0axis and time in the x-axis. Can someone give me some detailed help please? Thank you in advance.
    Attachments:
    The_file.txt ‏18 KB

    All you have to do is use Read From Spreadsheet File.vi that's on the File I/O palette. For your example .txt, set the Transpose input to true and wire the First Row output to a waveform graph. The only problem I see is that since your file doesn't contain any sampling info, the time axis will be relative. If have that information elsewhere, then you can put a build waveform function between the read and the graph. Wire the First Row output to the Y input Build Waveform and add t0 and dt values. I've attached an example.
    Attachments:
    Graph_from_text.vi ‏29 KB

  • How to read the column name of a table from sap system using C#?

    Hi!!
    I am using SAP .NET connector and creating a windows application.
    Now I wanna read the column name when a table name is given....
    Connection is done, but I don't know the code to read the column names alone...
    Can anyone help me with the code??

    fine!!
    So if i give the table name, which the RFC_READ_TABLE function module have, will it run properly? or i wanna change all the codes in order to support RFC_READ_TABLE function module?
    Because from the beginning I was using BAPI_CUSTOMER_GETLIST function, but my client requirement is to use ERP function module RFC_READ_TABLE, he didn't give any table name also..
    This is my code: What I have to change in this???
    ECCDestinationConfig ECCDestination = new ECCDestinationConfig();
                RfcDestinationManager.RegisterDestinationConfiguration(ECCDestination);
                RfcDestination rfcDest = null;
                rfcDest = RfcDestinationManager.GetDestination(a);
                    RfcRepository repo = rfcDest.Repository;
                    IRfcFunction customerList = repo.CreateFunction("BAPI_CUSTOMER_GETLIST");
                    IRfcTable addressData = customerList.GetTable("AddressTable"));
                    int j = addressData.Metadata.LineType.FieldCount;
                    for (int i = 0; i < j; i++)
                        RfcElementMetadata metadata = addressData.GetElementMetadata(i);
                        listallcolumn.Items.Add(metadata.Name);
    Message was edited by: Jeswin Rebil

  • Unable to read last column in FCC

    Hi Experts,
    I have a simple fcc to bapi scenario....
    I have two questions
    Firstly ..what is the limit on the number of fields , I mean number of columns in the input file????
    Secondly.. Im facing a strange issue where the last column is not being read if it empty , and being read (as i see it in comm channel monitoring) only when it has a value...
    Pls share ur thoughts

    Hi Teja,
    > Firstly ..what is the limit on the number of fields , I mean number of columns in the input file????
    There is no limit, you can use any number of fields based on your requirements.
    > Secondly.. Im facing a strange issue where the last column is not being read if it empty , and being read (as i see it in comm >channel monitoring) only when it has a value...
    If you want to read that fields always(if value is there or not) then in the mapping use map with default node function.
    More info check this link
    http://help.sap.com/saphelp_srm40/helpdata/ru/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm
    Regards
    Ramesh

  • Sql Server 2014 - Error message: Failed to read BLOB column

    Hi all,
      Am experiencing this error in Microsoft SQL Server 2014 - 12.0.2000.8 (X64) Enterprise Edition (Build 7601: Service Pack 1).
    Error messages:
    Message: Failed to read BLOB column
    Stack:    at Microsoft.SqlServer.Replication.Snapshot.SqlServer.NativeBcpOutProvider.ThrowNativeBcpOutException(CConnection* pNativeConnectionWrapper)
       at Microsoft.SqlServer.Replication.Snapshot.SqlServer.NativeBcpOutProvider.BcpOut(String strBcpObjectName, String strBcpObjectOwner, String strBaseBcpObjectName, Boolean fUnicodeConversion, String strDataFile, String strLoadOrderingHint, String
    strWhereClause, Boolean useTableLockHint, Int32 bcpFileFormatVersion)
       at Microsoft.SqlServer.Replication.Snapshot.SqlServer.BcpOutThreadProvider.DoWork(WorkItem workItem)
       at Microsoft.SqlServer.Replication.WorkerThread.NonExceptionBasedAgentThreadProc()
       at Microsoft.SqlServer.Replication.AgentCore.BaseAgentThread.AgentThreadProcWrapper() (Source: MSSQLServer, Error number: 0)
    Get help: http://help/0
    Message: Shared Memory Provider: No process is on the other end of the pipe.
    Stack:  (Source: MSSQLServer, Error number: 233)
    Get help: http://help/233
    Message: Communication link failure
    Stack:  (Source: MSSQLServer, Error number: 233)
    Get help: http://help/233
    Message: Shared Memory Provider: No process is on the other end of the pipe.
    Stack:  (Source: MSSQLServer, Error number: 233)
    Get help: http://help/233
    Message: Communication link failure
    Stack:  (Source: MSSQLServer, Error number: 233)
    Get help: http://help/233
    Please can you assist me on this issue.

    The error message states a communication link failure has occurred. 
    This is most likely a network related error and usually is transient.
    Try to generate the snapshot again and see if the error still occurs.  If the error still occurs, you will need to have a network admin check the links.
    Brandon Williams (blog |
    linkedin)

  • Reg: read excel column and insert into table.

    hi Friends,
          i wanted to read the data from Excel and insert into in my oracle tables.
          can you provide the link or example script.
        how to read the column value from excel and insert into table.
      please help.

    < unnecessary reference to personal blog removed by moderator >
    Here are the steps:
    1) First create a directory and grant read , write , execute to the user from where you want to access the flat files and load it.
    2) Write a generic function to load PIPE delimited flat files:
    CREATE OR REPLACE FUNCTION TABLE_LOAD ( p_table in varchar2,
    p_dir in varchar2 DEFAULT ‘YOUR_DIRECTORY_NAME’,
    P_FILENAME in varchar2,
    p_ignore_headerlines IN INTEGER DEFAULT 1,
    p_delimiter in varchar2 default ‘|’,
    p_optional_enclosed in varchar2 default ‘”‘ )
    return number
    is
    – FUNCTION TABLE_LOAD
    – PURPOSE: Load the flat files i.e. only text files to Oracle
    – tables.
    – This is a generic function which can be used for
    – importing any text flat files to oracle database.
    – PARAMETERS:
    – P_TABLE
    – Pass name of the table for which import has to be done.
    – P_DIR
    – Name of the directory where the file is been placed.
    – Note: The grant has to be given for the user to the directory
    – before executing the function
    – P_FILENAME
    – The name of the flat file(a text file)
    – P_IGNORE_HEADERLINES
    – By default we are passing 1 to skip the first line of the file
    – which are headers on the Flat files.
    – P_DELIMITER
    – Dafault “|” pipe is been passed.
    – P_OPTIONAL_ENCLOSED
    – Optionally enclosed by ‘ ” ‘ are been ignored.
    – AUTHOR:
    – Slobaray
    l_input utl_file.file_type;
    l_theCursor integer default dbms_sql.open_cursor;
    l_lastLine varchar2(4000);
    l_cnames varchar2(4000);
    l_bindvars varchar2(4000);
    l_status integer;
    l_cnt number default 0;
    l_rowCount number default 0;
    l_sep char(1) default NULL;
    L_ERRMSG varchar2(4000);
    V_EOF BOOLEAN := false;
    begin
    l_cnt := 1;
    for TAB_COLUMNS in (
    select column_name, data_type from user_tab_columns where table_name=p_table order by column_id
    ) loop
    l_cnames := l_cnames || tab_columns.column_name || ‘,’;
    l_bindvars := l_bindvars || case when tab_columns.data_type in (‘DATE’, ‘TIMESTAMP(6)’) then ‘to_date(:b’ || l_cnt || ‘,”YYYY-MM-DD HH24:MI:SS”),’ else ‘:b’|| l_cnt || ‘,’ end;
    l_cnt := l_cnt + 1;
    end loop;
    l_cnames := rtrim(l_cnames,’,');
    L_BINDVARS := RTRIM(L_BINDVARS,’,');
    L_INPUT := UTL_FILE.FOPEN( P_DIR, P_FILENAME, ‘r’ );
    IF p_ignore_headerlines > 0
    THEN
    BEGIN
    FOR i IN 1 .. p_ignore_headerlines
    LOOP
    UTL_FILE.get_line(l_input, l_lastLine);
    END LOOP;
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN
    v_eof := TRUE;
    end;
    END IF;
    if not v_eof then
    dbms_sql.parse( l_theCursor, ‘insert into ‘ || p_table || ‘(‘ || l_cnames || ‘) values (‘ || l_bindvars || ‘)’, dbms_sql.native );
    loop
    begin
    utl_file.get_line( l_input, l_lastLine );
    exception
    when NO_DATA_FOUND then
    exit;
    end;
    if length(l_lastLine) > 0 then
    for i in 1 .. l_cnt-1
    LOOP
    dbms_sql.bind_variable( l_theCursor, ‘:b’||i,
    ltrim(rtrim(rtrim(
    regexp_substr(l_lastLine,’([^|]*)(\||$)’,1,i),p_delimiter),p_optional_enclosed),p_optional_enclosed));
    end loop;
    begin
    l_status := dbms_sql.execute(l_theCursor);
    l_rowCount := l_rowCount + 1;
    exception
    when OTHERS then
    L_ERRMSG := SQLERRM;
    insert into BADLOG ( TABLE_NAME, ERRM, data, ERROR_DATE )
    values ( P_TABLE,l_errmsg, l_lastLine ,systimestamp );
    end;
    end if;
    end loop;
    dbms_sql.close_cursor(l_theCursor);
    utl_file.fclose( l_input );
    commit;
    end if;
    insert into IMPORT_HIST (FILENAME,TABLE_NAME,NUM_OF_REC,IMPORT_DATE)
    values ( P_FILENAME, P_TABLE,l_rowCount,sysdate );
    UTL_FILE.FRENAME(
    P_DIR,
    P_FILENAME,
    P_DIR,
    REPLACE(P_FILENAME,
    ‘.txt’,
    ‘_’ || TO_CHAR(SYSDATE, ‘DD_MON_RRRR_HH24_MI_SS_AM’) || ‘.txt’
    commit;
    RETURN L_ROWCOUNT;
    end TABLE_LOAD;
    Note: when you run the function then it will also modify the source flat file with timestamp , so that we can have the track like which file was loaded .
    3) Check if the user is having UTL_FILE privileges or not :
    SQL> SELECT OWNER,
    OBJECT_TYPE
    FROM ALL_OBJECTS
    WHERE OBJECT_NAME = ‘UTL_FILE’
    AND OWNER =<>;
    If the user is not having the privileges then grant “UTL_FILE” to user from SYS user:
    SQL> GRANT EXECUTE ON UTL_FILE TO <>;
    4) In the function I have used two tables like:
    import_hist table and badlog table to track the history of the load and another to check the bad log if it occurs while doing the load .
    Under the same user create an error log table to log the error out records while doing the import:
    SQL> CREATE TABLE badlog
    errm VARCHAR2(4000),
    data VARCHAR2(4000) ,
    error_date TIMESTAMP
    Under the same user create Load history table to log the details of the file and tables that are imported with a track of records loaded:
    SQL> create table IMPORT_HIST
    FILENAME varchar2(200),
    TABLE_NAME varchar2(200),
    NUM_OF_REC number,
    IMPORT_DATE DATE
    5) Finally run the PLSQL block and check if it is loading properly or not if not then check the badlog:
    Execute the PLSQL block to import the data from the USER:
    SQL> declare
    P_TABLE varchar2(200):=<>;
    P_DIR varchar2(200):=<>;
    P_FILENAME VARCHAR2(200):=<>;
    v_Return NUMBER;
    BEGIN
    v_Return := TABLE_LOAD(
    P_TABLE => P_TABLE,
    P_DIR => P_DIR,
    P_FILENAME => P_FILENAME,
    P_IGNORE_HEADERLINES => P_IGNORE_HEADERLINES,
    P_DELIMITER => P_DELIMITER,
    P_OPTIONAL_ENCLOSED => P_OPTIONAL_ENCLOSED
    DBMS_OUTPUT.PUT_LINE(‘v_Return = ‘ || v_Return);
    end;
    6) Once the PLSQL block is been executed then check for any error log table and also the target table if the records are been successfully imported or not.

  • To read the column names of an internal table

    Hi ,
    I want to read the column/field names of an internal table into another internal table.
    How can this be done?
    Kind Regards,
    hgarsht Rungta

    Hi ,
    you can get the attributes of any internal table into another ..
    check the following code ..
    DATA : it_mara TYPE STANDARD TABLE OF mara  WITH HEADER LINE.
    DATA : it_detail   TYPE abap_compdescr_tab,
               wa_comp TYPE abap_compdescr.
    DATA : ref_descr TYPE REF TO cl_abap_structdescr.
    ref_descr ?= cl_abap_typedescr=>describe_by_data( it_mara ).
    it_detail[] = ref_descr->components .
    loop at it_detail into wa_comp.
    write:/ wa_comp-name .
    endloop.
    Regards,
    Rajesh Kumar

  • Error reading  XMLType column

    Hi All,
    I know that this has been asked before but i've tried some of the recommendations and still doesn't work for me:(
    I have table with a column of XMLType and it's related with a xmlschema registered in the db.I'm working with oracle 10g.
    I'm trying to retrive the column value and create and xml file here's my code:
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    m_Connection = DriverManager.getConnection("jdbc:oracle:oci8:@" +
    sIP + ":" + sPort + ":" + sSchemaName,
    sSchemaUsername, sSchemaPasswd);
    OraclePreparedStatement s = (OraclePreparedStatement)m_Connection.prepareStatement(qryStr);
    ResultSet rset = s.executeQuery(qryStr);
    OracleResultSet orset = (OracleResultSet) rset;
    while (orset.next()) {
    XMLType xt = XMLType.createXML(orset.getOPAQUE(1));
    Document dom = xt.getDOM();
    return dom;
    but i get this error:
    java.sql.SQLException: Only LOB or thin Storage is supported in Thin XMLType
         at oracle.xdb.XMLType.processThin(XMLType.java:1979)
         at oracle.xdb.XMLType.<init>(XMLType.java:974)
         at oracle.xdb.XMLType.createXML(XMLType.java:525)
    any ideas?
    thanks
    viki

    Viki
    This is not as elegant as we would like...
    Basically here's the matrix
    Storage                  Driver              DOM  Class
    Object                    OCI                oracle.xdb.dom.XDBDocument + Lazy DOM
    Object                    Thin                N/A - See workaround below
    Text                       OCI                 oracle.xdb.dom.XDBDocument - Lazy DOM
    Text                       Thin                oracle.xml.parser.v2.XMLDocumentHere is the code that demonstrates this
    package com.oracle.st.xmldb.pm.examples;
    import com.oracle.st.xmldb.pm.common.baseApp.BaseApplication;
    import java.io.Reader;
    import oracle.jdbc.OracleConnection;
    import oracle.jdbc.OraclePreparedStatement;
    import oracle.jdbc.OracleResultSet;
    import oracle.sql.CLOB;
    import oracle.xdb.XMLType;
    import oracle.xml.parser.v2.DOMParser;
    import org.xml.sax.XMLReader;
    public class GetXMLType extends BaseApplication
       public void doSomething(String[] Args) throws Exception
         OraclePreparedStatement  statement = null;
         String statementText;
         statementText = "select object_value from " + getSettings("TargetTable") + " where rownum < 2";
         System.out.println("GetXMLType.doSomething : Driver Type = " + this.getDriver() + ". Statement = " + statementText);
         OracleResultSet resultSet = null;
         org.w3c.dom.Document  doc = null;
         XMLType xml;
         statement = (OraclePreparedStatement) getConnection().prepareStatement(statementText);
         resultSet = (OracleResultSet) statement.executeQuery();
         while (resultSet.next())
             xml = (XMLType) resultSet.getObject(1);
             doc = xml.getDOM();
             System.out.println("GetXMLType.doSomething : DOM = " + doc.getClass().getName());
             xml.close();
           resultSet.close();
           statement.close();
           getConnection().close();
      public static void main (String[] args)
        try
          GetXMLType example = new GetXMLType();
          example.initializeConnection();
          example.doSomething(args);
        catch (Exception e)
          e.printStackTrace();
    }OCI Driver on XMLType with object persistance (OR Storage)
    ConnectionProvider.establishConnection(): Connecting as SCOTT/TIGER@jdbc:oracle:oci8:@(description=(address=(host=localhost)(protocol=tcp)(port=1521))(connect_data=(service_name=ORA10GR2.xp.mark.drake.oracle.com)(server=DEDICATED)))
    ConnectionProvider.establishConnection(): Database Connection Established
    GetXMLType.doSomething : Driver Type = OCI. Statement = select object_value from PURCHASEORDER where rownum < 2
    GetXMLType.doSomething : DOM = oracle.xdb.dom.XDBDocument
    Process exited with exit code 0OCI Driver with on XMLType with Text Persistance.
    ConnectionProvider.establishConnection(): Connecting as SCOTT/TIGER@jdbc:oracle:oci8:@(description=(address=(host=localhost)(protocol=tcp)(port=1521))(connect_data=(service_name=ORA10GR2.xp.mark.drake.oracle.com)(server=DEDICATED)))
    ConnectionProvider.establishConnection(): Database Connection Established
    GetXMLType.doSomething : Driver Type = OCI. Statement = select object_value from PURCHASEORDER_CLOB where rownum < 2
    GetXMLType.doSomething : DOM = oracle.xdb.dom.XDBDocument
    Process exited with exit code 0.Thin Driver on XMLType with object persistance (OR Storage)
    ConnectionProvider.establishConnection(): Connecting as SCOTT/TIGER@jdbc:oracle:thin:@localhost:1521:ORA10GR2
    ConnectionProvider.establishConnection(): Database Connection Established
    GetXMLType.doSomething : Driver Type = Thin. Statement = select object_value from PURCHASEORDER where rownum < 2
    java.sql.SQLException: Only LOB or String Storage is supported in Thin XMLType
         at oracle.xdb.XMLType.processThin(XMLType.java:2264)
         at oracle.xdb.XMLType.<init>(XMLType.java:1089)
         at oracle.xdb.XMLType.createXML(XMLType.java:583)
         at oracle.xdb.XMLType.createXML(XMLType.java:565)
         at oracle.xdb.XMLTypeFactory.create(XMLTypeFactory.java:73)
         at oracle.sql.OPAQUE.toClass(OPAQUE.java:376)
         at oracle.sql.OPAQUE.toJdbc(OPAQUE.java:318)
         at oracle.jdbc.driver.NamedTypeAccessor.getObject(NamedTypeAccessor.java:144)
         at oracle.jdbc.driver.NamedTypeAccessor.getObject(NamedTypeAccessor.java:100)
         at oracle.jdbc.driver.OracleResultSetImpl.getObject(OracleResultSetImpl.java:915)
         at com.oracle.st.xmldb.pm.examples.GetXMLType.doSomething(GetXMLType.java:73)
         at com.oracle.st.xmldb.pm.examples.GetXMLType.main(GetXMLType.java:89)
    Process exited with exit code 0.Thin Driver on XMLType with Text persistance (CLOB Storage)
    ConnectionProvider.establishConnection(): Connecting as SCOTT/TIGER@jdbc:oracle:thin:@localhost:1521:ORA10GR2
    ConnectionProvider.establishConnection(): Database Connection Established
    GetXMLType.doSomething : Driver Type = Thin. Statement = select object_value from PURCHASEORDER_CLOB where rownum < 2
    GetXMLType.doSomething : DOM = oracle.xml.parser.v2.XMLDocument
    Process exited with exit code 0You can get a DOM from an Object persisted XMLType via the Thin Driver using the following workaround
    package com.oracle.st.xmldb.pm.examples;
    import com.oracle.st.xmldb.pm.common.baseApp.BaseApplication;
    import java.io.Reader;
    import oracle.jdbc.OracleConnection;
    import oracle.jdbc.OraclePreparedStatement;
    import oracle.jdbc.OracleResultSet;
    import oracle.sql.CLOB;
    import oracle.xdb.XMLType;
    import oracle.xml.parser.v2.DOMParser;
    import org.xml.sax.XMLReader;
    public class GetDOMFromCLOB extends BaseApplication
       public void doSomething(String[] Args) throws Exception
         OraclePreparedStatement  statement = null;
         String statementText;
         statementText = "select p.object_value.getClobVal() from " + getSetting("TargetTable") + " p where rownum < 2";
         System.out.println("GetXMLType.doSomething : Driver Type = " + this.getDriver() + ". Statement = " + statementText);
         OracleResultSet resultSet = null;
         org.w3c.dom.Document  doc = null;
         CLOB clob;
         statement = (OraclePreparedStatement) getConnection().prepareStatement(statementText);
         resultSet = (OracleResultSet) statement.executeQuery();
         while (resultSet.next())
            clob  = resultSet.getCLOB(1);
            DOMParser parser = new DOMParser();
            parser.parse(clob.getCharacterStream());
            doc = parser.getDocument();
            System.out.println("GetXMLType.doSomething : DOM = " + doc.getClass().getName());
           resultSet.close();
           statement.close();
           getConnection().close();
      public static void main (String[] args)
        try
          GetDOMFromCLOB example = new GetDOMFromCLOB();
          example.initializeConnection();
          example.doSomething(args);
        catch (Exception e)
          e.printStackTrace();
    }which generates the following output...
    ConnectionProvider.establishConnection(): Connecting as SCOTT/TIGER@jdbc:oracle:thin:@localhost:1521:ORA10GR2
    ConnectionProvider.establishConnection(): Database Connection Established
    GetXMLType.doSomething : Driver Type = Thin. Statement = select p.object_value.getClobVal() from PURCHASEORDER p where rownum < 2
    GetXMLType.doSomething : DOM = oracle.xml.parser.v2.XMLDocument
    Process exited with exit code 0.This works by creating a CLOB from the XMLType and then reparsing it to obtain a DOM on the client side... This is what happens under the covers when a Text persisted XMLType is processed using the Thin Driver.

  • Error - Failure inserting into the read-only column "Adj_ID".

    I received the error messages while importing data from one DB to another.
    Validating (Error)
    Messages
    Error 0xc0202049: Data Flow Task 1: Failure inserting into the read-only column "Adj_ID".
     (SQL Server Import and Export Wizard)
    Error 0xc0202045: Data Flow Task 1: Column metadata validation failed.
     (SQL Server Import and Export Wizard)
    Error 0xc004706b: Data Flow Task 1: "component "Destination 2 - Adjustments" (271)" failed validation and returned validation status "VS_ISBROKEN".
     (SQL Server Import and Export Wizard)
    Error 0xc004700c: Data Flow Task 1: One or more component failed validation.
     (SQL Server Import and Export Wizard)
    Error 0xc0024107: Data Flow Task 1: There were errors during task validation.
     (SQL Server Import and Export Wizard)

    >> Failure inserting into the
    read-only column "Adj_ID". 
    The error message is very clear(inserting to readonly column). Are you inserting data to  Identity or calculated column
    Satheesh
    My Blog

  • Read a Column from an Excel file

    Guys,
    Is there a way I can read a specific column from an excel file, use that data to query and select data from a table and then insert the output into another column of that same excel file.
    Please advise! Thanks

    > Is there a way I can read a specific column from an excel file, use that data to query and select data from a
    table and then insert the output into another column of that same excel file.
    Not easily. An Excel file is typically in a proprietary binary file format. Perhaps saved using the new MS Office XML format.. which would be possible to process via Oracle's XDB.
    But assuming it is in a binary format, you need "something else" to read and parse that file for you - like ODBC or DDE or COM/DCOM, etc.
    Oracle supports Heterogeneous Database Services. On a Windows Server, you can create a database link in Oracle that uses an ODBC driver to connect to an ODBC data source. There are ODBC drivers for Excel. However, this requires the data in the worksheet to be properly marked as a data table. Or did last time I looked at it about 2 years ago.
    You can also call external "interfaces" from PL/SQL using EXTPROC - such interfaces can be DLLs. Which means you do have access to the Win32 API and application APIs from PL/SQL. This can be used to access the content of an Excel file - DDE for example can quite easily do this (you use it to peek the contents of an Excel grid location), but requires Excel to be running and that spreadsheet to be loaded. DDE can also be used to poke contents (write something back to a cell in a spreadsheet).
    But using Oracle code to use an Excel file as a kind of database file... that IMO does not make a lot of sense. At all.

  • Cannot resize the message 'read/unread' column in leopard mail.

    I cannot seem to resize the message 'read/unread' column in leopard mail. All other columns (from, subject, date received, size etc) can be resized as normal, however the read/unread "blue dots" are taking up an inordinate amount of space and will not for the life of me resize!
    it is driving me crazy...is this a leopard bug or am I just doing something wrong? thank you very much.

    I cannot seem to resize the message 'read/unread' column in leopard mail. All other columns (from, subject, date received, size etc) can be resized as normal, however the read/unread "blue dots" are taking up an inordinate amount of space and will not for the life of me resize!
    it is driving me crazy...is this a leopard bug or am I just doing something wrong? thank you very much.

Maybe you are looking for

  • How to set White Balance details in Metadata Bridge Cs6 shooting with MarkIII 5D ?

    Is there any way to get detailed info of White Balance setting in Bridge Metadata ?  I'm getting only "custom" ; my instructor in College needs more detailed data in my contact sheets. Thanks for any imput

  • Multi-Tabbed PDF Output / 9i graphics

    1 - Is there a clean and easy way to create a multi-paged report (each page having a unique layout) using either 6i or 9i Reports? I already know how to create a multi-paged report with the same layout but am having a hard time creating a large docum

  • Installing photosmart C5283 on windows 8

    I have a Photosmart C5283 All in One. I bought a new computer - Lenovo Ideapad Z710. I want to install the printer onto the computer but I get a message that the operating system (windows 8) is not supported. How can I install the printer? I heard th

  • Security lock out question

    I have gone to update my apps, and am locked out because I forgot my password to many times. So I have reset my password and I.d but still the security is locked me out. I can not get into iTunes Store or download anything, or update anything because

  • Mainstage saving problems with nexus plugin

    I just bought a new macbook pro, 3.06 Ghz 4GB ram, mostly to use it at live performances. I'm using Mainstage 2 with the softwaresynths from logic and also Nexus (Refx) The problem is that when I've added just a few nexus patches saving takes forever