Xml extract assign to varchar2

How do i assign the xml Extract to a varchar2.. its throwing me error, is it possible or an alternative method to do this.
ST_Name1 varchar2(120);
ST_Name1:= xml_st.EXTRACT ('ST/Name1/text()').getstringval ();Thanks

its throwing me errorit would also help to mention what kind of error you get!
In general it would work:
SQL> declare
   ST_Name1 varchar2 (120);
   xml_st   xmltype := xmltype ('<ST><Name1>SomeName</Name1></ST>');
begin
   ST_Name1 := xml_st.extract ('ST/Name1/text()').getstringval ();
   dbms_output.put_line(ST_Name1);
end;
SomeName
PL/SQL procedure successfully completed.

Similar Messages

  • XML extract error

    Hello -
    This is my table:
    SQL> describe UCCNET_REGISTRY_CAT_ITEM;
    Name Null? Type
    UCCNET_REGISTRY_CAT_ITEM_KEY NOT NULL NUMBER
    XML XMLTYPE
    EAN_UCC_PROXY_KEY NUMBER
    DOCUMENT_NAME VARCHAR2(256)
    SQL>
    and this is my statement that is supposed to extract the XML data:
    select p.XML
    from UCCNET_REGISTRY_CAT_ITEM p
    where p.XML.extract('/item/text()').getStringVal = '123';
    I did it exactly as the Oracle Viewlet showed it to me but I got this error:
    where p.XML.extract('/item/text()').getStringVal = '123'
    ERROR at line 3:
    ORA-22806: not an object or REF
    Could you please tell me wher I went wrong?
    Thanks,
    Peter

    I just hit something else on top of my previous problem with XML namespaces. I am trying to pass my XML document to a stored procedure and I seem to be hitting a length limit for a parameter.
    Here's my SP:
    create or replace procedure TEST_UCCnet_Add_Envelope( p_key in number, p_XML in VARCHAR2) is
    lastIndex number;
    begin
    lastIndex := 0;
    insert into Envelope (
    ENVELOPE_KEY,
    XML )
    values (
    lastIndex,
    sys.XMLTYPE.createXML (p_XML));
    end;
    Here's How I call it:
    This parameter gets through(951 Bytes):
    execute TEST_UCCnet_Add_Envelope( -5, '<envelope communicationVersion="2.2"> <messageHeader> <messageIdentifier> <value>RCIR-MSGID-001</value> </messageIdentifier> <userId>steruser</userId> <representingParty> <gln>0034500000000</gln> </representingParty> </messageHeader> <registerCommandOperand> <registryCatalogueItem type="RegistryCatalogueItemType" creationDate="2001-08-02T12:00:00" documentStatus="ORIGINAL"> <registryCatalogueItemState state="REGISTERED"/> <catalogueItemClassification classificationCategoryCode="UDEX.02.0016.0093"/> <catalogueItemReference> <gtin>00061420464322</gtin> <dataSource>1701911838063</dataSource> </catalogueItemReference> <sourceDataPool>8507247615230</sourceDataPool> <informationProviderOfTradeItem> </informationProviderOfTradeItem> </registryCatalogueItem> <test_tag></test_tag> </registerCommandOperand> </envelope>');
    This one, does not (987 Bytes). All I added is the test_tag element:
    execute TEST_UCCnet_Add_Envelope( -6, '<envelope communicationVersion="2.2"> <messageHeader> <messageIdentifier> <value>RCIR-MSGID-001</value> </messageIdentifier> <userId>steruser</userId> <representingParty> <gln>0034500000000</gln> </representingParty> </messageHeader> <registerCommandOperand> <registryCatalogueItem type="RegistryCatalogueItemType" creationDate="2001-08-02T12:00:00" documentStatus="ORIGINAL"> <registryCatalogueItemState state="REGISTERED"/> <catalogueItemClassification classificationCategoryCode="UDEX.02.0016.0093"/> <catalogueItemReference> <gtin>00061420464322</gtin> <dataSource>1701911838063</dataSource> </catalogueItemReference> <sourceDataPool>8507247615230</sourceDataPool> <informationProviderOfTradeItem> <test_tag>kkkkkkkkkkkkkkk</test_tag> </informationProviderOfTradeItem> </registryCatalogueItem> <test_tag></test_tag> </registerCommandOperand> </envelope>');
    And here's the error message:
    ERROR:
    ORA-01756: quoted string not properly terminated
    SP2-0042: unknown command "pe>')" - rest of line ignored.
    This suggests strongly that the argument is simply too long for the SP to accept. Am I right?
    Thanks,
    Peter

  • Extract Assignment Rules

    Hi All,
    Is it possible to extract Assignment Rules of Account / Opportunity via code or Migration Tool ?
    I was looking for a way to extract the Rules, Rule Criteria and Team Assignment into XML file.
    Thanks!

    CMP, yes you would need to default this field to Y or add workflow to set it to Y. I would recommend that you do not use "Groups" and consider using Book of Business or Teams instead.

  • XML Fetch Error. The XML file assigned in the configuration.xml is either wrong or corrupted.

    1.Some web pages give "XML Fetch Error. The XML file assigned in the configuration.xml is either wrong or corrupted".
    2.Youtube gives, after pressing start button, message"An error occurred. Please try again later.
    Opening same youtube page with IE, there is no problems.
    3.Scrolling on Mozilla firefox pages works only with sidebar not with mouse wheel.
    Other user accounts on this computer doesn't have these problems.
    BR, Juha

    This can be caused by a recent Flash 11.3 update.
    See:
    *https://support.mozilla.org/kb/flash-113-doesnt-load-video-firefox

  • Create a large XML extract from relational tables - 10g

    The Oracle 10g documentation recommends using the various SQL functions such as XMLAGG,XMLELEMENT or DBMS_XMLGEN under chapter "16 Generating XML Data from the Database" for generating a XML extract file. The DBMS_XMLDOM seems like a useful structured package to create a XML formatted extract. Any idea why Oracle does not recommend the use of XMLDOM API ? Are there performance issues or likely de-support ?
    Whats the best way to produce a large XML extract?
    Thanks.

    mdrake wrote:
    No reason not to use it. It just tends to require a lot more coding than the other methods. Underneath the covers they all map into the same code-line. In general, to generate a given XML document you wlll write far fewer lines of code using the SQL/XML operators. Less Code written = less code to maintan = faster time to market.Less code to parse...?

  • Using XML extraction from Oracle and XSLT data transformation

    Hi
    How can transfer data ie: Using XML extraction from Oracle and XSLT data transformation with java application?
    usually i use to do querying sql, getting data from table assinging to model class then send it to UI. how can i go for XML extraction form oracle?
    thanks

    Sorry, I don't understand what exactly you want to do. And I'm under the impression that you might not know exactly what you want to do as well. Could you explain a bit more detailed what you want to achieve?

  • Oracle Payments - Funds Capture - Create Settlement Batches - Customize Standard XML extract

    Hi,
    I am required to customize the output produced by 'Create Settlement Batches' program.
    There are two parts to it:
         1. Customizing Standard XML
              This is required to add custom XML Tags to the standard XML extract.
              I read in a meta-link note that this can be achieved through table iby_trxn_extensibility. Oracle suggests that we insert rows into this table via a trigger on iby_trxn_summaries_all, and           these rows will appear as additional XML Tags in the Standard XML extract.
              I need to figure out how to populate the column iby_trxn_extensibility.extend_name so that the new XML Tag appears at a specific path in the Standard XML extract.
              Kindly provide your valuable inputs on this?
         2. Customizing Standard RTF
              In case of Funds Disbursement, we have a standard Format called 'US NACHA Generic Format'. Do we have a similar seeded Format in case of Funds Capture?
    Best Regards,
    Uday Arora

    I am wondering whether u were able to achieve this. I am able to insert via autonomous transaction but it insert duplicate values, HOW to avoid duplicate.

  • Report not taking the default xml template assigned

    Hi,
    We wanted to have an excel version of the Depreciation Projection report vis BI Publisher.
    We changed the output type of the standard report Depreciation Projection report to XML, created an RTF Template, Defined data definition to point to the program and Template to point to the RTF Template.
    We assigned the template as default template from System Administration.
    The report is automatically run whenever Depreciation projection program is run. (If the report is run without that, it does not fetch any data)
      But when the report is automatically run from Depreciation projection program, it is not picking the RTF template, just provides XML output.
      The Depreciation projection program is a spawned program so we cant see how it is triggering the report that it ignores the template.
      Running the Depreciation Projection report separately after it is run automatically does not produce any data.
      How can we get the report to use the default template?
    Thanks.

    The report is automatically run whenever Depreciation projection program is run. (If the report is run without that, it does not fetch any data)
    in this case rtf template is used,  is it ?
    But when the report is automatically run from Depreciation projection program, it is not picking the RTF template, just provides XML output
    in this case rtf template is not used
    so looks like you are using ebs r12 for which in some cases need to add layout before running "manually"
    it means use FND_REQUEST.ADD_LAYOUT
    xml_layout := FND_REQUEST.ADD_LAYOUT('FND','XXAND','en','US','RTF');
    v_request_id := fnd_request.submit_request('FND','XXAND','Template 1',NULL,FALSE, null);
    The Depreciation projection program is a spawned program so we cant see how it is triggering the report that it ignores the template.
    looks like you can't add template so as idea generate report after "Depreciation projection program"
    you can search how generate xml publisher report based on xml of previous step

  • Xml extract - a particular value (not the whole tag

    Hi
    I have an xml in database column as follows:
    <tag1 xmlsn:ns1="http://abc.def.org/".....>
    <ns1:tag2>...</ns1:tag2>
    <ns1:xyz
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="virtual">
    <ns1:abcdesc xsi:type="xType">
    <ns1:abcdesc xsi:type="defDesc">
    <ns1:abcdesc xsi:type="yType">
    <ns1:Name>ABC</ns1:Name>
    <ns1:id>171351</ns1:id>
    </ns1:abcdesc>
    </ns1:abcdesc>
    <ns1:abcdesc xsi:type="defDesc">
    <ns1:abcdesc xsi:type="yType">
    <ns1:Name>ABC</ns1:Name>
    <ns1:id>171352</ns1:id>
    </ns1:abcdesc>
    </ns1:abcdesc>
    </ns1:abcdesc>
    </ns1:xyz>
    </tag1>
    How may I extract only the id's given?
    This is my query:
    select
    tablename.xmlcolumn.extract('//tag1/ns1:xyz/ns1:abcdesc/ns1:id','xmlns:ns1="http://abc.def.org/"').getSDtringVal()
    from tablename
    I do not get just the id's with this query but the whole xml tag as follows:
    <ns1:id xmlns:ns1="http://abc.def.org/">171351</ns1:id>
    Any help?
    Thx!

    Got it.
    Adding text() after the id in the query helps.
    Thx!

  • Xml extract problem

    I have a problem about sql to extract xml node,the sql followed:
    select a.disptx.extract('/Record/_20/text()').getStringVal() from swifti a where swidty = '6666666666666666666'
    and the clob is :
    <Record>
    <swrctm>2223</swrctm>
    <swintm>22:23:13</swintm>
    <swindt>20100826</swindt>
    <fmbank>ssssss</fmbank>
    <tobank>444444rrrrrrr</tobank>
    <fm>sdfds</fm>
    <to>wwwwwwwwww</to>
    <mgtype>103</mgtype>
    <swftid>dddddd</swftid>
    <sw108f>dddddd</sw108f>
    <swackf>0</swackf>
    <_20>fffffffffff</_20>
    </Record>
    that throw the exception:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00601: Invalid token in: '/Record/_20/text()'
    ORA-06512: at "SYS.XMLTYPE", line 111
    31011. 00000 - "XML parsing failed"
    *Cause:    XML parser returned an error while trying to parse the document.
    *Action:   Check if the document to be parsed is valid.
    can help me?

    you need convert clob to xmltype
    select xmltype(a.disptx).extract('/Record/_20/text()').getStringVal() from swifti a
    create table test (x clob);
    Table created.
    insert into test values ('<Record>
    <swrctm>2223</swrctm>
    <swintm>22:23:13</swintm>
    <swindt>20100826</swindt>
    <fmbank>ssssss</fmbank>
    <tobank>444444rrrrrrr</tobank>
    <fm>sdfds</fm>
    <to>wwwwwwwwww</to>
    <mgtype>103</mgtype>
    <swftid>dddddd</swftid>
    <sw108f>dddddd</sw108f>
    <swackf>0</swackf>
    <_20>fffffffffff</_20>
    </Record>');
    commit;
    1 row created.
    Commit complete.
    SELECT xmltype(x).EXTRACT ('/Record/_20/text()').getstringval ()
      FROM test;
    XMLTYPE(X).EXTRACT('/RECORD/_20/TEXT()').GETSTRINGVAL()                        
    fffffffffff                                                                    
    1 row selected.http://docs.oracle.com/cd/B10500_01/appdev.920/a96620/xdb04cre.htm

  • Need Xml Extraction help...not very urgent but only 6 Hrs left...

    Hi,
         I have an xml in a blob column and I need to extract the xml resultset into the (specified below) row/column format. So that i created a custom blob_to_clob function for this conversion and extracted below specified xml. Now I am executing the below specified queries for this xml to extract PanelSet, PanelId, Link values & attributes. but the problem is, I am not been able to relate the parent and child nodes or may be not able to identify, who belongs to who (parent--child). for e.g if I extract all link i.e status1, status2 etc of a particular Panel then i am not been able to access its (parent) Panel identification.please suggest me any solution.
    --query using
    --to extract PanelSet
    select
      extractValue(value(t),'/PanelSet/@name') panelset_name
      from
        (Select blob_to_clob(grp_menu) blobval
        from OUG
        WHERE user_group_seqno =9) c,
    table(xmlsequence(extract(xmltype.createxml(c.blobval),'/Menus/PanelSet'))) t
    --to extract PanelID
    select
      extractValue(value(t),'/PanelID/text()') panelid
      from
        (Select blob_to_clob(grp_menu) blobval
        from oug
        WHERE user_group_seqno =9) c,
    table(xmlsequence(extract(xmltype.createxml(c.blobval),'/Menus/PanelSet/PanelID'))) t
    --to extract Panel
    select
      extractValue(value(t),'/Panel/@id') Panel_id,
      extractValue(value(t),'/Panel/@name') Panelname
      from
        (Select blob_to_clob(grp_menu) blobval
        from oug
        WHERE user_group_seqno =9) c,
    table(xmlsequence(extract(xmltype.createxml(c.blobval),'/Menus/Panel'))) t
    --to extract link
    select
      extractValue(value(t),'/Link/@name') link_name,
      extractValue(value(t),'/Link/@type') link_type,
      extractValue(value(t),'/Link/text()') link_value 
      from
        (Select blob_to_clob(grp_menu) blobval
        from oug
        WHERE user_group_seqno =9) c,
    table(xmlsequence(extract(xmltype.createxml(c.blobval),'/Menus/Panel/Link'))) t
    --XML
    <Menus>
        <PanelSet name="0_Data center_A">
        <PanelID>1-1</PanelID>
        <PanelID>1-2</PanelID>
        <PanelID>1-3</PanelID>
        <PanelID>0-0</PanelID>
        <PanelID>1-6</PanelID>
        <PanelID>1-7</PanelID>
    </PanelSet>
       <PanelSet name="1_Data center_B">
          <PanelID>2-4</PanelID>
          <PanelID>2-5</PanelID>
          <PanelID>2-6</PanelID>
          <PanelID>0-0</PanelID>
          <PanelID>2-7</PanelID>
          <PanelID>2-8</PanelID>
    </PanelSet>
       <PanelSet name="2_Data center_C">
          <PanelID>3-2</PanelID>
          <PanelID>3-4</PanelID>
          <PanelID>0-0</PanelID>
          <PanelID>3-9</PanelID>
          <PanelID>3-10</PanelID>
          <PanelID>3-11</PanelID>
    </PanelSet>
          <Panel id="1-1" name="Sts">
            <Link name="status 1" type="Module">forbidden</Link>
            <Link name="status 2" type="Module">/forbidden</Link>
            <Link name="status 3" type="Module">/forbidden</Link>
            <Link name="status 4" type="Module">/forbidden</Link>
            <Link name="status 5" type="Module">/forbidden</Link>
          </Panel>
          <Panel id="1-2" name="Adm">
             <Link name="View 1" type="Module">forbidden</Link>
             <Link name="View 2" type="Module">forbidden</Link>
             <Link name="View 3" type="Module">forbidden</Link>
             <Link name="View 4" type="Module">forbidden</Link>
             <Link name="View 5" type="Module">forbidden</Link>
             <Link name="View 6" type="Module">forbidden</Link>
             <Link name="View 7" type="Module">forbidden</Link>
          </Panel>
          <Panel id="2-4" name="Position">
             <Link name="viewer 1" type="Module">forbidden</Link>
             <Link name="viewer 2" type="Module">forbidden</Link>
          </Panel>
          <Panel id="3-2" name="Administration">
             <Link name="inquiry 1" type="Module">forbidden</Link>
          </Panel>
          <Panel id="3-4" name="Reconciliation">
            <Link name="reconciliation 1" type="Module">forbidden</Link>
            <Link name="reconciliation 2" type="Module">forbidden</Link>
            <Link name="reconciliation 3" type="Module">forbidden</Link>
          </Panel> 
    </Menus>
    --Structure
                                       -----Link abc
                                      -     Link abd
                                  -      Link abe
                -----Panel ID 1-1-                
                  -     Panel ID 1-2--------link a--z (more than one)
    --------    -      Panel ID 1-3--------link N...
    |PanelSet 0|-
                  ------PanelID 2-1--------link N...
               -     PanelID 2-2--------link N...
    --------     -      PanelID 2-3--------link N...
    |PanelSet 1|-      
                  ------PanelID 3-1--------link N...
    --------     -      PanelID 3-2--------link N...
    |PanelSet 2|-       PanelID 3-1--------link N...
    --resultset required
    Panel_set         Panel_id          link
    0_Data center_A    1-1               Status1
    0_Data center_A    1-1               Status2
    0_Data center_A    1-1               Status3
    0_Data center_A    1-1               Status4
    0_Data center_A    1-1               Status5
    0_Data center_A    1-2               View 1
    0_Data center_A    1-2               View 2
    0_Data center_A    1-2               View 3
    0_Data center_A    1-2               View 4
    0_Data center_A    1-2               View 1
    1_Data center_B    2-4              viewer 1
    1_Data center_B    2-4              viewer 2Message was edited by:
    Sachin.Singh

    with t as
    (select xmltype(
    '... your xml here ...
    ') as xml from dual),
    panel_sets as ( select extractvalue(t2.column_value, '//*/@name') as panel_set,
                           extractvalue(t3.column_value, '//*'      ) as panel_id
                      from t, table(xmlsequence(extract(t.xml,           '//Menus/PanelSet'))) t2,
                              table(xmlsequence(extract(t2.column_value, '//*/PanelID'     ))) t3
        panels as ( select extractvalue(t2.column_value, '//*/@id'  ) as panel_id,
                           extractvalue(t3.column_value, '//*/@name') as link
                      from t, table(xmlsequence(extract(t.xml,           '//Menus/Panel'))) t2,
                              table(xmlsequence(extract(t2.column_value, '//*/Link'     ))) t3
    select s.panel_set, s.panel_id, p.link
      from panel_sets s, panels p
      where p.panel_id = s.panel_id
    PANEL_SET            PANEL_ID LINK
    0_Data center_A      1-1      status 1
    0_Data center_A      1-1      status 2
    0_Data center_A      1-1      status 3
    0_Data center_A      1-1      status 4
    0_Data center_A      1-1      status 5
    0_Data center_A      1-2      View 1
    0_Data center_A      1-2      View 2
    0_Data center_A      1-2      View 3
    0_Data center_A      1-2      View 4
    0_Data center_A      1-2      View 5
    0_Data center_A      1-2      View 6
    0_Data center_A      1-2      View 7
    1_Data center_B      2-4      viewer 1
    1_Data center_B      2-4      viewer 2
    2_Data center_C      3-2      inquiry 1
    2_Data center_C      3-4      reconciliation 1
    2_Data center_C      3-4      reconciliation 2
    2_Data center_C      3-4      reconciliation 3
    18 rows selected.

  • Urgent!! Urgent!! Slow in XML extraction.

    Hi,
    I am using 8.1.7 dB. I have prob in performance, while extractging. I have XML doc like the following.
    - <rowOfCells>
    - <cellValueList>
    <cellValue>Class I Senior Notes</cellValue>
    <cellValue>0</cellValue>
    <cellValue>0.0054</cellValue>
    <cellValue>48164975</cellValue>
    <cellValue>4.18</cellValue>
    <cellValue>304557600</cellValue>
    <cellValue>181835025</cellValue>
    </cellValueList>
    </rowOfCells>
    - <rowOfCells>
    - <cellValueList>
    <cellValue>Class I Senior Notes</cellValue>
    <cellValue>0</cellValue>
    <cellValue>0.0054</cellValue>
    <cellValue>49105975</cellValue>
    <cellValue>4.33</cellValue>
    <cellValue>307906256</cellValue>
    <cellValue>180894025</cellValue>
    </cellValueList>
    </rowOfCells>
    Please noet that the number of "cellValue" tags may vary. I am using the code like the following to extract and make it as a record.
    l_row_node_list := xslProcessor.selectNodes (p_node,'/rowOfCells/cellValueList' );
    FOR i IN 0 .. XMLDOM.getLength (l_row_node_list) - 1
    LOOP
    l_row_node := XMLDOM.item (l_row_node_list, i);
    l_col_node_list := xslProcessor.selectNodes (l_row_node,'cellValue' );
         FOR j IN 0 .. XMLDOM.getLength (l_col_node_list) - 1
    LOOP
         l_grandChildArray(j+1) := SUBSTR(XMLDOM.getNodeValue( XMLDOM.getFirstChild(XMLDOM.item (l_col_node_list, j) ) ),1,100);
         END LOOP;
    -- Make as record structure.
    l_generic_rec.col1 := l_grandChildArray(1);
         l_generic_rec.col2 := l_grandChildArray(2);
         l_generic_rec.col3 := l_grandChildArray(3);
         l_generic_rec.col4 := l_grandChildArray(4);
    l_generic_rec.col5 := l_grandChildArray(5);
         l_generic_rec.col6 := l_grandChildArray(6);
         l_generic_rec.col7 := l_grandChildArray(7);
         l_generic_rec.col8 := l_grandChildArray(8);
    END LOOP;
    This works fine for me, but it takes 5 minutes to extract for 1200 cellValueList. I want to speed up this process.Is there any way i can modify this code or use some other way to speed up the process of extraction?
    Advanced Thanks
    Ramesh

    Your code using the DOM APIs looks fine. You can change 'cellValue' to '/cellValue' and see if there will be any improvement:
    l_col_node_list := xslProcessor.selectNodes (l_row_node,'/cellValue' );
    Or you can use the SAX streaming method to get the data. Would you like to send the sample data?

  • XML Extract function help

    I have below xml in oracle table, how to extract partial address data "10 Otterburn Gardens, ISLEWORTH, Middlesex TW4 5JJ" using sql
    <?xml version="1.0"?>
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      <soap:Body>
        <qas:QASearchResult xmlns:qas="http://www.qas.com/web-2009-08" VerifyLevel="None">
          <qas:QAPicklist AutoFormatSafe="true">
            <qas:FullPicklistMoniker>0_MGBRFQbdBwAAAAABAQEAAQAAAADfKULSACEYAgAAAAAAMTYAAP..ZAAAAAD.....AAAAAAAAAAA-</qas:FullPicklistMoniker>
            <qas:PicklistEntry FullAddress="true">
              <qas:Moniker>0XOGBRFQbdBwAAAAABAwEAAAAA3ylC0gAhGAIAAAAAADE2AAD..2QAAAAA.....wAAAAAAAAAAADE2IE90dGVyYnVybiBHYXJkZW5zLCBUVzcgNUpKAA--</qas:Moniker>
              <qas:PartialAddress>10 Otterburn Gardens, ISLEWORTH, Middlesex TW4 5JJ</qas:PartialAddress>
              <qas:Picklist>16 Otterburn Gardens, ISLEWORTH, Middlesex</qas:Picklist>
              <qas:Postcode>TW7 5JJ</qas:Postcode>
              <qas:Score>100</qas:Score>
            </qas:PicklistEntry>
            <qas:Prompt>Enter selection</qas:Prompt>
            <qas:Total>1</qas:Total>
          </qas:QAPicklist>
        </qas:QASearchResult>
      </soap:Body>
    </soap:Envelope>

    Also, I can see here -- ORA-19279: XPTY0004 - XQuery dynamic type mismatch: expected singleton sequence - got multi-item sequence
    that you have used another technique XMLNamespaces() for the same.
    select x.*
    from abc t
       , xmltable(
           xmlnamespaces(
             default 'urn:swift:xsd:fin.970.2011'
           , 'urn:swift:xsd:mtmsg.2011' as "ns0"
         , '/ns0:FinMessage/ns0:Block4/Document/MT970/F61a/F61'
           passing t.col1
           columns F61ValueDate                Varchar(40) Path 'ValueDate'
                 , DebitCreditMark             Varchar(40) Path 'DebitCreditMark'
                 , Amount                      Varchar(40) Path 'Amount'
                 , TransactionType             Varchar(40) Path 'TransactionType'
                 , IdentificationCode          Varchar(40) Path 'IdentificationCode'                 
                 , ReferenceForTheAccountOwner Varchar(40) Path 'ReferenceForTheAccountOwner'
                 , SupplementaryDetails        Varchar(40) Path 'SupplementaryDetails'       
         ) x;
    What you are trying to do here? and why that "default" namespace?
    Also, I'll also go through the docs in this meantime.
    -- Ranit

  • SQL XML Variable Assignment?

    Maybe more of a code question, but used in B1i. Using the B1out type="sql" how do I assign the return value of:
    Select CardCode From [OCDR] Where U_CSTN = <xsl:value-of select="col[8]"/>
    to a xml variable? Maybe a simple question but I am having issues using the return value that I need in a B1out type="object" in the same atom.
    All responses deeply appreciated,
    Mike
    <xsl:template name="transform">
         <b1im_multimsg xmlns="">
                       <xsl:for-each select="$msg/row">
                   <b1im_msg>
                        <B1out type="sql">
                             <xsl:variable name="Code">
                                  <sql>Select CardCode From [OCRD] Where U_DTNCN = <xsl:value-of select="col[8]"/></sql>
                             </xsl:variable>
                        </B1out>
                        <B1out type="object">
                             <Documents>
                                  <row>
                                       <CardCode>
                                            <xsl:copy-of select="$Code"/>
                                       </CardCode>
                                  </row>
                             </Documents>
                             <Document_Lines>
                                  <row>
                                       <ItemCode>
                                            <xsl:value-of select="col[2]"/>
                                       </ItemCode>
                                       <Quantity>
                                            <xsl:value-of select="col[3]"/>
                                       </Quantity>
                                  </row>
                             </Document_Lines>
                        </B1out>
                   </b1im_msg>
              </xsl:for-each>
         </b1im_multimsg>
    </xsl:template>

    I has an immediate suspicion it might be related to the issue
    mentioned in
    http://otn.oracle.com/support/tech/sql_plus/htdocs/sub_var2.html#2_7
    but this proved wrong: the SP2-306 still occurs in the latest
    SQL*Plus.
    I wonder what version of 8i you had working? With an old SQL*Plus
    8.1.7.0 my connection failed the same as in 9.2 and 10i.
    My solution was to do:
      SQLPLUS='sqlplus -s'
      UNPW='/ as sysdba'
      $SQLPLUS "$UNPW" &lt;&lt;EOF
      EOFThis worked in 9.2.0.5, 10.1.0.2 and 8.1.7.0.
    One common security risk on UNIX remains: putting the username and
    password on the command line. On some systems a "ps" command will
    show the password to any user. If OS authentication cannot be used
    for connection, perhaps putting the username/password in the SQL
    script may be more secure?
    A final note is that in SQL*Plus 10g, no quotes are needed around
    AS SYSDBA, i.e.
      sqlplus / as sysdba works from the OS prompt, whereas in 9.2 you need to do
      sqlplus "/ as sysdba"This makes a solution easy:
      SQLPLUS="/usr/oracle/product/10.1.0/bin/sqlplus -s xxx/xxxxxx@xxxx as sysdba"-- CJ

  • Want to get a xml blob as a varchar2

    Hi Guys,
    What is the max size of letters we could use in varchar2 in oracle9? (Is it 4000?)
    Reason to ask this is that I have an xml document as a blob and want to show it in my client. I wanna create a view that will do something like Utl_Raw.Cast_To_Varchar2....
    However the requirement is to get the entire xml to the client that may go up to even 10000 chars. Any help or comments on this would be very much appreciated.
    Many Thanks...

    > What is the max size of letters we could use in varchar2 in oracle9? (Is it 4000?)
    <p>
    Yes, in SQL. In PL/SQL it's 32,767. This may help.

Maybe you are looking for

  • New System Build feedback/advice, please...

    Time to build a new WorkStation. My motivation for upgrading is that I have been using a mediocore laptop (i7m, 8gb, 250gb ) from my work as my home system for the last 2 years, I am starting to get more freelance coming in and need a good desktop. I

  • Error code: 0xE401064C -- error in syncing a sharepoint OneNote ....

    We consistently get an error in OneNote client when trying to sync the local OneNote files to the ones that are Sharepoint.  The Sharepoint OneNote files are in a special Sharepoint OneNote library, created with the right default template.  Versionin

  • Oracle intialization or shut down in progress

    Hello every one i have installed database 10g release 2 on windows 2003 R2 standard edition and after creating DB with SID orcl with no logic reason when i connect to it it gave me oracle intialization or shut down in progress message and doesn't con

  • I want to make a complaint but how? Cant find an address to write to?

    I'm extremly annoyed: purchased a 13" mac book pro on 13/11/13 for my teenage sons birthday and christmas present, on 29/11/13 he couldnt start the mac book up. We took it to our nearest apple store & saw an apple genius, we left it with them for 2 h

  • Removing schema prefix from DDL statements

    When I do a change via sql developer, such as adding/dropping a field or table, etc... I need to send the change as a SQL script to my DBA (so it could be sent with our next upgrade to customers, etc). But, the changes are always prefixed by the sche