I want to make only one node draggable in the tree. How?

I want to make only one node draggable in the tree. How?
when we have only
tree.setDragEnable(true)which makes draggable the entire nodes in the tree.
Thanks -

Hi Andrea
Just to clarify things up: is this what you want?
package treeDnD;
* DragJustOneNode.java
import java.awt.*;
import java.awt.datatransfer.*;
import java.awt.dnd.*;
import java.io.*;
import javax.swing.*;
import javax.swing.tree.*;
public class DragJustOneNode extends JFrame {
    private JTree tree;
    private DefaultTreeModel model;
    private DefaultMutableTreeNode root;
    public DragJustOneNode() {
        super("Only child 1 is draggable!");
        setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        setSize(400,300);
        setLocationRelativeTo(null);
        tree = new JTree();
        tree.setDragEnabled(true);
        getContentPane().add(new JScrollPane(tree), BorderLayout.CENTER);
        tree.setTransferHandler(new TreeTransferHandler());
        root = new DefaultMutableTreeNode(new NodeData(0, "root"));
        root.add(new DefaultMutableTreeNode(new NodeData(1, "child 1")));
        root.add(new DefaultMutableTreeNode(new NodeData(2, "child 2")));
        root.add(new DefaultMutableTreeNode(new NodeData(3, "child 3")));
        root.add(new DefaultMutableTreeNode(new NodeData(4, "child 4")));
        model = new DefaultTreeModel(root);
        tree.setModel(model);
    public static void main(final String args[]) {new DragJustOneNode().setVisible(true);}
class NodeData{
    private int id;
    private String data;
    public NodeData(final int id, final String data){
        this.id = id;
        this.data = data;
    public int getId() {return id;}
    public void setId(final int id) {this.id = id;}
    public String getData() {return data;}
    public void setData(final String data) {this.data = data;}
    public String toString() {return data;}
class TreeTransferable implements Transferable{
    private NodeData nodeData;
    public TreeTransferable(NodeData nodeData){
        this.nodeData = nodeData;
    public DataFlavor[] getTransferDataFlavors() {
        return new DataFlavor[]{DataFlavor.stringFlavor};
    public boolean isDataFlavorSupported(DataFlavor flavor) {
        return true;
    public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException {
        return nodeData;
class TreeTransferHandler extends TransferHandler{
    private DefaultMutableTreeNode sourceNode, targetNode;
    public boolean canImport(final JComponent comp, final DataFlavor[] transferFlavors) {
        NodeData nodeData = (NodeData) (sourceNode).getUserObject();
        if(nodeData.getId() == 1) return true;
        return false;
    protected Transferable createTransferable(final JComponent c) {
        JTree tree = ((JTree)c);
        sourceNode = (DefaultMutableTreeNode) tree.getLastSelectedPathComponent();
        return new TreeTransferable((NodeData) sourceNode.getUserObject());
    public int getSourceActions(final JComponent c) {return DnDConstants.ACTION_MOVE;}
    public boolean importData(final JComponent comp, final Transferable t) {
        JTree tree = ((JTree)comp);
        DefaultTreeModel model = (DefaultTreeModel)tree.getModel();
        targetNode = (DefaultMutableTreeNode) tree.getLastSelectedPathComponent();
        DefaultMutableTreeNode parent = (DefaultMutableTreeNode)targetNode.getParent();
        if(parent == null) return false;
        model.removeNodeFromParent(sourceNode);
        model.insertNodeInto(sourceNode, parent, parent.getIndex(targetNode));
        tree.setSelectionPath(new TreePath(model.getPathToRoot(sourceNode)));
        return true;
}

Similar Messages

  • Is it possible to make only one page landscape while the rest are portrait?

    Hi,
    I have a long Pages document with everything in portrait view, but I want just one page to be in landscape. Is it possible to do this?
    Thanks

    Rotating the page contents is completely different than rotating a page.
    Using the A4 format, a landscape page may display a rectangle whose width is 297 mm, height is 210 mm.
    A rotated object in a portrait page is restricted to a width of 210 mm.
    On these two screenshots, the text boxes in page 2 are containing the same piece of text.
    Compare the true landscape one to the the portrait one rotated of 90°
    or
    compare the true portrait one to the the landscape one rotated of 90°.
    They are completely different.
    This is why I will continue to write that we can't use two pages orientation in a single document !

  • Safari dont want to open only one (my own) website, the post connected to this site cant download any emails

    Sorry for my english.
    I have my own website (can tell you the name, if you ask). In December after I have installed 5.0.1 my website and the post doesnt work via 3g, gprs.
    With wi-fi everething is ok. In opera via 3g, gprs, wi-fi everething is ok.
    thank you

    Dear Forum viewers,
    With lots of digging and faffing around I have discovered what the problem was.
    A supposedly benign programme that had been running in the background for years,was the culprit.
    It took some finding, it is a complete b4st4rd!
    Uninstall 'Peerguardian' whatever you do.
    Problem solved.
    Cheers,
    Chris

  • How to make only one column non reorderble

    I want to make only one column (Column 0) of my JTable non reorderble.
    I also want to make the same column non resizable and I want to give it a specific size.
    Please help me on this?

    I have implemented a RowHeaderTable class which displays 1, 2, 3, ... in the first column. The column is in the scrollpane's RowHeaderView, so it is not resizable nor reorderable. But its width can be set in your code. Maybe this is what you need.
    Use the class the same way you use a JTable, except 3 added methods:
    getScrollPane();
    setMinRows(int r);
    setRowHeaderWidth(int w);
    Note: The table works perfectly in skinless L&F, such as the default java L&F. It looks ugly in Liquid L&F because I don't know how to steal column header's UI to use on a JList. If someone can help me on this one, I thank you in advance.
    * RowHeaderTable.java
    * Created on 2005-3-21
    * Copyright (c) 2005 Jing Ding, All Rights Reserved.
    * Permission to use, copy, modify, and distribute this software
    * and its documentation for NON-COMMERCIAL purposes and without
    * fee is hereby granted provided that this copyright notice
    * appears in all copies.
    * JING DING MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
    * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
    * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
    * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. JING DING
    * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT
    * OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
    import java.awt.BorderLayout;
    import java.awt.Component;
    import javax.swing.AbstractListModel;
    import javax.swing.JFrame;
    import javax.swing.JList;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import javax.swing.ListCellRenderer;
    import javax.swing.UIManager;
    import javax.swing.event.TableModelEvent;
    import javax.swing.event.TableModelListener;
    import javax.swing.table.DefaultTableModel;
    import javax.swing.table.JTableHeader;
    import javax.swing.table.TableCellRenderer;
    import javax.swing.table.TableColumn;
    import javax.swing.table.TableModel;
    * @author Jing Ding
    public class RowHeaderTable extends JTable {
      private int minRows = 10;                         // Minimum size of the row header.
      private static final int DEFAULT_WIDTH = 30;
      private JScrollPane jsp;
      // The row header is a JList with the same appearance as the column header.
      private JList rowHeader;
      // Repaint row header whenever the table inserts or deletes rows.
      private TableModelListener tmListener = new TableModelListener(){
        public void tableChanged(TableModelEvent e){
          if(e.getType() != TableModelEvent.UPDATE)
            rowHeader.repaint();
      /** Create a new instance of RowHeaderTable.
       * @param model
      public RowHeaderTable(TableModel model){
        setModel(model);
        initializeHeader();
        jsp = new JScrollPane(this);
        jsp.setRowHeaderView(rowHeader);
      private void initializeHeader(){
        rowHeader = new JList(new AbstractListModel(){
          public int getSize(){ return Math.max(getModel().getRowCount(), minRows); }
          public Object getElementAt(int index){ return "" + ++index; }
        setRowHeaderWidth(DEFAULT_WIDTH);
        rowHeader.setFixedCellHeight(getRowHeight());
        rowHeader.setCellRenderer(new TableRowHeaderRenderer());
      public void setRowHeaderWidth(int w){
        rowHeader.setFixedCellWidth(w);
      public void setMinRows(int m){ minRows = m; }
      public void setModel(TableModel model){
        super.setModel(model);
        model.addTableModelListener(tmListener);
      /**Use this method to get the scrollPane, instead of new JScrollPane(table).
       * @return
      public JScrollPane getScrollPane(){ return jsp; }
      protected class TableRowHeaderRenderer implements ListCellRenderer{
        TableCellRenderer colHeaderRenderer;
        public TableRowHeaderRenderer(){
          JTableHeader header = getTableHeader();
          TableColumn aColumn = header.getColumnModel().getColumn(0);
          colHeaderRenderer = aColumn.getHeaderRenderer();
          if(colHeaderRenderer == null)
            colHeaderRenderer = header.getDefaultRenderer();
        public Component getListCellRendererComponent(JList list, Object value,
            int index, boolean isSelected, boolean hasFocus){
          return colHeaderRenderer.getTableCellRendererComponent(
              RowHeaderTable.this, value, isSelected, hasFocus, -1, -1);
      public static void main(String[] args){
        try {
          UIManager.setLookAndFeel("com.birosoft.liquid.LiquidLookAndFeel");
        }catch (Exception e){ e.printStackTrace(); }
        String[] columnNames = {"First Name",
            "Last Name",
            "Sport",
            "# of Years",
            "Vegetarian"};
              Object[][] data = {
                   {"Mary", "Campione", "Snowboarding", new Integer(5), new Boolean(false)},
                   {"Alison", "Huml", "Rowing", new Integer(3), new Boolean(true)},
                   {"Kathy", "Walrath", "Knitting", new Integer(2), new Boolean(false)},
                   {"Sharon", "Zakhour", "Speed reading", new Integer(20), new Boolean(true)},
                   {"Philip", "Milne", "Pool", new Integer(10), new Boolean(false)}
        DefaultTableModel dtm = new DefaultTableModel(data, columnNames);
        RowHeaderTable rht = new RowHeaderTable(dtm);
        rht.setMinRows(0);
        JFrame frame = new JFrame("RowHeaderTable Demo");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.getContentPane().add(rht.getScrollPane(), BorderLayout.CENTER);
        frame.pack();
        frame.setVisible(true);
        dtm.addRow(new Object[]{"Mary", "Campione", "Snowboarding", new Integer(5), new Boolean(false)});
        dtm.addRow(new Object[]{"Mary", "Campione", "Snowboarding", new Integer(5), new Boolean(false)});
        dtm.addRow(new Object[]{"Mary", "Campione", "Snowboarding", new Integer(5), new Boolean(false)});
    }

  • I am trying to transfer my movies (mp4 files) to my IPad, but they are not showing up on the IPad. I have 13 movies showing on my IPad that they are in ICloud. I've sync'd the movies I want to the IPad, but only one is showing under the "movies" folder. ?

    I have been trying to transfer some different movies from my PC to my IPad, but they are not showing in the "movie" folder. I have sync'd the movies (these are mp4 files) that I wanted transfered, but only one is showing in the folder. There are 13 other movies in the folder that have the ICloud symbol in the corner of their picture. I understand that I can pull those movies from ICloud any time I want to watch them, but I want to watch the ones that I've just sync'd with my IPad. How do I find them? After I checked the movies I wanted, I "applied" them and watched it sync and copy the wanted movies to my IPad. Now what?  Thanks.

    There are some good programs that you could use to convert the format, Handbrake or Mpegstreamclip are two good free ones. Convert them to MP4 and then try importing them again.

  • Greeting,  I want to reformat my external hard drive using Mac OS Extended (Journaled, Encrypted ) but before formatting it, I want to make sure that if I loose the hard drive or the hard drive get stolen, no one will be able to retrieve or recover the in

    Greeting,
    I want to reformat my external hard drive using Mac OS Extended (Journaled, Encrypted ) but before formatting it, I want to make sure that if I loose the hard drive or the hard drive get stolen, no one will be able to retrieve or recover the information on it so could you tell me what kind of encryption will be used or is there any way to recover the information?
    Thanks!

    I think FileVault is used to encryp internal hard drive but I wanna encrypt an external hard drive with Mac OS Extended Journaled Encrypted which is completely different!

  • SCAN LISTENER runs from only one node at a time from /etc/hosts !

    Dear all ,
    Recently I have to configure RAC in oracle 11g(r2) in AIX 6.1 . Since in this moment it is not possible to configure DNS, so I dont use SCAN ip into the DNS/GNS, I just add the SCAN ip into the host file like :
    cat /etc/hosts
    SCAN 172.17.0.22
    Got the info from : http://www.freeoraclehelp.com/2011/12/scan-setup-for-oracle-11g-release211gr2.html#ORACLE11GR2RACINS
    After configuring all the steps of RAC , Every services are ok except SCAN_LISTENER . This listener is up only one node at a time . First time when I chek it from node1 , it shows :
    srvctl status scan_listener
    SCAN listener LISTENER_SCAN1 is enabled
    SCAN listener LISTENER_SCAN1 is running on node dcdbsvr1
    now when I relocate it from node 2 using
    "srvctl relocate scan -i 1-n DCDBSVR2" , then the output shows :
    srvctl status scan_listener
    SCAN listener LISTENER_SCAN1 is enabled
    SCAN listener LISTENER_SCAN1 is running on node dcdbsvr2
    Baring these , we have to try to relocate it from the node2 by the following way, then it shows the error :
    srvctl relocate scan -i 2 -n DCDBSVR2
    resource ora.scan2.vip does not exists
    Now my question , How can I run the SCAN and SCAN_LISTENER both of the NODES ?
    Here is my listener file (which is in the GRID home location) configuration :
    Listener File OF NODE1 AND NODE 2:
    ==================================
    ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN1=ON
    ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON
    LISTENER_SCAN1 =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = IPC) (KEY = LISTENER_SCAN1)
    ADR_BASE_LISTENER_SCAN1 = /U01/APP/ORACLE
    2)
    Another issue , when I give the command : " ifconfig -a " , then it shows the SCAN ip either node1 or node2 . suppose if the SCAN ip is in the node1 , and then if I run the "relocate" command from node2 , the ip goes to the Node 2 . is it a correct situation ? advice plz ... ...
    thx in advance .. ...
    Edited by: shipon_97 on Jan 10, 2012 7:22 AM
    Edited by: shipon_97 on Jan 10, 2012 7:31 AM

    After configuring all the steps of RAC , Every services are ok except SCAN_LISTENER . This listener is up only one node at a time . First time when I chek it from node1 , it shows :If I am not wrong and after looking at the document you sent, you will be able to use only once scan in case you use /etc/host file and this will be up on only one node where you added this scan entry in /etc/hosts file.
    Now my question , How can I run the SCAN and SCAN_LISTENER both of the NODES ?Probably you can't in your case, you might run only one i think and on one node only
    srvctl status scan_listener
    SCAN listener LISTENER_SCAN1 is enabled
    SCAN listener LISTENER_SCAN1 is running on node dcdbsvr1
    now when I relocate it from node 2 using
    "srvctl relocate scan -i 1 -n DCDBSVR2" , then the output shows :
    srvctl status scan_listener
    SCAN listener LISTENER_SCAN1 is enabled
    SCAN listener LISTENER_SCAN1 is running on node dcdbsvr2You moved scan listener from node 1 to node 2, OK
    Baring these , we have to try to relocate it from the node2 by the following way, then it shows the error :
    srvctl relocate scan -i 2 -n DCDBSVR2
    resource ora.scan2.vip does not exists
    --------------------------------------------------------------------------------Since you have only one scan, you can't relocate "2". So ise "1" instead here also
    FYI
    http://www.oracle.com/technetwork/database/clustering/overview/scan-129069.pdf
    Salman

  • Instead of creating multiple Instances I want to create only one Instance.

    Hi Everyone
    Good morning, How are you.
    I have a requirement to transfer files from one location to another location, I am able to do this successfully using FTP Adapters.
    I have some Issues please help any one.
    1) When I deployed my process it is creating one instance for one file transfer, Suppose If I have 50 files in my Get
    directory, After deploy the process 50 instances are creating and 50 Email generating saying files are not tranfered successfully.
    Instead of creating 50 Instances I want to create only one Instance.
    2) When files are not transferd it will fire error mail saying that not success (I want to display all file names(not tranfered files) in my mail , i.e whatever files are not tranfered, need to diplay in mail).
    3) And I am not able to transfer 0 size files, But in BPEL Console Instance is creating for 0 size file also and I am getting Email for success... and In put directory 0 size file is not showing. (Instance is creating and Success Email coming but file is not exists in Put directory)
    Please help me.
    Regards
    Venkat
    Edited by: user10263255 on Oct 1, 2008 8:10 AM
    Edited by: user10263255 on Oct 1, 2008 9:15 AM

    Hi Dharmendra,
    Thanks for your reply.
    I am not able to see any thing about singleton process in mentioned URL.
    Can you please provide me the another URL or please paste here about singleton process .
    Thanks in Advance.
    Regards
    Venkat

  • XML - ORA-19025: EXTRACTVALUE returns value of only one node

    Hi,
    I am new to XML DB. Can somebody help me with the below XML
    I use the following XML ... (I have pasted only a part of it coz i require data only till this section )
    XML
    <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-
    instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><SOAP-ENV:Body>
    <ns:PicklistWS_GetPicklistValues_Output xmlns:ns="urn:crmondemand/ws/picklist/">
    <ListOfParentPicklistValue xmlns="urn:/crmondemand/xml/picklist">
    <ParentPicklistValue>
    <Language>ENU</Language>
    <ParentFieldName>plProduct_Team</ParentFieldName>
    <ParentDisplayValue>Marketing On Demand</ParentDisplayValue>
    <ParentCode>Marketing On Demand</ParentCode>
    <Disabled>N</Disabled>
    <ListOfPicklistValue>
    <PicklistValue>
    <Code>OCP/SME Escalation</Code>
    <DisplayValue>OCP/SME Escalation</DisplayValue>
    <Disabled>N</Disabled>
    </PicklistValue>
    <PicklistValue>
    <Code>Fusion Request</Code>
    <DisplayValue>Fusion Request</DisplayValue>
    <Disabled>N</Disabled>
    </PicklistValue>
    Code
    SELECT distinct
    EXTRACTVALUE(VALUE(SR), '/ParentPicklistValue/ListOfPicklistValue/PicklistValue/Code','xmlns="urn:/crmondemand/xml/picklist"') AS Display,
    EXTRACTVALUE(VALUE(SR),'/ParentPicklistValue/ListOfPicklistValue/PicklistValue/DisplayValue','xmlns="urn:/crmondemand/xml/picklist"') AS Return,
    EXTRACTVALUE(VALUE(SR),'/ParentPicklistValue/ParentDisplayValue','xmlns="urn:/crmondemand/xml/picklist"') AS parent_display,
    EXTRACTVALUE(VALUE(SR),'/ParentPicklistValue/ParentCode','xmlns="urn:/crmondemand/xml/picklist"') AS parent_return
    FROM TABLE(XMLSEQUENCE(EXTRACT(
    WEB_SERVICE('<?xml version="1.0" encoding="UTF-8" standalone="no"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <soap:Body>
    <PicklistWS_GetPicklistValues_Input xmlns="urn:crmondemand/ws/picklist/">
    <FieldName>Type</FieldName>
    <RecordType>Service Request</RecordType>
    </PicklistWS_GetPicklistValues_Input>
    </soap:Body>
    </soap:Envelope>'
    ,'document/urn:crmondemand/ws/picklist/:GetPicklistValues', Sessionid),
    '/soap:Envelope/soap:Body/*/*/*','xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/'))) SR
    ERROR
    ORA-19025: EXTRACTVALUE returns value of only one node
    UNDERSTANDING
    As my Xpath points only until the node - ParentPicklistValue and not the child nodes under it. Hence when i try to query the child nodes - /ParentPicklistValue/ListOfPicklistValue/PicklistValue/Code, I recieve the above mentioned error.
    REQUIREMENT
    Can somebody help me to recieve the Parent values and also its child values based on the above query and xml.

    Hi,
    That's a classic ;)
    You need a second XMLSequence that will shred the collection of PicklistValue into relational rows :
    select extractvalue(value(sr2), '/PicklistValue/Code', 'xmlns="urn:/crmondemand/xml/picklist"') AS Display
         , extractvalue(value(sr2), '/PicklistValue/DisplayValue', 'xmlns="urn:/crmondemand/xml/picklist"') AS Return
         , extractvalue(value(sr1), '/ParentPicklistValue/ParentDisplayValue', 'xmlns="urn:/crmondemand/xml/picklist"') AS parent_display
         , extractvalue(value(sr1), '/ParentPicklistValue/ParentCode', 'xmlns="urn:/crmondemand/xml/picklist"') AS parent_return
    from table(
           xmlsequence(
             extract( WEB_SERVICE( ... )
                    , '/soap:Envelope/soap:Body/ns:PicklistWS_GetPicklistValues_Output/ListOfParentPicklistValue/ParentPicklistValue'
                    , 'xmlns="urn:/crmondemand/xml/picklist"
                       xmlns:ns="urn:crmondemand/ws/picklist/"
                       xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"' )
         ) sr1
       , table(
           xmlsequence(
             extract( value(sr1)
                    , '/ParentPicklistValue/ListOfPicklistValue/PicklistValue'
                    , 'xmlns="urn:/crmondemand/xml/picklist"' )
         ) sr2
    ;What's your database version BTW?
    On 10.2 and up, you may use XMLTable instead.

  • "ORA-19025 EXTRACTVALUE returns value of only one node" - Suggestion

    ORA-19025 EXTRACTVALUE returns value of only one node
    When this error occurs, would you please provide some or all of the following information:
    (1) row number
    (2) row id
    (3) the name of the offending column
    (5) the XQuery expression
    (6) the node name
    (7) the text value being parsed, in which an excess node was found
    and would you consider processing every good row, assuming it may be correct,
    because, in 13 thousand lines generated by my view, there is unlikely to even one more row in error.
    Thank you,
    Mike Rainville
    FYI,
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
    With the Partitioning, Real Application Clusters, OLAP and Data Mining options
    ojdbc6.jar 11.1.0.7.0

    Thanks for the suggestion...
    The problem is that in one row, information in a data dump about two different things was combined into one, due to a gap in the input file. The starting delimiter for the second thing and the ending delimiter for the first were missing. The result was that many entity tags that should have been unique were duplicated, ion that particular row.
    I was able to guard the view against future such errors with occurrences using this
    in the WHERE clause ...
    AND NOT ( XMLCLOB LIKE '%<TAG1>%<TAG1>%'
    OR XMLCLOB LIKE '%<TAG2>%<TAG2>%'
    OR XMLCLOB LIKE '%<TAG3>%<TAG3>%'
    /* ... Repeated once for each tag used with extractvalue */
    OR XMLCLOB LIKE '%<TAGN>%<TAGN>%'
    It filters out any row with two identical starting tags, where one is expected.
    I am pleased to see that the suggestion got through.

  • Extract return only one node.

    error is ORA-19025: EXTRACTVALUE returns value of only one node
    CREATE OR REPLACE PROCEDURE a_insertZipcodes
       IS
        p_directory  VARCHAR2(100);
        p_filename   VARCHAR2(100);
        l_xml xmltype;
          type tp is record (c1 varchar2(100), c2 varchar2(100));
          type t is table of tp;
          r t;
        BEGIN
        sp_co_set_globalvar(null,null,null,null,51,null,null,'EOD',null);
        p_filename :='myxml.xml';
        p_directory:=get_handoff_path_batch(PKG_CO_GLOBALVAR.ctrl1);
        l_xml := xmltype(bfilename(p_directory, p_filename), nls_charset_id('AL32UTF8'));
        select extractvalue(l_xml,'root/flexcube/contractStatus/system'),
        extractvalue(l_xml,'root/flexcube/contractStatus/accessKey') bulk collect into r from dual;
          for i in r.first..r.last loop
          dbms_output.put_line(r(i).c1);
          dbms_output.put_line(r(i).c2);
       end loop;
      END;
    xml file is :
    <root>
         <flexcube>
              <contractStatus>  
                   <system>TRESTEL</system>
                   <accessKey>eDealer</accessKey>
                   <password>eDealer</password>
                   <uuid>eDealer</uuid>
                   <sequenceNumber>206981112980100</sequenceNumber>
                   <sourceAddress>M@112980000201@2011-10-25 02:10:03.016@Internal@1112980100@20698@FX@1</sourceAddress>
                   <signature>FEDCBA98765432100123456789ABCDEF</signature>     
                   <ref_num>
                        <contractRef>1112980100</contractRef>
                   </ref_num>
                 <branch>018</branch>    
            </contractStatus>
            <contractStatus>  
                   <system>TRESTEL</system>
                   <accessKey>eDealer</accessKey>
                   <password>eDealer</password>
                   <uuid>eDealer</uuid>
                   <sequenceNumber>206981112980100</sequenceNumber>
                   <sourceAddress>M@112980000201@2011-10-25 02:10:03.016@Internal@1112980100@20698@FX@1</sourceAddress>
                   <signature>FEDCBA98765432100123456789ABCDEF</signature>     
                   <ref_num>
                        <contractRef>1112980100</contractRef>
                   </ref_num>
                 <branch>018</branch>    
            </contractStatus>
            <contractStatus>  
                   <system>TRESTEL</system>
                   <accessKey>eDealer</accessKey>
                   <password>eDealer</password>
                   <uuid>eDealer</uuid>
                   <sequenceNumber>206981112980100</sequenceNumber>
                   <sourceAddress>M@112980000201@2011-10-25 02:10:03.016@Internal@1112980100@20698@FX@1</sourceAddress>
                   <signature>FEDCBA98765432100123456789ABCDEF</signature>     
                   <ref_num>
                        <contractRef>1112980100</contractRef>
                   </ref_num>
                 <branch>018</branch>    
            </contractStatus>
         </flexcube>
    </root>
    error is ORA-19025: EXTRACTVALUE returns value of only one node

    use xmltable as in Re: XMl Inserting

  • Extractvalue gives "only one node" error

    Here is an example I tried to create based on some information I found at:
    http://www.orafaq.com/faq/how_does_one_store_and_extract_xml_data_from_oracle
    I created the table with the following:
    create table XMLTable (doc_id number, filename varchar2(100), xml_data XMLType);
    For a particular record, the xml_data field looks like this:
    <FAQ-LIST>
         <QUESTION>
              <QUERY>Question 1</QUERY>
    <RESPONSE>Abraham Lincoln</RESPONSE>
    </QUESTION>
         <QUESTION>
         <QUERY>Question 2</QUERY>
         <RESPONSE>Thomas Jefferson</RESPONSE>
         </QUESTION>
    </FAQ-LIST>
    I tried to model my select statement after the example:
    select extractValue(xml_data, '/FAQ-LIST/QUESTION/RESPONSE')
    from XMLTable
    where doc_id = 1
    and existsNode(xml_data, '/FAQ-LIST/QUESTION[QUERY="Question 1"]') = 1;
    hoping for a result of "Abraham Lincoln", but instead get the error:
    ORA-19025: EXTRACTVALUE returns value of only one node ...
    How can I arrange the query so I get one RESPONSE for each QUERY value named?
    Thanks,
    --Dave                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    SQL> SELECT EXTRACTVALUE (COLUMN_VALUE, 'QUESTION/RESPONSE') response
      FROM TABLE
              (XMLSEQUENCE
                  (EXTRACT
                      (XMLTYPE
                          ('<FAQ-LIST>
    <QUESTION>
    <QUERY>Question 1</QUERY>
    <RESPONSE>Abraham Lincoln</RESPONSE>
    </QUESTION>
    <QUESTION>
    <QUERY>Question 2</QUERY>
    <RESPONSE>Thomas Jefferson</RESPONSE>
    </QUESTION>
    </FAQ-LIST>'
                       '/FAQ-LIST/QUESTION'
              ) t
    WHERE EXTRACTVALUE (COLUMN_VALUE, 'QUESTION/QUERY') = 'Question 1'
    RESPONSE                                                                       
    Abraham Lincoln                                                                
    1 row selected.

  • How to make only one round corner?

    HI,
    How can I make only one (or 2) round corner on a square using the round corner effect?

    You don't say what version you're using, but I know that in CS3 (and probably CS4), there is a script installed that you can use.
    Draw your frame. Open the Scripts panel. Open the subfolders "Application", then "Samples", then "Javascript". With your Frame selected, double-click the script in the list named "CornerEffects.jsx". You'll be presented with a list of options to control what type of corner; and at the bottom the pop-up menu controls which corners get that type of corner.
    (Names may vary somewhat for CS4.)

  • Make only one layer of a video brighter

    Hi,
    I have few layers of videos, I am trying to make only one layer brighter.
    How can I do that?
    Thanks,

    Hmm, select the layer in the timeline, go to the effects menu, scroll down to color correction, in that menu choose brightness and contrast and adjust the brightness to your liking. It will only be applied to that layer.

  • When I got my Mac I set up an iChat account and now I want to make another one.  Does anyone know how to change it?  F

    When I got my Mac I set up an iChat account and now I want to make another one.  Does anyone know how to change it?  F

    HI,
    You can create and add another Screen Name to iChat.
    From iChat 4 you can have as many AIM Logins and Jabber Logins as you want.
    "AIM" in this case includes the Apple IDs (@mac.com and @me.com ending names) that also work as Valid AIM Screen Names as well as AIM registered Names.
    "Jabber Names" includes using Google Mail IDs and Facebook IDs as well as any registration with any other Jabber server.
    If you are not happy with the one you have you can delete and stop using it.
    Both Adding and Deleting are done in iChat > Preferences> Accounts.
    Highlight an Account/Name and then the minus button to delete.
    Using the Plus button show you the Add Screen.
    8:00 PM      Sunday; December 11, 2011
    Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"
      iMac 2.5Ghz 5i 2011 (Lion 10.7.2)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
    "Limit the Logs to the Bits above Binary Images."  No, Seriously

Maybe you are looking for