Any faster way

this is a sample date in my viewobject
id title parentId
1 root -1
2 level2.1 1
3 level2.2 1
4 leaf1 2
5 leaf2 3
the parentID is a foreignkey to id,there is also a view link bettwen them.
i want to load the whole tree,so i must first to iterate the whole viewobjcet to find root.
then when i want to find the root's children,i must also to iterate the whole viewobject.
this is too slow.
how can i make it faster?can i remove the row i have iterated,because it only iterate once.

Hi,
Why not writing your vo query with a connect by clause?
As in
-- Beginning of Sample Data
with t as
select 1 id, 'root' title, -1 parentid from dual
union all select 2, 'level2.1', 1 from dual
union all select 3, 'level2.2', 1 from dual
union all select 4, 'leaf1', 2 from dual
union all select 5, 'leaf2', 3 from dual
) -- End of Sample Data
select id,level, title from t
start with parentid=-1
connect by prior id=parentid
Output
        ID      LEVEL TITLE
         1          1 root
         2          2 level2.1
         4          3 leaf1
         3          2 level2.2
         5          3 leaf2This is just an example, you can change the select statement according to your original table.
-Arun

Similar Messages

  • What will happen to the organization of library if I removed the songs from windows explorer? Will iTunes automatically updated without all the deleted songs, or it will indicate 'missing location'? Any fast ways to clear this 'missing location' songs?

    What will happen to the organization of library if I removed the songs from windows explorer?
    Background: I found it easier to identify duplicated songs in windows explorer as the songs will be renamed .... 1.mp3, thus enabling me to remove the duplicated songs; unlike in iTunes where I know the trick of showing duplicate songs, but you don't know which one is the one with 1 at the end of the file name.
    Will iTunes automatically update the library without all the deleted songs, or will it indicate 'missing location' songs? Any fast ways to clear this 'missing location' songs by highlighting them all and delete all at one go?
    Thanks.

    One way is to use iTunes Folder Watch with its option to check for dead tracks on start up.
    Another option is with a set of Lost & Found playlists.
    Lost & Found
    Create a playlist called Found, select everything in Music and drag it into the Found playlist. Create a smart playlist called Lost matching All the rules Playlist is Music and Playlist is not Found. Your lost tracks will be in this playlist. You can delete them all with a Ctrl-A to select them and Shift-Delete to remove them.
    You can then delete the Lost & Found playlists.
    tt2

  • Downloading software updates on dial-up connection. Any faster way?

    I would like to download and install the Mac OS X Update Combined version 10.5.6. However, I am on a dial-up connection (High speed not available) and downloading the 657 MB will take . . . wait for it . . . 68 hours.
    Is the update available any other way?
    Thanks!

    Hi Wandatoo;
    I am totally flabbergasted to hear that your Apple dealer refused your request. So far everyone I have asked did it without any questions at all.
    You might try a library. Most libraries today have high speed connections and computers. If the download will take a significant amount of time they may ask you to come in at an off hour.
    Allan

  • Ical cleaner - to slow any faster way to remove duplicates

    it takes 3 or 4 days and seems to freeze, any beeter way to remove duplicates

    Hi,
    You could try my iCal Dupe Deleter.
    http://www.nhoj.co.uk/icaldupedeleter
    Best wishes
    John M
    <hr />As I sell software on my site and ask for donations, the Apple Discussions Use Agreement requires that I state that I may receive some form of compensation, financial or otherwise, from my recommendation or link.

  • DVD player - any faster way to Fast Forward??

    Hi
    Is there any way to fast forward in the DVD Player other than holding the fast forward button down? It only does it at 2x....
    Thanks

    Hi, Chris!
    Sure! Use ShiftCommand→ (right arrow) to accomplish this.
    You can also change the default scan rate on the controller to scan faster. From the DVD Player menubar, choose Controls>Scan Rate, and change the scan speed there. It should increase based on the limits of of the optical drive's read capability and the media being used.
    Gary

  • Any fast way to move objects in front panel?

    Hi there,
      I don't know if this is asked before. It is not a technical question but I wonder any way to move any object/control on the front panel quickly. I try to google and search in the forum but didn't see any way to do so. Sometimes, while developing complex program, too many controls used, after a control deleted and added back, it will appear in somewhere far away from the main region. I use mouse to move it back but it is so slow.
    Also, in the diagram, for a big program, moving or lining from one end to other is so slow, any way to drag one line quickly from one end to other? Thanks.
    Solved!
    Go to Solution.

    PKIM wrote:
    Hi there,
      I don't know if this is asked before. It is not a technical question but I wonder any way to move any object/control on the front panel quickly. I try to google and search in the forum but didn't see any way to do so. Sometimes, while developing complex program, too many controls used, after a control deleted and added back, it will appear in somewhere far away from the main region. I use mouse to move it back but it is so slow.
    Also, in the diagram, for a big program, moving or lining from one end to other is so slow, any way to drag one line quickly from one end to other? Thanks.
    With try and error, I just found that pressing SHIFT while moving the objects will speed it up.

  • Is there a faster way to 'write' automation?

    I have a plugin that adjusts the gain on a vocal track.
    One of the features is to automate the adjustment so that the automation can be adjusted manually afterwards for fine tuning.
    As far as I can tell, the only way for this to happen is to 'play' the whole audio all the way through with the plugin in write mode.
    Is there any faster way to get that initial automation curve created?
    Also, is there a feature to reduce the number of automation points? IE turn 100 points into 10?
    Thanks!
    - Jac

    Thanks Eriksimon! 
      I have a plugin that will create the automation, and I'd like to edit/fine tune that automation after the plugin has created the initial automation.
      I'm looking for a way for that plugin to run through the file faster than real time so I don't have to wait an hour for the first pass to be written.
      The other thing I'd like to do is,  once the automation is drawn by the plugin, I'd like to reduce the number of points it created.  In Reaper, there is a functoin to select a bunch of points and reduce them down so that say 10 points might reduce down to 3 if most of them are reasonably redundant. I'm looking for a similar function or script for Logic Pro X.
      Thanks for the reply!

  • Fast way to determine record index in large tables

    Hello,
    We're currently struggling with a bit of a problem. We have a table with about 150k records containing (amongst other things) the "score" of a user. Now we want to determine the index of said user sorted by the score (i.e. "this user is ranked 92471th").
    We need to do this quite often and simple solutions like counting the number of users with a higher score than said user is way too slow for our purpose. Are there any fast ways to do this? (preferably on SQL level, but some caching schemes that doesnt involve a big memory hit is acceptable too)

    If the score field is indexed (and is numeric) this shouldnn't take too long.
    If it is taking too long and since there won't be a better way I think your best idea is to script something that runs the queries once per x (day maybe) and caches that result in the table somewhere. So essentially the list is only updated once every so often.

  • Anyone knows fast way to do provisioning or patches management?

    Hi, I need to know ASAP , is there any faster way to do OS updates or patches management for Solaris 10 run on a Sparc machine ?
    I know there's one way doing that by using N1 System Manager
    Any answer will be great ...
    Thanks

    TLP?
    http://dk.sun.com/pdf/SPS-TLP.pdf

  • Is there any better and faster way to copy...

    can anyone teel me any better and faster way to copy...
    InputStream in = null;
              OutputStream out = null;
              try {
                   in = new FileInputStream(src);
                   out = new FileOutputStream(dest);
                   byte[] buf = new byte[1024];
                   int len;
                   while ((len = in.read(buf)) > 0) {
                        out.write(buf, 0, len);
              }catch(Exception e){
    }

    Here's a small program as a sample and for testing. Just ran a few tests with a file of 1.5 MB (buffered slightly faster) and a file of 45 MB (NIO much faster) ...
    import java.io.*;
    import java.nio.channels.*;
    public class Copy {
         public static void main(String[] args) {
              if (args.length == 3) {
                   File from = new File(args[1]);
                   File to = new File(args[2]);
                   if (from.exists()) {
                        long start = System.currentTimeMillis();
                        try {
                             if (args[0].equals("nio")) {
                                  copyNIO(from,to);
                             else {
                                  copyBuffered(from,to);
                        catch (Exception ex) {
                             ex.printStackTrace();
                        System.out.println("Time: " + (System.currentTimeMillis() - start) + " ms");
         private static void copyBuffered(File from,File to) throws IOException {
              FileInputStream fis = null;
              FileOutputStream fos = null;
              try {
                   fis = new FileInputStream(from);
                   fos = new FileOutputStream(to);
                   BufferedInputStream in = new BufferedInputStream(fis);
                   BufferedOutputStream out = new BufferedOutputStream(fos);
                   byte[] buf = new byte[8192];
                   int r = 0;
                   while ((r = in.read(buf)) > 0) {
                        out.write(buf,0,r);
              finally {
                   if (fis != null) {
                        try {
                             fis.close();
                        catch (Exception ex) {}
                   if (fos != null) {
                        try {
                             fos.close();
                        catch (Exception ex) {}
         private static void copyNIO(File from,File to) throws IOException {
                   FileInputStream fis = null;
                   FileOutputStream fos = null;
                   try {
                        fis = new FileInputStream(from);
                        fos = new FileOutputStream(to);
                        FileChannel chin = fis.getChannel();
                        FileChannel chout = fos.getChannel();
                        long size = from.length();
                        long total = 0;
                        while (total < size) {
                             total += chin.transferTo(0,size,chout);
                   finally {
                        if (fis != null) {
                             try {
                                  fis.close();
                             catch (Exception ex) {}
                        if (fos != null) {
                             try {
                                  fos.close();
                             catch (Exception ex) {}
    }

  • Blob to xml is there any other fast way without decpricated functions.

    Hi,
    1)please tel me is there any good way of getting xml from blob column or this is good? (function should not be deprecated or future it should not be discuntinue and it should be efficeant way of getting value)
    2) also tel me which csid is good defalult DBMS_LOB.DEFAULT_CSID or any other
    and storeage will be blob that i can not change.
    create or replace
    FUNCTION BLOB2CLOB(L_BLOB BLOB) RETURN CLOB IS
    L_CLOB CLOB;
    L_SRC_OFFSET NUMBER;
    L_DEST_OFFSET NUMBER;
    L_BLOB_CSID NUMBER := DBMS_LOB.DEFAULT_CSID;
    V_LANG_CONTEXT NUMBER := DBMS_LOB.DEFAULT_LANG_CTX;
    L_WARNING NUMBER;
    L_AMOUNT NUMBER;
    BEGIN
    DBMS_LOB.CREATETEMPORARY(L_CLOB, TRUE);
    L_SRC_OFFSET := 1;
    L_DEST_OFFSET := 1;
    L_AMOUNT := DBMS_LOB.GETLENGTH(L_BLOB);
    DBMS_LOB.CONVERTTOCLOB(L_CLOB,
    L_BLOB,
    L_AMOUNT,
    L_SRC_OFFSET,
    L_DEST_OFFSET,
    1,
    V_LANG_CONTEXT,
    L_WARNING);
    RETURN L_CLOB;
    END;
    '<numbers>
    <number id= "1">one</number>
    <number id= "2">two</number>
    <number id="10">ten</number>
    <number id= "6">six</number>
    </numbers>'
    above xml is in abc table col blobcol (type is blob)
    select XMLCAST(XMLQuery ('for $num in /numbers/number
    where number($num/@id) > 5
    order by number($num/@id)
    return $num/@id
    passing by value XMLPARSE(CONTENT blob2clob(BLOBCOL) returning content)
    AS VARCHAR2(100))
    from abc;
    yours sincerly.
    Edited by: 944768 on Dec 29, 2012 1:21 AM

    Well, I was talking about XMLtype (type ) and its constructors. And that has nothing to do XPath or Xquery or deprication.
    I would suggest that you always use the most appropriate datatype for storing your data, i.e. use XMLtype for XML, clob for large text and blob for binary data.
    And for the use of (depricated) Xquery or Xpath functions and operators exists another forum, XML DB

  • HT4009 I'm in Subscription **** on the iPad.  Is there an App or faster way to determine current Magazine subscriptions?

    How can I easily be sure I don't already have a magazine subscription or a single issue in Newsstand (or Zinio) when confronted with a purchase option. Is there an App or faster way to determine this information?  Both Newsstand and Zenio have seen fit to "hide" this data deep in another App or menu, perhaps as a marketing tool to get you to buy multiple copies of the same magazine.  I travel for a living and buy and delete digital magazine all the time.  Sometimes, I buy them and am unable to download immediately due to slow WiFi or restrictions in airports, this adds to the confusion as what I have bought, deleted, or never downloaded, especially with multiple readers.  Additionally, the App store manages current subscriptions on one menu and single purchases in another.    I love reading on the new iPad, but the management of subscriptions has been an absolute nightmare.   Is there another Newstand App that is easier to use or perhaps a Subscription Management App?     

    Take a look here:
    http://support.apple.com/kb/HT4098
    Other than looking in the various locations or doing a search for the title, I don't know of any way to easily find single-issue purchases.
    Regards.

  • Is there any other way to get Adobe Captivate help?

    Hi guys,
    is there any other way to get Adobe Captivate specific help? I've posted a question twice with no help, it's very specific, so no one here might actually know the solution. I'm wondering though, since the chat is obviously not for Captivate users with product or service questions.
    Is there a tech team I can somehow contact? We really need an answer to the problem.
    Thanks,
    Nat
    P.S. I'll post the problem again here:
    We publish mp4 training videos as HTML5 content and have the problem that we need to restrict the player to only play/pause.
    Adobe Captivate 7 works fantastic for us on almost all devices, many Androids, many browsers, and even on iPad. Captivate, after adding the video as a multi-slide video to one slide and publishing it as HTML5 content, only lets the student play and pause the video - just what we need.
    But then we test it on iPhone and the iPhone's internal quicktime player recognizes the mp4 video and kicks in, gives the student all the functions they want, totally overrides the HTML5 published Captivate restricted playback options.
    Is there ANY way we can get around that? Any function or box we haven't checked before publishing the HTML5 content?
    We would even be happy, if the video wouldn't play on iPhone - just as long as they can't use it to fast forward to the end of the video.
    Does anyone here know how to bypass the internal iPhone 5 player?
    Thanks,
    Nat

    By the way, I have updated to the newest Captivate 7 version and am using iOS version 7.0.4.
    Again, it's fine on iPad, but not on iPhone 5.

  • Is there any better way for updating table other than this?

    Hi all, I need to update a row in the table that require me to search for it first (the table will have more than hundred thousands of row). Now, I am using a LOV that will return the primary key of the row and put that primary key to DEFAULT_WHERE property in the block and execute query command to fetch the row that need updating. This works fine except that it require 2-query-trip per update (the lov and the execute_query). Is there any better way to doing this? This update is the main objective for my application and I need to use the most effective way to do it since we need to update many records per hour.

    Thanks Rama, I will try your method. Others, how to query row instead of primary key? I thought that querying primary key is faster due to the index?
    BTW, what people do if you need to update a table using Form? I have been using the LOV then execute query since I first developing form. But I am building a bigger database recently that I start worrying about multiple query trip to dbms.
    FYI my table will have up to million rows on it. Each row will be very active (updated) within 1-2 weeks after it creation. After that it will exist for records purposes only (select only). The active rows are probably less than 1% of all the rows.

  • Update JTable model col through header name in fast way

    old day, i update my JTable model through the way :
    tableModel.setValueAt(aValue, rowIndex, jTable1.getColumn("HeaderName").getModelIndex());now, i am adding a feature to my table, where the user can remove column.
    when user remove the column, is just the JTable GUI column being removed,. the underlining TableModel column is still there.
    my new feature will broke my above code.
    hence, i change my code to :
    for(columnIndex=0; columnIndex<columnCount; columnIndex++) {
         String name = tableModel.getColumnName(columnIndex)
         if(name.equals("HeaderName"))
              tableModel.setValueAt(aValue, rowIndex, columnIndex)
    }instead of looping through, is there any way i can retrieve the column model index in a fast way?
    a way i can think off, is inherit from DefaultTableModel, and add a map member, so that it can directly map the header name to col index.
    is there any better way?
    thanks

    i don't know why but the KeyListener does work fine with another application that i have also created Not a good solution. First of all the column still exists, so the user will tab from one column to your "hidden" column and wonder whats happening.
    The correct solution is to remove the TableColumn from the TableColumnModel. You can still access the data in the TableModel:
    table.getModel().getValueAt(...)
    No need to use the convertColumnIndexToModel.

Maybe you are looking for

  • Samsung Solid SGH-M110 can't pair

    I've tried adding my Samsung Solid using the Bluetooth Setup Assistant. It can see it and it generates a passkey but the phone doesn't request the passkey so the connection attempt fails. I've used the same phone with the same Bluetooth dongle (Belki

  • File is gone, but can't get rid of title in iTunes

    I downloaded a podcast but lost the file. The title however is still in my smart playlist. I cannot delete the title. Tried killing the smart playlist and re-creating, but title is still there.

  • Where do i modify the email language.... " Sent from my verizon yadada" on my note 4???

    Where do i modify the generic " sent from my Verizon yadadada language" ????

  • UWL substitution

    Hi all! I know there have been some similar questions in this forum earlier, but I didn't find the answer I was looking for so here goes... Is it possible to set up some kind of filter such that when a manager searches for a person to be set as subst

  • Opened itunes, all my music but bought from store is gone. Help!

    I've used Itunes since my old click wheel ipod, haven't connected my ipod to the computer in over a month (still haven't), basically use the program to listen to music while messing around on the computer. Opened it today and all of my music, movies,