Show the rtf formated data from CLOB Column

Hi all,
is it possible to show the rtf formatted text stored in a clob column on the report generated with bi publisher?
A step-by-step guidance wuold be nice.
I have created with bi publisher a report, generated a data source and sql query.
But in ms word it will not be shown as formatted. All rtf tags will be shown too.
Regards,

Hi Leonid,
A) =======
I'd be keen if someone like Tim would pick up on this and advise the full list of supported fo:instream-foreign-object content-type's that BI Publisher supports, would be nice if there was application/pdf and as you require application/rtf or similar. That way you'd just base64 encode your file in your XML output as per images like jpg/gif/png and include it in your template.
Desirable syntax would then be like:
<fo:instream-foreign-object content-type="application/rtf" >
<xsl:value-of select="MY_BASE64_RTF_ELEMENT"/>
</fo:instream-foreign-object>However thats wishful thinking as I can only see documented support for images specifically in jpg / gif / png formats.
B) =======
As a workaround if you have the ability to update your RTFs files (clobs) then you can just use the standard subtemplate functionality.
In that case the approach would be:
1. Update the RTFs (stored as clobs) to surround with template syntax:
<?template:DefSubTemp?>
... your RTF doc here ...
<?end template?>2. Take your clob and setup/upload as template (subtemplate=yes) manual or backend automate.
3. Add the subtemplate to your main template (assuming you register under Application Object Library, code XXV8_SUBTEMP, language English and territory United States):
<?import:xdo://FND.XXV8_SUBTEMP.EN.US?>
<?call-template:DefSubTemp?>C) =======
If you don't have the ability to update your RTF CLOBs and neither of the other solutions are suitable, then one of thing I thought of is on the fly conversion of the RTFs to, say, PNG and then use the image functionality to embed the image in the output. But again this may not be suitable as it will be an image not the "textual" output.
D) =======
All else failing you could look into the XML Publisher APIs to see if those could help.
Hopefully something for you to think about here and get more info on.
Regards,
Gareth
Blog: http://garethroberts.blogspot.com/

Similar Messages

  • How to retreive soap xml data from clob column in a table

    Hi,
    I am trying to retrieve the XML tag value from clob column.
    Table name = xyz and column= abc (clob datatype)
    data stored in abc column is as below
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:head="http://www.abc.com/gcgi/shared/system/header" xmlns:v6="http://www.abc.com/gcgi/services/v6_0_0_0" xmlns:sys="http://www.abc.com/gcgi/shared/system/systemtypes">
    <soapenv:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">
    <RqHeader soapenv:mustUnderstand="0" xmlns="http://www.abc.com/gcgi/shared/system/header">
    <DateAndTimeStamp>2011-12-20T16:02:36.677+08:00</DateAndTimeStamp>
    <UUID>1000002932</UUID>
    <Version>6_0_0_0</Version>
    <ClientDetails>
    <Org>ABC</Org>
    <OrgUnit>ABC</OrgUnit>
    <ChannelID>HBK</ChannelID>
    <TerminalID>0000</TerminalID>
    <SrcCountryCode>SG</SrcCountryCode>
    <DestCountryCode>SG</DestCountryCode>
    <UserGroup>HBK</UserGroup>
    </ClientDetails>
    </RqHeader>
    <wsa:Action>/SvcImpl/bank/
    SOAPEndpoint/AlertsService.serviceagent/OpEndpointHTTP/AlertDeleteInq</wsa:Action></soapenv:Header>
    <soapenv:Body>
    <v6:AlertDeleteInqRq>
    <v6:Base>
    <v6:VID>20071209013112</v6:VID>
    <!--Optional:-->
    <v6:Ref>CTAA00000002644</v6:Ref>
    </v6:Base>
    </v6:AlertDeleteInqRq>
    </soapenv:Body>
    </soapenv:Envelope>
    And i want to retrieve the values of tag
    <ChannelID> and <v6:VID>
    can somebody help, i have tried with extractvalue but not able to get the values

    I have used the below two queries but not able to get the expected results. Both queries result into no values.
    select xmltype(MED_REQ_PAYLOAD).extract('//ClientDetails/Org','xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" || xmlns="http://www.abc.com/gcgi/shared/system/header"').getStringValue() from ESB_OUTPUT_TEMP where SOAPACTION = '/SvcImpl/bank/alerts/v6_0_0_0/SOAPEndpoint/AlertsService.serviceagent/OpEndpointHTTP/AlertDeleteInq'
    select EXTRACTVALUE(xmltype(MED_REQ_PAYLOAD),'/RqHeader/) from ESB_OUTPUT_TEMP where SOAPACTION = '/SvcImpl/bank/SOAPEndpoint/AlertsService.serviceagent/OpEndpointHTTP/AlertDeleteInq'
    Well, for starters, both queries are syntactically wrong :
    - non terminated string
    - incorrect namespace mapping declaration
    - unknown XMLType method "getStringValue()"
    Secondly, all those functions are deprecated now.
    Here's an up-to-date example using XMLTable. It will retrieve the two tag values you mentioned :
    SQL> select x.*
      2  from esb_output_temp t
      3     , xmltable(
      4         xmlnamespaces(
      5           'http://schemas.xmlsoap.org/soap/envelope/' as "soap"
      6         , 'http://www.abc.com/gcgi/shared/system/header' as "head"
      7         , 'http://www.abc.com/gcgi/services/v6_0_0_0' as "v6"
      8         )
      9       , '/soap:Envelope'
    10         passing xmlparse(document t.med_req_payload)
    11         columns ChannelID  varchar2(10) path 'soap:Header/head:RqHeader/head:ClientDetails/head:ChannelID'
    12               , VID        varchar2(30) path 'soap:Body/v6:AlertDeleteInqRq/v6:Base/v6:VID'
    13       ) x
    14  ;
    CHANNELID  VID
    HBK        20071209013112
    You may also want to store XML in XMLType columns for both performance and storage optimizations.

  • How can I get iCal not to show the same birthday dates from my iCloud

    How can I get iCal not to show the same birthday dates from my iCloud?

    You don't need them stored locally for a backup. You can manually export your contacts as archive for backup. Also, if you are backing up with Time Machine, you already have a backup. If your hard drive crashed, you would have to rely on your backup or iCloud anyway.
    So, if you're comfortable with that, sign out of iCloud. Choose to delete contacts from the computer. When you sign back into iCloud, you should only have iCloud contacts listed in AB. When you open iCal, you should only have one listing for birthdays.
    The other alternative is to disable the Birthday c.alendar and create one manually.

  • Error reading data from CLOB column into VARCHAR2 variable

    Hi all,
    Am hitting an issue retrieving data > 8K (minus 1) stored in a CLOB column into a VARCHAR2 variable in PL/SQL...
    The "problem to be solved" here is storing DDL, in this case a "CREATE VIEW" statement, that is longer than 8K for later retrieval (and execution) using dynamic SQL. Given that the EXECUTE IMMEDIATE statement can take a VARCHAR2 variable (up to 32K(-1)), this should suffice for our needs, however, it seems that somewhere in the process of converting this VARCHAR2 text to a CLOB for storage, and then retrieving the CLOB and attempting to put it back into a VARCHAR2 variable, it is throwing a standard ORA-06502 exception ("PL/SQL: numeric or value error"). Consider the following code:
    set serveroutput on
    drop table test1;
    create table test1(col1 CLOB);
    declare
    cursor c1 is select col1 from test1;
    myvar VARCHAR2(32000);
    begin
    myvar := '';
    for i in 1..8192 loop
    myvar := myvar || 'a';
    end loop;
    INSERT INTO test1 (col1) VALUES (myvar);
    for arec in c1 loop
    begin
    myvar := arec.col1;
    dbms_output.put_line('Read data of length ' || length(myvar));
    exception when others then
    dbms_output.put_line('Error reading data: ' || sqlerrm);
    end;
    end loop;
    end;
    If you change the loop upper bound to 8191, all works fine. I'm guessing this might have something to do with the database character set -- we've recently converted our databases over to UTF-8, for Internationalizion support, and that seems to have changed underlying assumptions regarding character processing...?
    As far as the dynamic SQL issue goes, we can probably use the DBMS_SQL interface instead, with it's EXECUTE procedure that takes a PL/SQL array of varchar2(32K) - the only issue there is reading the data from the CLOB column, and then breaking that data into an array but that doesn't seem insurmountable. But this same basic issue (when a 9K text block, let's say, turns into a >32K block after being CLOBberred) seems to comes up in other text-processing situations also, so any ideas for how to resolve would be much appreciated.
    Thanks for any tips/hints/ideas...
    Jim

    For those curious about this, here's the word from Oracle support (courtesy of Metalinks):
    RESEARCH
    ========
    Test the issue for different DB version and different characterset.
    --Testing the following PL/SQL blocks by using direct assignment method(myvar := arec.col1;) on
    different database version and different characterset.
    SQL>create table test1(col1 CLOB);
    --Inserting four CLOB data into test1.
    declare
    myvar VARCHAR2(32767);
    begin
    myvar := RPAD('a',4000);
    INSERT INTO test1 (col1) VALUES (myvar);
    myvar := RPAD('a',8191);
    INSERT INTO test1 (col1) VALUES (myvar);
    myvar := RPAD('b',8192);
    INSERT INTO test1 (col1) VALUES (myvar);
    myvar := RPAD('c',32767);
    INSERT INTO test1 (col1) VALUES (myvar);
    commit;
    end;
    --Testing the direct assignment method.
    declare
    cursor c1 is select col1, length(col1) len1 from test1;
    myvar VARCHAR2(32767);
    begin
    for arec in c1 loop
    myvar := arec.col1;
    --DBMS_LOB.READ(arec.col1, arec.len1, 1, myvar);
    dbms_output.put_line('Read data of length: ' || length(myvar));
    end loop;
    end;
    The following are the summary of the test results:
    ===================================
    1. If the database characterset is WE8ISO8859P1, then the above direct assignment
    method(myvar := arec.col1;) works for database version 9i/10g/11g without any
    errors.
    2. If the database characterset is UTF8 or AL32UTF8, then the above direct assignment method(myvar := arec.col1;) will generate the "ORA-06502:
    PL/SQL: numeric or value error" when the length of the CLOB data is greater
    than 8191(=8K-1). The same error can be reproduced across all database versions
    9i/10g/11g.
    3. Using DBMS_LOB.READ(arec.col1, arec.len1, 1, myvar) method to read CLOB data into a VARCHAR2 variable works for both WE8ISO8859P1 and UTF8
    characterset and for all database versions.
    So - it seems as I'd surmised, UTF8 changes the way VARCHAR2 and CLOB data is handled. Not too surprising, I suppose - may you all be lucky enough to be able to stay away from this sort of issue. But - the DBMS_LOB.READ workaround is certainly sufficient for the text processing situations we find ourselves in currently.
    Cheers,
    Jim C.

  • How to retrieve the doc format data from the database?

    Hi Experts,
         I need to retrieve the doc files ( Cv's) from data base to my presentation server. In order to do that what is the field I can use?

    You can use officecontrol UI element for displaying doc files.
    below are some important links
    [Office Control|http://help.sap.com/saphelp_nw04/helpdata/en/5d/a0b16a9d2e4e4d8b2322af6728263f/content.htm]
    [example|http://help.sap.com/saphelp_srm40/helpdata/ru/ef/3483789514b748b6fe1f145e9685ab/content.htm]
    thanks
    sarbjeet singh

  • Reading Xml file from clob column in the staging table

    Hi,
    I am trying to poll the staging table with the database adapter which has CLOB column type containing XML file. How do I extract the XML file from CLOB and map the fields to the another variable with definite schema.
    Thanks,
    Edited by: chaitu123 on Sep 20, 2009 8:16 AM

    1) when you create DBAdapter on a table which having the clob column watch closely the created xsd for the DBAdapter the clob cloumn element should be a String data type
    2) create xsd for Xml File and create variable for the xsd element
    3) use ora:parseEscapedXML("yourDBAdapterclobElement") to XmlFileVarilable
    Krishna

  • Parse a xml file from clob column.

    Dear,
    i have been suffreing a problem about xml.
    i have a table with two columns, one is bfile data type other is clob data type. A xml data is stored into both cloumns
    as clob and bfile. My xml data format is correct.
    when i took xml data from bfile column, then dbms_xmlparser.parseClob successfully parse my xml data.
    Code below:
    =======================================
    dbms_lob.createtemporary(l_clob, cache=>FALSE);
    dbms_lob.loadFromFile(dest_lob => l_clob,
    src_lob => l_bfile,
    amount => dbms_lob.getLength(l_bfile));
    l_parser := dbms_xmlparser.newParser;
    dbms_xmlparser.parseClob(l_parser, l_clob); ========================================
    But when i took xml data form clob clumn directly, then dbms_xmlparser.parseClob parse failed and go to exception.
    Code below:
    ====================================================================
    dbms_lob.createtemporary(l_clob, cache=>FALSE);
    select xml_cfile,xml_bfile                    
    into l_clob ,l_bfile
    from xml_load_in
    l_parser := dbms_xmlparser.newParser;
    dbms_xmlparser.parseClob(l_parser, l_clob); --failed parse    
    ====================================================================
    declare
    l_bfile BFILE;
    l_clob CLOB;
    l_parser dbms_xmlparser.Parser;
    l_doc dbms_xmldom.DOMDocument;
    begin
    dbms_lob.createtemporary(l_clob, cache=>FALSE);
    select xml_cfile,xml_bfile
    into l_clob ,l_bfile
    from xml_load_in
    l_parser := dbms_xmlparser.newParser;
    dbms_xmlparser.parseClob(l_parser, l_clob);
    l_doc := dbms_xmlparser.getDocument(l_parser);
    dbms_lob.freetemporary(l_clob);
    dbms_xmlparser.freeParser(l_parser);
    exception
    dbms_lob.freetemporary(l_clob);
    dbms_xmlparser.freeParser(l_parser);
    dbms_xmldom.freeDocument(l_doc);
    End;
    Example:
    ======--File_name := Outward.xml;
    CREATE OR REPLACE DIRECTORY
    MY_INWARD AS
    'D:\PBM\Inward\';
    CREATE TABLE XML_LOAD_IN
    ( XML_CFILE CLOB,
    XML_BFILE BFILE
    INSERT INTO XML_LOAD_IN ( XML_CFILE, XML_BFILE )
    VALUES (
    '<?xml version="1.0" encoding="UTF-8"?>
    <BACPSInterface>
    <OCE>
    <EHR>
    <StandardLevel>03</StandardLevel>
    <TestFiledIndicator>T</TestFiledIndicator>
    <ImmediateDestRoutingNumber>
    <BankCode>070</BankCode>
    <DistrictCode>12</DistrictCode>
    <BranchCode>75</BranchCode>
    <CheckDigit>8</CheckDigit>
    </ImmediateDestRoutingNumber>
    <ImmediateOriginRoutingNumber>
    <BankCode>070</BankCode>
    <DistrictCode>12</DistrictCode>
    <BranchCode>75</BranchCode>
    <CheckDigit>8</CheckDigit>
    </ImmediateOriginRoutingNumber>
    <FileCreationDate>20090714</FileCreationDate>
    <FileCreationTime>1047</FileCreationTime>
    <ResendIndicator>N</ResendIndicator>
    <ECESettlementDate>20090714</ECESettlementDate>
    <ECESessionTime>1047</ECESessionTime>
    <ECESettlementTime>1047</ECESettlementTime>
    <ECEtype>01</ECEtype>
    <CountryCode>BD</CountryCode>
    </EHR>
    <Collection>
    <CHR>
    <CashLetterBusinessDate>20090714</CashLetterBusinessDate>
    <CashLetterCreationDate>20090714</CashLetterCreationDate>
    <CashLetterCreationTime>1047</CashLetterCreationTime>
    <CashLetterRecordTypeInd>I</CashLetterRecordTypeInd>
    <CashLetterDocTypeIndicator>G</CashLetterDocTypeIndicator>
    <CashLetterID>1</CashLetterID>
    <OriginatorContactName>Bank Asia</OriginatorContactName>
    <OriginatorContactPhoneNumber>XXX</OriginatorContactPhoneNumber>
    </CHR>
    <ForwardBundle>
    <BHR>
    <CollectionTypeIndicator>I</CollectionTypeIndicator>
    <DestRoutingNumber>
    <BankCode>070</BankCode>
    <DistrictCode>12</DistrictCode>
    <BranchCode>75</BranchCode>
    <CheckDigit>8</CheckDigit>
    </DestRoutingNumber>
    <ECEInstitutionRoutingNumber>
    <BankCode>070</BankCode>
    <DistrictCode>12</DistrictCode>
    <BranchCode>75</BranchCode>
    <CheckDigit>8</CheckDigit>
    </ECEInstitutionRoutingNumber>
    <BundleBusinessDate>20090714</BundleBusinessDate>
    <BundleCreationDate>20090714</BundleCreationDate>
    <BundleID>1</BundleID>
    <ReturnLocationRoutingNumber>070127538</ReturnLocationRoutingNumber>
    </BHR>
    <CDR>
    <CDR num="1">
    <ECESettlementDate>20090714</ECESettlementDate>
    <ECESessionTime>1047</ECESessionTime>
    <ECESettlementTime>1047</ECESettlementTime>
    <ECEItemType>N</ECEItemType>
    <IssuingBranchRoutingNumber>
    <BankCode>070</BankCode>
    <DistrictCode>12</DistrictCode>
    <BranchCode>75</BranchCode>
    <CheckDigit>8</CheckDigit>
    </IssuingBranchRoutingNumber>
    <AccountNumber>0000334008221</AccountNumber>
    <ChequeSequenceNumber>1601735</ChequeSequenceNumber>
    <ItemAmount>500</ItemAmount>
    <ECEInstitutionItemSequencNum>0701275380000001</ECEInstitutionItemSequencNum>
    <DocumentationTypeIndicator>I</DocumentationTypeIndicator>
    <ReturnAcceptanceIndicator>6</ReturnAcceptanceIndicator>
    <MICRValidIndicator>1</MICRValidIndicator>
    <BOFDIndicator>Y</BOFDIndicator>
    <ChequeDetailRecAddendumCount>0</ChequeDetailRecAddendumCount>
    <CorrectionIndicator>0</CorrectionIndicator>
    <RepresentmentIndicator>0</RepresentmentIndicator>
    <ArchiveTypeIndicator>F</ArchiveTypeIndicator>
    </CDR>
    <CDR num="2">
    <ECESettlementDate>20090714</ECESettlementDate>
    <ECESessionTime>1047</ECESessionTime>
    <ECESettlementTime>1047</ECESettlementTime>
    <ECEItemType>N</ECEItemType>
    <IssuingBranchRoutingNumber>
    <BankCode>070</BankCode>
    <DistrictCode>12</DistrictCode>
    <BranchCode>75</BranchCode>
    <CheckDigit>8</CheckDigit>
    </IssuingBranchRoutingNumber>
    <AccountNumber>0000345682256</AccountNumber>
    <ChequeSequenceNumber>1234567</ChequeSequenceNumber>
    <ItemAmount>1000</ItemAmount>
    <ECEInstitutionItemSequencNum>0701275380000002</ECEInstitutionItemSequencNum>
    <DocumentationTypeIndicator>I</DocumentationTypeIndicator>
    <ReturnAcceptanceIndicator>6</ReturnAcceptanceIndicator>
    <MICRValidIndicator>1</MICRValidIndicator>
    <BOFDIndicator>Y</BOFDIndicator>
    <ChequeDetailRecAddendumCount>0</ChequeDetailRecAddendumCount>
    <CorrectionIndicator>0</CorrectionIndicator>
    <RepresentmentIndicator>0</RepresentmentIndicator>
    <ArchiveTypeIndicator>F</ArchiveTypeIndicator>
    </CDR>
    </CDR>
    <CDA>
    <CDA num="1">
    <AddendumRecordNumber>1</AddendumRecordNumber>
    <BOFDRoutingNumber>
    <BankCode>070</BankCode>
    <DistrictCode>75</DistrictCode>
    <BranchCode>12</BranchCode>
    <CheckDigit>8</CheckDigit>
    </BOFDRoutingNumber>
    <BOFDBusinessEndorsementDate>20090714</BOFDBusinessEndorsementDate>
    <BOFDDepositAccountNumber>0000334008221</BOFDDepositAccountNumber>
    <BOFDDepositBranch>753</BOFDDepositBranch>
    <PayeeName>XXX</PayeeName>
    <TruncationIndicator>Y</TruncationIndicator>
    <BOFDConversionIndicator>2</BOFDConversionIndicator>
    <BOFDCorrectionIndicator>0</BOFDCorrectionIndicator>
    </CDA>
    <CDA num="2">
    <AddendumRecordNumber>1</AddendumRecordNumber>
    <BOFDRoutingNumber>
    <BankCode>070</BankCode>
    <DistrictCode>75</DistrictCode>
    <BranchCode>12</BranchCode>
    <CheckDigit>8</CheckDigit>
    </BOFDRoutingNumber>
    <BOFDBusinessEndorsementDate>20090714</BOFDBusinessEndorsementDate>
    <BOFDDepositAccountNumber>0000345682256</BOFDDepositAccountNumber>
    <BOFDDepositBranch>753</BOFDDepositBranch>
    <PayeeName>XXX</PayeeName>
    <TruncationIndicator>Y</TruncationIndicator>
    <BOFDConversionIndicator>2</BOFDConversionIndicator>
    <BOFDCorrectionIndicator>0</BOFDCorrectionIndicator>
    </CDA>
    </CDA>
    <CDC>
    <CDC num="1">
    <AddendumCRecordNumber>1</AddendumCRecordNumber>
    <EndorsingBankRountingNumber>
    <BankCode>070</BankCode>
    <DistrictCode>12</DistrictCode>
    <BranchCode>75</BranchCode>
    <CheckDigit>8</CheckDigit>
    </EndorsingBankRountingNumber>
    <EndorsingBankEndorsementDate>20090714</EndorsingBankEndorsementDate>
    <EndorsingBankEndorsementDate>20090714</EndorsingBankEndorsementDate>
    <EndorsingBankItemSequenceNum>0701275380000001</EndorsingBankItemSequenceNum>
    <TruncationIndicator>Y</TruncationIndicator>
    <EndorsingBankConversionInd>2</EndorsingBankConversionInd>
    <EndorsingBankCorrectionInd>0</EndorsingBankCorrectionInd>
    </CDC>
    <CDC num="2">
    <AddendumCRecordNumber>1</AddendumCRecordNumber>
    <EndorsingBankRountingNumber>
    <BankCode>070</BankCode>
    <DistrictCode>12</DistrictCode>
    <BranchCode>75</BranchCode>
    <CheckDigit>8</CheckDigit>
    </EndorsingBankRountingNumber>
    <EndorsingBankEndorsementDate>20090714</EndorsingBankEndorsementDate>
    <EndorsingBankEndorsementDate>20090714</EndorsingBankEndorsementDate>
    <EndorsingBankItemSequenceNum>0701275380000002</EndorsingBankItemSequenceNum>
    <TruncationIndicator>Y</TruncationIndicator>
    <EndorsingBankConversionInd>2</EndorsingBankConversionInd>
    <EndorsingBankCorrectionInd>0</EndorsingBankCorrectionInd>
    </CDC>
    </CDC>
    <IVD>
    <IVD num="1">
    <ImageIndicator>1</ImageIndicator>
    <ImageCreatorRountingNumber>
    <BankCode>070</BankCode>
    <DistrictCode>12</DistrictCode>
    <BranchCode>75</BranchCode>
    <CheckDigit>8</CheckDigit>
    </ImageCreatorRountingNumber>
    <ImageCreatorDate>20090714</ImageCreatorDate>
    <ImageViewFormatIndicator>0</ImageViewFormatIndicator>
    <ImageViewCompressionAlg>0</ImageViewCompressionAlg>
    <ViewSideIndicator>0</ViewSideIndicator>
    <ViewDescriptor>0</ViewDescriptor>
    <DigitalSignatureIndicator>1</DigitalSignatureIndicator>
    <DigitalSignatureMethod>0</DigitalSignatureMethod>
    <SecurityKeySize>12235</SecurityKeySize>
    <ImageRecreateIndicator>0</ImageRecreateIndicator>
    </IVD>
    <IVD num="2">
    <ImageIndicator>1</ImageIndicator>
    <ImageCreatorRountingNumber>
    <BankCode>070</BankCode>
    <DistrictCode>12</DistrictCode>
    <BranchCode>75</BranchCode>
    <CheckDigit>8</CheckDigit>
    </ImageCreatorRountingNumber>
    <ImageCreatorDate>20090714</ImageCreatorDate>
    <ImageViewFormatIndicator>0</ImageViewFormatIndicator>
    <ImageViewCompressionAlg>0</ImageViewCompressionAlg>
    <ViewSideIndicator>0</ViewSideIndicator>
    <ViewDescriptor>0</ViewDescriptor>
    <DigitalSignatureIndicator>1</DigitalSignatureIndicator>
    <DigitalSignatureMethod>0</DigitalSignatureMethod>
    <SecurityKeySize>12235</SecurityKeySize>
    <ImageRecreateIndicator>0</ImageRecreateIndicator>
    </IVD>
    </IVD>
    <IVT>
    <IVT num="1">
    <ECEInstitutionRoutingNumber>
    <BankCode>070</BankCode>
    <DistrictCode>12</DistrictCode>
    <BranchCode>75</BranchCode>
    <CheckDigit>8</CheckDigit>
    </ECEInstitutionRoutingNumber>
    <BundleBusinessDate>20090714</BundleBusinessDate>
    <CycleNumber>0</CycleNumber>
    <ECEInstitutionItemSeqNumber>0701275380000001</ECEInstitutionItemSeqNumber>
    <ClippingOrigin>
    <Origin>0</Origin>
    <CoordinateH1>0000</CoordinateH1>
    <CoordinateH2>0000</CoordinateH2>
    <CoordinateV1>0000</CoordinateV1>
    <CoordinateV2>0000</CoordinateV2>
    </ClippingOrigin>
    <LengthofImageReferenceKey>0</LengthofImageReferenceKey>
    <LengthofDigitalSignature>0</LengthofDigitalSignature>
    <LengthofImageData>1</LengthofImageData>
    <OffsetToImageData>01001000</OffsetToImageData>
    </IVT>
    <IVT num="2">
    <ECEInstitutionRoutingNumber>
    <BankCode>070</BankCode>
    <DistrictCode>12</DistrictCode>
    <BranchCode>75</BranchCode>
    <CheckDigit>8</CheckDigit>
    </ECEInstitutionRoutingNumber>
    <BundleBusinessDate>20090714</BundleBusinessDate>
    <CycleNumber>0</CycleNumber>
    <ECEInstitutionItemSeqNumber>0701275380000002</ECEInstitutionItemSeqNumber>
    <ClippingOrigin>
    <Origin>0</Origin>
    <CoordinateH1>0000</CoordinateH1>
    <CoordinateH2>0000</CoordinateH2>
    <CoordinateV1>0000</CoordinateV1>
    <CoordinateV2>0000</CoordinateV2>
    </ClippingOrigin>
    <LengthofImageReferenceKey>0</LengthofImageReferenceKey>
    <LengthofDigitalSignature>0</LengthofDigitalSignature>
    <LengthofImageData>1</LengthofImageData>
    <OffsetToImageData>01001000</OffsetToImageData>
    </IVT>
    </IVT>
    <IVA>
    <IVA num="1">
    <GlobalImageQuality>0</GlobalImageQuality>
    <GlobalImageUsability>1</GlobalImageUsability>
    <ImagingBankSpecificTest>1</ImagingBankSpecificTest>
    </IVA>
    <IVA num="2">
    <GlobalImageQuality>0</GlobalImageQuality>
    <GlobalImageUsability>1</GlobalImageUsability>
    <ImagingBankSpecificTest>1</ImagingBankSpecificTest>
    </IVA>
    </IVA>
    <BCR>
    <ItemsWithinBundleCount>2</ItemsWithinBundleCount>
    <BundleTotalAmount>1500</BundleTotalAmount>
    <MICRValidTotalAmount>1500</MICRValidTotalAmount>
    </BCR>
    </ForwardBundle>
    <CCR>
    <BundleCount>1</BundleCount>
    <ItemWithinCashLetterCount>2</ItemWithinCashLetterCount>
    <CashLetterTotalAmount>1500</CashLetterTotalAmount>
    <ImagesWithinCashLetterCount>2</ImagesWithinCashLetterCount>
    <ECEInstitutionName>Bank Asia</ECEInstitutionName>
    <SettlementDate>20090714</SettlementDate>
    </CCR>
    </Collection>
    <ECR>
    <CashLetterCount>1</CashLetterCount>
    <TotalRecordCount>2</TotalRecordCount>
    <TotalItemCount>2</TotalItemCount>
    <FileTotalAmount>1500</FileTotalAmount>
    <ImmediateOriginContactName>Bank Asia</ImmediateOriginContactName>
    <ImmediateOriginContactNumber>XXX</ImmediateOriginContactNumber>
    </ECR>
    </OCE>
    </BACPSInterface>'
    , BFILENAME('MY_INWARD','Outward.xml'));
    COMMIT;

    What version of Oracle (4 digits) and what is the error?
    This runs without error on 10.2.0.4 (though you can go directly from a CLOB to a DOMDocument via dbms_xmldom)
    -- Created on 9/14/2009 by JH20567
    declare
      -- Local variables here
      l_clob   CLOB;
      l_parser dbms_xmlparser.Parser;
      l_doc    dbms_xmldom.DOMDocument;
    begin
      -- Test statements here
       l_clob := '<?xml version="1.0" encoding="UTF-8"?>
    <BACPSInterface>
       <OCE>
          <EHR>
             <StandardLevel>03</StandardLevel>
             <TestFiledIndicator>T</TestFiledIndicator>
             <ImmediateDestRoutingNumber>
                <BankCode>070</BankCode>
                <DistrictCode>12</DistrictCode>
                <BranchCode>75</BranchCode>
                <CheckDigit>8</CheckDigit>
             </ImmediateDestRoutingNumber>
             <ImmediateOriginRoutingNumber>
                <BankCode>070</BankCode>
                <DistrictCode>12</DistrictCode>
                <BranchCode>75</BranchCode>
                <CheckDigit>8</CheckDigit>
             </ImmediateOriginRoutingNumber>
             <FileCreationDate>20090714</FileCreationDate>
             <FileCreationTime>1047</FileCreationTime>
             <ResendIndicator>N</ResendIndicator>
             <ECESettlementDate>20090714</ECESettlementDate>
             <ECESessionTime>1047</ECESessionTime>
             <ECESettlementTime>1047</ECESettlementTime>
             <ECEtype>01</ECEtype>
             <CountryCode>BD</CountryCode>
          </EHR>
          <Collection>
             <CHR>
                <CashLetterBusinessDate>20090714</CashLetterBusinessDate>
                <CashLetterCreationDate>20090714</CashLetterCreationDate>
                <CashLetterCreationTime>1047</CashLetterCreationTime>
                <CashLetterRecordTypeInd>I</CashLetterRecordTypeInd>
                <CashLetterDocTypeIndicator>G</CashLetterDocTypeIndicator>
                <CashLetterID>1</CashLetterID>
                <OriginatorContactName>Bank Asia</OriginatorContactName>
                <OriginatorContactPhoneNumber>XXX</OriginatorContactPhoneNumber>
             </CHR>
             <ForwardBundle>
                <BHR>
                   <CollectionTypeIndicator>I</CollectionTypeIndicator>
                   <DestRoutingNumber>
                      <BankCode>070</BankCode>
                      <DistrictCode>12</DistrictCode>
                      <BranchCode>75</BranchCode>
                      <CheckDigit>8</CheckDigit>
                   </DestRoutingNumber>
                   <ECEInstitutionRoutingNumber>
                      <BankCode>070</BankCode>
                      <DistrictCode>12</DistrictCode>
                      <BranchCode>75</BranchCode>
                      <CheckDigit>8</CheckDigit>
                   </ECEInstitutionRoutingNumber>
                   <BundleBusinessDate>20090714</BundleBusinessDate>
                   <BundleCreationDate>20090714</BundleCreationDate>
                   <BundleID>1</BundleID>
                   <ReturnLocationRoutingNumber>070127538</ReturnLocationRoutingNumber>
                </BHR>
                <CDR>
                   <CDR num="1">
                      <ECESettlementDate>20090714</ECESettlementDate>
                      <ECESessionTime>1047</ECESessionTime>
                      <ECESettlementTime>1047</ECESettlementTime>
                      <ECEItemType>N</ECEItemType>
                      <IssuingBranchRoutingNumber>
                         <BankCode>070</BankCode>
                         <DistrictCode>12</DistrictCode>
                         <BranchCode>75</BranchCode>
                         <CheckDigit>8</CheckDigit>
                      </IssuingBranchRoutingNumber>
                      <AccountNumber>0000334008221</AccountNumber>
                      <ChequeSequenceNumber>1601735</ChequeSequenceNumber>
                      <ItemAmount>500</ItemAmount>
                      <ECEInstitutionItemSequencNum>0701275380000001</ECEInstitutionItemSequencNum>
                      <DocumentationTypeIndicator>I</DocumentationTypeIndicator>
                      <ReturnAcceptanceIndicator>6</ReturnAcceptanceIndicator>
                      <MICRValidIndicator>1</MICRValidIndicator>
                      <BOFDIndicator>Y</BOFDIndicator>
                      <ChequeDetailRecAddendumCount>0</ChequeDetailRecAddendumCount>
                      <CorrectionIndicator>0</CorrectionIndicator>
                      <RepresentmentIndicator>0</RepresentmentIndicator>
                      <ArchiveTypeIndicator>F</ArchiveTypeIndicator>
                   </CDR>
                   <CDR num="2">
                      <ECESettlementDate>20090714</ECESettlementDate>
                      <ECESessionTime>1047</ECESessionTime>
                      <ECESettlementTime>1047</ECESettlementTime>
                      <ECEItemType>N</ECEItemType>
                      <IssuingBranchRoutingNumber>
                         <BankCode>070</BankCode>
                         <DistrictCode>12</DistrictCode>
                         <BranchCode>75</BranchCode>
                         <CheckDigit>8</CheckDigit>
                      </IssuingBranchRoutingNumber>
                      <AccountNumber>0000345682256</AccountNumber>
                      <ChequeSequenceNumber>1234567</ChequeSequenceNumber>
                      <ItemAmount>1000</ItemAmount>
                      <ECEInstitutionItemSequencNum>0701275380000002</ECEInstitutionItemSequencNum>
                      <DocumentationTypeIndicator>I</DocumentationTypeIndicator>
                      <ReturnAcceptanceIndicator>6</ReturnAcceptanceIndicator>
                      <MICRValidIndicator>1</MICRValidIndicator>
                      <BOFDIndicator>Y</BOFDIndicator>
                      <ChequeDetailRecAddendumCount>0</ChequeDetailRecAddendumCount>
                      <CorrectionIndicator>0</CorrectionIndicator>
                      <RepresentmentIndicator>0</RepresentmentIndicator>
                      <ArchiveTypeIndicator>F</ArchiveTypeIndicator>
                   </CDR>
                </CDR>
                <CDA>
                   <CDA num="1">
                      <AddendumRecordNumber>1</AddendumRecordNumber>
                      <BOFDRoutingNumber>
                         <BankCode>070</BankCode>
                         <DistrictCode>75</DistrictCode>
                         <BranchCode>12</BranchCode>
                         <CheckDigit>8</CheckDigit>
                      </BOFDRoutingNumber>
                      <BOFDBusinessEndorsementDate>20090714</BOFDBusinessEndorsementDate>
                      <BOFDDepositAccountNumber>0000334008221</BOFDDepositAccountNumber>
                      <BOFDDepositBranch>753</BOFDDepositBranch>
                      <PayeeName>XXX</PayeeName>
                      <TruncationIndicator>Y</TruncationIndicator>
                      <BOFDConversionIndicator>2</BOFDConversionIndicator>
                      <BOFDCorrectionIndicator>0</BOFDCorrectionIndicator>
                   </CDA>
                   <CDA num="2">
                      <AddendumRecordNumber>1</AddendumRecordNumber>
                      <BOFDRoutingNumber>
                         <BankCode>070</BankCode>
                         <DistrictCode>75</DistrictCode>
                         <BranchCode>12</BranchCode>
                         <CheckDigit>8</CheckDigit>
                      </BOFDRoutingNumber>
                      <BOFDBusinessEndorsementDate>20090714</BOFDBusinessEndorsementDate>
                      <BOFDDepositAccountNumber>0000345682256</BOFDDepositAccountNumber>
                      <BOFDDepositBranch>753</BOFDDepositBranch>
                      <PayeeName>XXX</PayeeName>
                      <TruncationIndicator>Y</TruncationIndicator>
                      <BOFDConversionIndicator>2</BOFDConversionIndicator>
                      <BOFDCorrectionIndicator>0</BOFDCorrectionIndicator>
                   </CDA>
                </CDA>
                <CDC>
                   <CDC num="1">
                      <AddendumCRecordNumber>1</AddendumCRecordNumber>
                      <EndorsingBankRountingNumber>
                         <BankCode>070</BankCode>
                         <DistrictCode>12</DistrictCode>
                         <BranchCode>75</BranchCode>
                         <CheckDigit>8</CheckDigit>
                      </EndorsingBankRountingNumber>
                      <EndorsingBankEndorsementDate>20090714</EndorsingBankEndorsementDate>
                      <EndorsingBankEndorsementDate>20090714</EndorsingBankEndorsementDate>
                      <EndorsingBankItemSequenceNum>0701275380000001</EndorsingBankItemSequenceNum>
                      <TruncationIndicator>Y</TruncationIndicator>
                      <EndorsingBankConversionInd>2</EndorsingBankConversionInd>
                      <EndorsingBankCorrectionInd>0</EndorsingBankCorrectionInd>
                   </CDC>
                   <CDC num="2">
                      <AddendumCRecordNumber>1</AddendumCRecordNumber>
                      <EndorsingBankRountingNumber>
                         <BankCode>070</BankCode>
                         <DistrictCode>12</DistrictCode>
                         <BranchCode>75</BranchCode>
                         <CheckDigit>8</CheckDigit>
                      </EndorsingBankRountingNumber>
                      <EndorsingBankEndorsementDate>20090714</EndorsingBankEndorsementDate>
                      <EndorsingBankEndorsementDate>20090714</EndorsingBankEndorsementDate>
                      <EndorsingBankItemSequenceNum>0701275380000002</EndorsingBankItemSequenceNum>
                      <TruncationIndicator>Y</TruncationIndicator>
                      <EndorsingBankConversionInd>2</EndorsingBankConversionInd>
                      <EndorsingBankCorrectionInd>0</EndorsingBankCorrectionInd>
                   </CDC>
                </CDC>
                <IVD>
                   <IVD num="1">
                      <ImageIndicator>1</ImageIndicator>
                      <ImageCreatorRountingNumber>
                         <BankCode>070</BankCode>
                         <DistrictCode>12</DistrictCode>
                         <BranchCode>75</BranchCode>
                         <CheckDigit>8</CheckDigit>
                      </ImageCreatorRountingNumber>
                      <ImageCreatorDate>20090714</ImageCreatorDate>
                      <ImageViewFormatIndicator>0</ImageViewFormatIndicator>
                      <ImageViewCompressionAlg>0</ImageViewCompressionAlg>
                      <ViewSideIndicator>0</ViewSideIndicator>
                      <ViewDescriptor>0</ViewDescriptor>
                      <DigitalSignatureIndicator>1</DigitalSignatureIndicator>
                      <DigitalSignatureMethod>0</DigitalSignatureMethod>
                      <SecurityKeySize>12235</SecurityKeySize>
                      <ImageRecreateIndicator>0</ImageRecreateIndicator>
                   </IVD>
                   <IVD num="2">
                      <ImageIndicator>1</ImageIndicator>
                      <ImageCreatorRountingNumber>
                         <BankCode>070</BankCode>
                         <DistrictCode>12</DistrictCode>
                         <BranchCode>75</BranchCode>
                         <CheckDigit>8</CheckDigit>
                      </ImageCreatorRountingNumber>
                      <ImageCreatorDate>20090714</ImageCreatorDate>
                      <ImageViewFormatIndicator>0</ImageViewFormatIndicator>
                      <ImageViewCompressionAlg>0</ImageViewCompressionAlg>
                      <ViewSideIndicator>0</ViewSideIndicator>
                      <ViewDescriptor>0</ViewDescriptor>
                      <DigitalSignatureIndicator>1</DigitalSignatureIndicator>
                      <DigitalSignatureMethod>0</DigitalSignatureMethod>
                      <SecurityKeySize>12235</SecurityKeySize>
                      <ImageRecreateIndicator>0</ImageRecreateIndicator>
                   </IVD>
                </IVD>
                <IVT>
                   <IVT num="1">
                      <ECEInstitutionRoutingNumber>
                         <BankCode>070</BankCode>
                         <DistrictCode>12</DistrictCode>
                         <BranchCode>75</BranchCode>
                         <CheckDigit>8</CheckDigit>
                      </ECEInstitutionRoutingNumber>
                      <BundleBusinessDate>20090714</BundleBusinessDate>
                      <CycleNumber>0</CycleNumber>
                      <ECEInstitutionItemSeqNumber>0701275380000001</ECEInstitutionItemSeqNumber>
                      <ClippingOrigin>
                         <Origin>0</Origin>
                         <CoordinateH1>0000</CoordinateH1>
                         <CoordinateH2>0000</CoordinateH2>
                         <CoordinateV1>0000</CoordinateV1>
                         <CoordinateV2>0000</CoordinateV2>
                      </ClippingOrigin>
                      <LengthofImageReferenceKey>0</LengthofImageReferenceKey>
                      <LengthofDigitalSignature>0</LengthofDigitalSignature>
                      <LengthofImageData>1</LengthofImageData>
                      <OffsetToImageData>01001000</OffsetToImageData>
                   </IVT>
                   <IVT num="2">
                      <ECEInstitutionRoutingNumber>
                         <BankCode>070</BankCode>
                         <DistrictCode>12</DistrictCode>
                         <BranchCode>75</BranchCode>
                         <CheckDigit>8</CheckDigit>
                      </ECEInstitutionRoutingNumber>
                      <BundleBusinessDate>20090714</BundleBusinessDate>
                      <CycleNumber>0</CycleNumber>
                      <ECEInstitutionItemSeqNumber>0701275380000002</ECEInstitutionItemSeqNumber>
                      <ClippingOrigin>
                         <Origin>0</Origin>
                         <CoordinateH1>0000</CoordinateH1>
                         <CoordinateH2>0000</CoordinateH2>
                         <CoordinateV1>0000</CoordinateV1>
                         <CoordinateV2>0000</CoordinateV2>
                      </ClippingOrigin>
                      <LengthofImageReferenceKey>0</LengthofImageReferenceKey>
                      <LengthofDigitalSignature>0</LengthofDigitalSignature>
                      <LengthofImageData>1</LengthofImageData>
                      <OffsetToImageData>01001000</OffsetToImageData>
                   </IVT>
                </IVT>
                <IVA>
                   <IVA num="1">
                      <GlobalImageQuality>0</GlobalImageQuality>
                      <GlobalImageUsability>1</GlobalImageUsability>
                      <ImagingBankSpecificTest>1</ImagingBankSpecificTest>
                   </IVA>
                   <IVA num="2">
                      <GlobalImageQuality>0</GlobalImageQuality>
                      <GlobalImageUsability>1</GlobalImageUsability>
                      <ImagingBankSpecificTest>1</ImagingBankSpecificTest>
                   </IVA>
                </IVA>
                <BCR>
                   <ItemsWithinBundleCount>2</ItemsWithinBundleCount>
                   <BundleTotalAmount>1500</BundleTotalAmount>
                   <MICRValidTotalAmount>1500</MICRValidTotalAmount>
                </BCR>
             </ForwardBundle>
             <CCR>
                <BundleCount>1</BundleCount>
                <ItemWithinCashLetterCount>2</ItemWithinCashLetterCount>
                <CashLetterTotalAmount>1500</CashLetterTotalAmount>
                <ImagesWithinCashLetterCount>2</ImagesWithinCashLetterCount>
                <ECEInstitutionName>Bank Asia</ECEInstitutionName>
                <SettlementDate>20090714</SettlementDate>
             </CCR>
          </Collection>
          <ECR>
             <CashLetterCount>1</CashLetterCount>
             <TotalRecordCount>2</TotalRecordCount>
             <TotalItemCount>2</TotalItemCount>
             <FileTotalAmount>1500</FileTotalAmount>
                   <ImmediateOriginContactName>Bank Asia</ImmediateOriginContactName>
                   <ImmediateOriginContactNumber>XXX</ImmediateOriginContactNumber>
              </ECR>
         </OCE>
    </BACPSInterface>';
       l_parser := dbms_xmlparser.newParser;
       dbms_xmlparser.parseClob(l_parser, l_clob);
       l_doc := dbms_xmlparser.getDocument(l_parser);
       dbms_lob.freetemporary(l_clob);
       dbms_xmlparser.freeParser(l_parser); 
       dbms_xmldom.freeDocument(l_doc);
    end;

  • Need help - select data from NCLOB column problem

    Hi,
    Im having problem retrieving data from NCLOB columns via ODBC. After SQLExecdirect on my SELECT statement call to SQLFetch gives me following error:
    ORA-24806 LOB form mismatch
    I tried following two ways of data retrieval:
    SQLExecDirect(hstmt,(SQLTCHAR*)szSQLStatement,SQL_NTS);
    SQLBindCol(hstmt,3,SQL_C_TCHAR,chBuffer,sizeof(chBuffer),&iDataLen);
    SQLFetch(hstmt);
    OR
    SQLExecDirect(hstmt,(SQLTCHAR*)szSQLStatement,SQL_NTS);
    SQLFetch(hstmt);
    SQLGetData(hstmt,3,SQL_C_TCHAR,chBuffer,sizeof(chBuffer),&iDataLen);
    Both times call to SQLFetch gives me ORA-24806 LOB form mismatch error.
    INSERT and UPDATE for this table works just fine.
    If I change NCLOB type to CLOB works just fine, but I will be storing Unicode data, so using CLOB cant be a solution
    Any ideas appreciated.
    Thanks in advance,
    Vlad
    Server:
    Oracle 9.2 database on Windows 2000 Server
    NLS_LANGUAGE = AMERICAN
    NLS_TERRITORY = AMERICA
    NLS_CHARACTERSET = WE8MSWIN1252
    NLS_NCHAR_CHARACTERSET = AL16UTF16
    Client:
    Unicode C++ application, connects via Oracle 9.2 ODBC driver on Windows XP
    NLS_LANG = AMERICAN_AMERICA.WE8MSWIN1252
    CREATE TABLE my_nclob_table (
         id number (10,0) NOT NULL ,
         name nvarchar2 (255) NOT NULL ,
         description nvarchar2 (255) NULL ,
         definition nclob NOT NULL ,
         creation date NOT NULL ,
         lastmodified date NOT NULL ,
         CONSTRAINT PK_cat_pricelist PRIMARY KEY
              id
    #define     nil NULL
    #define     null NULL
    #define     SQL_ERR(__sqlerr__)     (((__sqlerr__) != SQL_SUCCESS) && ((__sqlerr__) != SQL_SUCCESS_WITH_INFO))
    #define     STOP_IF_SQL_ERR(__sqlerr__)                                                                 \
                                                      do                                                       \
                                                           if (SQL_ERR(__sqlerr__)) goto stop_;     \
                                                      } while (false)                                                  
    void eqTestOracleLOBSelect(void)
         SQLHENV henv     = null;
         SQLHDBC hdbc     = null;
         SQLHSTMT hstmt     = null;
         SQLRETURN retcode     = SQL_SUCCESS;
         TCHAR          szSQLStatement[]     = T("select id, name, definition from mynclob_table");
         int               iFetchedRows = 0;
         TCHAR          szMsg[512];
         TCHAR          chBuffer[2049];
         SQLLEN          iDataLen = 0;
         try
              retcode = eqOpenConnectionODBC(_T("myTestDsn"),_T("user"),_T("pwd"),henv,hdbc);
              STOP_IF_SQL_ERR(retcode);
              retcode = SQLAllocHandle(SQL_HANDLE_STMT, hdbc, &hstmt);
              STOP_IF_SQL_ERR(retcode);
              retcode = SQLExecDirect(hstmt,(SQLTCHAR*)szSQLStatement,SQL_NTS);
              STOP_IF_SQL_ERR(retcode);
              retcode = SQLBindCol(hstmt,3,SQL_C_TCHAR,chBuffer,sizeof(chBuffer),&iDataLen);
              STOP_IF_SQL_ERR(retcode);
                   while (retcode == SQL_SUCCESS)
                        retcode = SQLFetch(hstmt);
                        if (retcode == SQL_NO_DATA)
                             retcode = SQL_SUCCESS;
                             break;
                        STOP_IF_SQL_ERR(retcode);
                   //     retcode = SQLGetData(hstmt,3,SQL_C_TCHAR,chBuffer,sizeof(chBuffer),&iDataLen);
                   //     STOP_IF_SQL_ERR(retcode);
                        ++iFetchedRows;
         stop_:
              if (SQL_ERR(retcode))
                   MessageBox(null,_T("SQL statement execution error."),_T("Error"),MB_OK);
                   eqShowStatementError(SQL_HANDLE_STMT,hstmt,retcode);
              } else     {
                             _stprintf(szMsg,_T("SQL execution success. Fetched rows: %ld"),iFetchedRows);
                             MessageBox(null,szMsg,_T("Success"),MB_OK);
         catch(...)
              MessageBox(null,_T("Unknown exception in eqTestOracleLOBSelect"),_T("Unknown exception"),MB_OK);
         if (hstmt != null)
              SQLFreeHandle(SQL_HANDLE_STMT, hstmt);
              hstmt = null;
         if (hdbc != nil)
              SQLFreeHandle(SQL_HANDLE_DBC, hdbc);
              hdbc = nil;
         if (henv != nil)
              SQLFreeHandle(SQL_HANDLE_ENV, henv);
              henv = nil;
    SQLRETURN eqOpenConnectionODBC(TCHAR          *szDSN,
                                       TCHAR          *szUser,
                                       TCHAR          *szPassword,
                                       SQLHENV     &henv,
                                       SQLHDBC &hdbc)
         SQLRETURN retcode;
         henv = nil;
         hdbc = nil;
         //Allocate environment handle
         retcode = SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &henv);
         STOP_IF_SQL_ERR(retcode);
         //Set the ODBC version environment attribute
         retcode = SQLSetEnvAttr(henv, SQL_ATTR_ODBC_VERSION, (void*)SQL_OV_ODBC3, 0);
         STOP_IF_SQL_ERR(retcode);
         // Allocate connection handle
         retcode = SQLAllocHandle(SQL_HANDLE_DBC, henv, &hdbc);
         STOP_IF_SQL_ERR(retcode);
         // Set login timeout to 5 seconds.
         SQLSetConnectAttr(hdbc, SQL_LOGIN_TIMEOUT, (void*)5, 0);
         STOP_IF_SQL_ERR(retcode);
         retcode = SQLConnect(hdbc, (SQLTCHAR*)szDSN, SQL_NTS,
                                            (SQLTCHAR*)szUser, SQL_NTS,
                                            (SQLTCHAR*)szPassword, SQL_NTS);
    stop_:
              if (SQL_ERR(retcode))
                   MessageBox(null,_T("Connection Error."),_T("Error"),MB_OK);
                   if (hdbc != nil)
                        eqShowStatementError(SQL_HANDLE_DBC, hdbc,retcode);
                        SQLFreeHandle(SQL_HANDLE_DBC, hdbc);
                        hdbc = nil;
                   if (henv != nil)
                        eqShowStatementError(SQL_HANDLE_ENV, henv,retcode);
                        SQLFreeHandle(SQL_HANDLE_ENV, henv);
                        henv = nil;
              } else MessageBox(null,_T("Connected."),_T("Success"),MB_OK);
         return retcode;
    void eqShowStatementError(SQLSMALLINT chHandleType, SQLHANDLE hHandle,long lErrOrig)
         SQLRETURN          nErr          = SQL_SUCCESS;
         int                    nRecNum = 1;
         SQLTCHAR          szSqlState[6];
         SQLTCHAR          szMsg[SQL_MAX_MESSAGE_LENGTH];
         SQLSMALLINT          nMsgLen;
         SQLINTEGER          nNativeError;
         while ((nErr = SQLGetDiagRec(chHandleType,hHandle,nRecNum,
                                            szSqlState, &nNativeError,
                                            szMsg, sizeof(szMsg), &nMsgLen)) != SQL_NO_DATA)
              szSqlState[5] = 0;
              MessageBox(NULL,(const TCHAR *)szMsg,_T("ODBC Error"),MB_OK);
              ++nRecNum;

    Yes, the 9.2.0.2 driver can be downloaded from OTN. I don't believe it will solve your particular problem, but it will help in general. If you don't grab the latest version, you'll probably have to chack the "Force SQL_WCHAR Support" option in the DSN configuration.
    From the help file
    "The C data type, SQL_C_WCHAR, was added to the ODBC interface to allow applications to specify that an input parameter is encoded as Unicode or to request column data returned as Unicode. The macro SQL_C_TCHAR is useful for applications that need to be built as both Unicode and ANSI. The SQL_C_TCHAR macro compiles as SQL_C_WCHAR for Unicode applications and as SQL_C_CHAR for ANSI applications."
    My first thought would be that your application is not being compiled as Unicode. If you substitute SQL_C_WCHAR for SQL_C_TCHAR when you're dealing with NCLOB columns, I suspect you'll have better luck.
    More help file
    "The SQL data types, SQL_WCHAR, SQL_WVARCHAR, and SQL_WLONGVARCHAR, were added to the ODBC interface to represent columns defined in a table as Unicode. These values are potentially returned from calls to SQLDescribeCol, SQLColAttribute, SQLColumns, and SQLProcedureColumns. In Oracle release 8.1.7.0.0 or 9.0.1.0.0, the Oracle database does not support encoding columns as Unicode. These values would not be returned from the ODBC Drivers for Oracle release 8.1.7.0.0 or for Oracle 9.0.1.0.0 databases.
    In Oracle release 9.2.0.0.0, Unicode encoding was supported for SQL column types NCHAR, NVARCHAR2, and NCLOB. In addition, Unicode encoding was also supported for SQL column types CHAR and VARCHAR2 if the character semantics were specified in the column definition.
    Starting with release 9.2.0.2.0, the ODBC Driver supports these SQL column types and maps NCHAR to the SQL data type SQL_WCHAR, NVARCHAR2 is mapped to SQL_WVARCHAR, and NCLOB is mapped to SQL_WLONGVARCHAR. The SQL CHAR column is mapped to SQL_WCHAR and the VARCHAR2 column is mapped to SQL_WVARCHAR if the character semantics are specified for the column. While the Force SQL_WCHAR Support option is still available in the 9.2.0.2.0 ODBC Driver, it is no longer required for Unicode support."
    Justin

  • How can I Move data from one column to another in my access table?

    I have two columns, one that stores current month’s data and one that stores last month’s data. Every month data from column 2 (this month’s data) needs to be moved to column 1 that holds last month’s data. I then null out column 2 so I can accumulates this month’s data.
    I understand how to drop a column or add a column, how do I transfer data from one column to another.
    Here is my trial code:
    <cfquery name="qQueryChangeColumnName" datasource="#dsn#">
      ALTER TABLE leaderboard
      UPDATE leaderboard SET  points2 = points3
    </cfquery>
    Unfortunately, I get the following error:
    Error Executing Database Query.
    [Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver] Syntax error in ALTER TABLE statement.
    How can I transfer my data with the alter table method?

    I looked up the Access SQL reference (which is probably a
    good place to start when having issues with Access SQL), and
    it suggests you probably need a WHERE clause in there.
    I agree the documentation is a good place to start. But you should not need a WHERE clause here.
    Too few parameters. Expected 1.
    If you run the SQL directly in Access, what are the results? At the very least, it should provide a more informative error message..

  • Return data from all columns apart from a certain data type.

    Bit stuck on something, hope somebody here can help:
    I want to do a 'select * from ' a table, to return all columns except ones of a certain datatype. ie. I want to return data from all columns, excluding columns of datatype 'SDO_GEOMETRY'.
    This gives me the list of columns:
    SELECT COLUMN_NAME
    FROM   USER_TAB_COLUMNS
    WHERE TABLE_NAME = 'ORDER_ITEM'
    AND   DATA_TYPE <> 'SDO_GEOMETRY'; But I can't seem to take it any further...
    Now if I knew the columns beforehand, then of course I could just list them, excluding the geometry column, but this is to be used for a plug-in for MS Word, where a user can pick database columns to dynamically fill a report from - but I don't want the geometry columns as these can't be handled in this way.

    Hi Reggie,
    > connects to the database and presents a list of tables
    My guess is that this macro is written so it selects from all_tab_cols.
    Change that plugin and let it select from a view like the one above. That way, the users won't be able to see/pick anything that you are not able/willing to present for them.
    Edit:
    You could even tease your users, and let them see the columns, but not being able to pick them.
    create or replace view available_tab_columns
    as
       select decode(pickable.data_type, null, 0, 1) pickable
             ,atc.* -- narrow down yourself
         from all_tab_cols atc  -- or maybe user_tab_cols
             ,(select 'CHAR' data_type from dual union all
               select 'DATE' from dual union all
            select 'NUMBER' from dual
               -- complete positive list, yourself
              ) pickable
        where atc.data_type = pickable.data_type(+);Regards
    Peter
    Message was edited by:
    Peter Gjelstrup

  • Displaying data from multiple columns into a single line graph

    Post Author: hollowmatrix
    CA Forum: WebIntelligence Reporting
    Hey,I have an issue with the WEBI reporting.I have a data source that has multiple columns say ( month1, month2, month3, month4,.....month 12, month 13, ....month24) with the sales data for each month.Now say I call the month 1 to month 12 as "current year", and call month 13 - month 24 as "previous year".I want to put a prompt in the report which allows  me to select between "current year" and "previous year".Based on the prompt value we get a graph of the sales vs month ....as in if we select  "current year", then we get a graph of the sales Vs time( remember that the sales data for each month is in a different column.)and if we select  "previous year" then we get a graph of the sales Vs time for previous year..( sales vs time for Month 13, month 14, month 15....month 24).I am not able to pull data from multiple columns into a single object that I can use to populate the graphs.Any help on the same will be appreciated .   

    Hi,
    <p>
    please click
    here (asktom) and look for the words "how about the other way round"
    </p>

  • HT3775 Hi, my mac which is on 10.7.5 osx. but when ever i insert any mpeg/avi video cd it shows the file format not recognized. i am fed up of this. plz somebody help me. what should i do now.

    hi,
              i am using 10.7.5 lion there are a lot of problems in this OS.
    like most of the programs quit's unexpectedly. some programs does not work on it. like adobe cs5 is not working. everytime time when i do click on adobe cs 5 icon it shows a message "To open “Adobe Photoshop CS5,” you need to install a Java SE 6 runtime, but you are not connected to the Internet.To install a Java SE 6 runtime later, open “Adobe Photoshop CS5” again" while i always remain connected on the net.
    2. when ever i insert an avi or mpeg video disk it shows the file format not recognized. to **** with this macbook pro n its 10.7.5 lion. the same disk works/runs on windows on windows systems.
    plz somebody help me what should i do now.
    [email protected]

    it sounds like a fualty installation of Lion, this may happen from time to time.
    The best thing to do in this situation is to reinstall Lion. You will not loose anything doing this, but you should always keep back ups of your information.
    http://www.apple.com/osx/recovery/
    basically hold Cmd+R on boot..
    first go to disk utility, verify and repair your disks and permissions. Exit out of Disk utility and then go directly to "reinstall Lion"
    choose that and let it reinstall.
    Adobe CS6 does need Java to run.
    To play your movies you might need to get an application called VLC. VLC is a free app and will play most videos and music files you throw into it.
    http://www.videolan.org/vlc/download-macosx.html
    you have a 64bit intel mac, so get the one for that.

  • How to track the flow of data from R/2 to BI ?

    Hi Experts,
    Question: How to track the flow of data from R/3 to BI ?
    I want to load master data from R/3 to BI. In BI, i create an infopackage to load data from R/3. Under processing tab i set it as "PSA and then in the InfoObject (package by package)". Its a Full update.
    Now, i start the update to InfoObject. The load goes on well.
    Now, i want to track the flow of data from the master data table in R/3 to Datasource in R/3 then Extractors and then in the PSA in BI and then till the InfoObject. That is the complete flow of data from source table (in R/3) to Target table (in BI).
    Please help me know how this can be done. (For example lets take cost element master data)
    Regards,
    Suraj S Nair

    Hi,
    Data flow :
    BW :
    When u right click on the Master Data Info object -> Select Data flow.Then  it will  show u the details like DS name,IS (If 3.x)
    Once u know the DS then you need to find out the source tables for the R/3 DS.This information will get using ROOSOURCE or ROOSFIELD tables  or help.sap.com.
    My suggestion better to search in Help site for DS source tables.
    DS Tables :
    The following link will provide you the source tables for some of the LO DS.
    https://wiki.sdn.sap.com/wiki/display/BI/BWSDMMFIDATASOURCES
    Regards
    Ram.
    Edited by: Ramakanth Deepak Gandepalli on Dec 22, 2009 9:29 AM

  • Help find the Last run date from previous month

    Hi all
    I am stuck trying to find the Last Run Date from the previous month.
    select distinct(date_ran) from TABLE X where date_ran like '%/11-%' order by date_ran desc gives
    "03/30/11-06:19
    "03/25/11-03:01
    "03/24/11-03:00
    "03/23/11-03:00
    "03/22/11-03:00
    "03/21/11-03:00
    "03/18/11-03:00
    "03/17/11-00:00
    "03/16/11-06:31
    "02/15/11-07:42
    "02/15/11-06:00
    "02/14/11-08:19
    Here the result I am trying to acheive is 02/15/11-07:42 ;Note the column date_ran is a VARCHAR2(255) and not a TIMESTAMP
    I tried
    select ADD_MONTHS(to_date(max(date_ran), 'MM/DD/YYYY-HH24:MI'),-1)
    from daily_tests_a
    where date_ran like '%/11-%'
    order by date_ran desc
    which returns 2/28/0011 6:19:00 AM and that is not the result I am looking for
    Regards
    SMK

    Welcome to the forum!
    user2931503 wrote:
    Hi all
    I am stuck trying to find the Last Run Date from the previous month.
    select distinct(date_ran) from TABLE X where date_ran like '%/11-%' order by date_ran desc gives
    "03/30/11-06:19
    "03/25/11-03:01
    "03/24/11-03:00
    "03/23/11-03:00
    "03/22/11-03:00
    "03/21/11-03:00
    "03/18/11-03:00
    "03/17/11-00:00
    "03/16/11-06:31
    "02/15/11-07:42
    "02/15/11-06:00
    "02/14/11-08:19
    Here the result I am trying to acheive is 02/15/11-07:42 ;Note the column date_ran is a VARCHAR2(255) and not a TIMESTAMPThat's a very bad idea. Points in time should always be stored in DATE (or maybe TIMESTAMP) columns. If not, you're going to waste resources converting them to DATEs whenever you need them to behave like DATEs, and risk run-time errors because of bad data.
    Normally, the "previous" month means the month before the current month. In April, the previous month is March.
    By "previous" month, do you mean the 2nd latest month in the table? That is, this data contains data from February and March, 2011; March 2011 is the latest of those months, February 2011 is the next-to-last, and so is that why you want a date from February?
    I tried
    select ADD_MONTHS(to_date(max(date_ran), 'MM/DD/YYYY-HH24:MI'),-1)
    from daily_tests_a
    where date_ran like '%/11-%'
    order by date_ran desc
    which returns 2/28/0011 6:19:00 AM and that is not the result I am looking for
    Regards
    SMKTry this:
    WITH   got_real_date   AS
         SELECT     TO_DATE ( SUBSTR (date_ran, 1, 14)
                   , 'MM/DD/RR-HH24:MI'
                   )     AS real_date
         FROM     table_x
    --     WHERE     ...     -- If you need any filtering, put it here
    SELECT     TO_CHAR ( MAX (real_date)
              , 'MM/DD/RR-HH24:MI'
              )     AS last_date
    FROM    got_month_num
    WHERE     real_date     < (
                               SELECT  TRUNC (MAX (real_date), 'MONTH')
                         FROM    got_real_date
    ;Edited by: Frank Kulash on Apr 5, 2011 3:59 PM

  • *Journal Entries while uploading the vendor master data from legacy system*

    hi SAP Folks,
    can any one of you tell me the journal entries while uploading the vendor master data from legacy system to SAP system.
    Eg: legacy system is having 10000 vendors list, 1 reconciliation account and $ 1000000. while uploading all these data from legacy system to SAP what are the journal entries we get.
    thanks in advance.
    Edited by: ravindranath manikonda on Nov 24, 2008 1:12 PM

    Hi
    you will be having  only one entry logically
    i.e. Opening Bal. clrng A/c Dr.
           To Vendor A/c Cr.
    regards

Maybe you are looking for

  • Email problem - Microsoft Outlook exchange

    Hi, I was trying to sync my email, which is provided by Microsoft Outlook Exchange on the website icex.ic.ac.uk with my BB. However, I was having issues.  Interestingly, when I first set up my BB this email worked, at that stage I entered my email de

  • Problem in SPML configuration

    Hi All, I am trying to test SPML Web Service to using the default SOAP xml file addRequest_x_User.xml which located under ./SPML/SampleHttpClient. I have configured the "spml.properties" and exported my environment but I get the following parser erro

  • Suitable Laptop for NI ExpressCard 8360

    Hello, I'm looking for an Industrial Laptop, which supports NI ExpressCard 8360 with NI PXI Chassis(8 & 18 slots). we have tried with couple of laptops(HP ProBook & Dell XPS), which has the follwing issues: 1. Booting (This could be fixed by changing

  • IMessage is stuck on "Waiting for Activation"

    I changed my phone number and not my carrier, and within the first 15 min I could send a text message and then it started having problems and couldn't send a message. I went into iMessanger and it's my old number as the "sending number"... I tried fo

  • Resizable=true not working in window.open

    In window.open() in my jsp page window.open('http:/'+document.IPPBX_Form.ippbx.value, width=400,height=200,resizable=1 have tried resizeable=true, resizable=true,resizeable=1,resizable=1 but no hope. The maximizable button remains disabled. Help Plea