Best way to loop through multiple rows to search for a count result

I have a script where I'm trying to find a Rollup row without any children. I have created a SQL statement to do this, but I can only input one point at a time. If the count is greater than 0 then i'm good to go. If the count is 0 then I want to know about it.
select count (*) from (Select * From ESSBASE_FCS.Ham
where hier_pt like (Select substr(hier_pt, 1,8)||'%' as hcy_pt
From ESSBASE_FCS.Ham
Where Hier_Pt = '412375....')
And Cctr_Or_Rollup 'Rollup')
What is the best way to develop a SQL script that searches through all my Hier_pt's and return everything with a count of 0, instead of manually inputing each hier_pt at a time?
Thanks for any help.

Hi,
Please read SQL and PL/SQL FAQ
Please provide table structure, sample data and expected output.
Additionally when you put some code please enclose it between two lines starting with {noformat}{noformat}
i.e.:
{noformat}{noformat}
SELECT ...
{noformat}{noformat}
I noticed also that you have posted the same question here: {message:id=10678000}
If you move your question to another forum please mark the previous question as answered.
Regards.
Al
Edited by: Alberto Faenza on Nov 7, 2012 5:03 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Similar Messages

  • Best way to iterate through multiple variables?

    I need to iterate through three different variables (arrays), and was wondering what the best way to do this would be? I am more familiar with C than I am with LabVIEW at this point, but am getting up to speed on LabVIEW pretty quickly. Normally in C, I would just create three nested loops, but I am wondering if this is the best method in LabVIEW or not. I could use a state machine I think, which would give me some flexibility in re-arranging the order of iteration or adding or subtracting variables easier than working with nested loops I think...anyway, I'm open to suggestions.

    R.Gibson wrote:
    I need to iterate through three different variables (arrays), and was wondering what the best way to do this would be?
    Arrays are not "variables". can you be a bit more specific.
    R.Gibson wrote:
    I could use a state machine I think, which would give me some flexibility in re-arranging the order of iteration or adding or subtracting variables easier than working with nested loops.
     Why does the order matter? Rearranging in what way? If you do autoindexing, it will just iterate over all elements until it runs out of elements.
    ... And again, what do you mean by "variables"?
    It would help if you could show us a VI containing some typical input data in controls (make current value default, save) and explain what kind of output you expect.
    LabVIEW Champion . Do more with less code and in less time .

  • What is the best way to loop through TextFlow to find InlineGraphicElements?

    I have created a TextFlow and the images load fine, but I would like to loop through and update all the 'source' properties to change the images.  What is the best way to locate all the InlineGraphicElements in my TextFlow?
    Thanks!

    leaf = textflow.getFirstLeaf();
    while( (leaf = leaf.getNextLeaf()) != null)
    if(leaf is InlineGraphicElement)

  • Looping through a string to search for a number?

    I've been trying to use substr to loop through some text in a textfield I have cast as number.  Although there is a problem with this, substr only goes through strings so if I type something as a number, it wont loop through t.  Is there a similar function to loop through numbers?

    use the string methods to find what you're looking for.  you can cast as a number when you've finished using the string methods.
    or, you can use the regular expression class.

  • Fastest way to loop through a group of strings

    I am trying to optimize a small class that loops through an array of strings and compares to see if another string equals one of the values, for example:
    String test = "this is test5";
    String array[] = {"test1","test2","test3, test4,test5,test6,test7,test8"};
    for(int i = 0;i < array.length; i++)
    if (test.endsWith(array))
    return array[i];
    }The array that I am using holds closer to 15 values, but this loop can be hit thousands of times a day.  My  question is, are there any faster ways to loop through multiple strings than using arrays?  How do array lists or maps compare?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    sarcasteak wrote:
    The array that I am using holds closer to 15 values, but this loop can be hit thousands of times a day. 15,000 comparisons a day is nothing. The following code does 15 million String compares in 188 ms.
    public class StrCmp {
      public static void main(String... args) {
        String[] arr = {"abc", "sdfasdlfkjasldfjalsdkfj", "234l2kjala34kh", "slkfjal3490u saf",
                        "234lkjasldfhk23k4jhasf", "23l4kjsf", "alsflsdjkf", "aslkdfajsdf3h", "zzzzz",
                        "uhuhuhuhuh", "uhu2huh234234", "n234aoiuf", "234lasdhvoaih3", "zoziucvoiu", "asdflsjfl"};
        long start = System.currentTimeMillis ();
        for (int i = 0; i < 1000000; i++) {
          String str = "qqq";
          for (String str2 : arr) {
            if (str2.endsWith (str)) {
              System.out.println ("match");
        long end = System.currentTimeMillis ();
        System.out.println((end - start) + " millis");
    My question is, are there any faster ways to loop through multiple strings than using arrays? How do array lists or maps compare?Before you worry about taking something simple that works and complicating it to make it faster, make sure there's a reason to do so.
    If you do in fact need to make it faster, there are several different things you could do, but which one is best depends on a number of factors specific to your particular requirements and use cases.

  • How to loop through Multiple Excel sheets and load them into a SQL Table?

    Hi ,
    I am having 1 excel sheet with 3 worksheet.
    I have configured using For each loop container and ADO.net rowset enumerator.
    Every thing is fine, but after running my package I am getting below error
    [Excel Source [1]] Error: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER.  The AcquireConnection method call to the connection manager "Excel Connection Manager" failed with error code 0xC0202009.  There may
    be error messages posted before this with more information on why the AcquireConnection method call failed.
    Warning: SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED.  The Execution method succeeded, but the number of errors raised (5) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified
    in MaximumErrorCount. Change the MaximumErrorCount or fix the errors.
    [Connection manager "Excel Connection Manager"] Error: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005.
    An OLE DB record is available.  Source: "Microsoft Access Database Engine"  Hresult: 0x80004005  Description: "The Microsoft Access database engine cannot open or write to the file ''. It is already opened exclusively by
    another user, or you need permission to view and write its data.".
    Pleas suggest me the correct way of solving above issues.
    Thanks in advance :)
    regards,
    Vipin jha
    Thankx & regards, Vipin jha MCP

    Hi ,
    Please refer the below link for Looping multiple worksheet in a single SQL Table.
    http://www.singhvikash.in/2012/11/ssis-how-to-loop-through-multiple-excel.html
    Note:-If you using excel 2010 then you have to use EXCEL 12.0 .
    Above link explaining  step by step of Looping multiple worksheet in a single SQL Table.
    regards,
    Vipin jha
    Thankx & regards, Vipin jha MCP

  • Best way to fade out multiple tracks at the same level

    Is there a best way to fade out multiple tracks at the end of a song? I have read the manual and understand fading "A" track, but not if my song is ending and I want to fade out all tracks equally.
    I thought I could export the file as a wav or MP3 (like I would do if I was fading out an Apple loop), then bring it back in and fade the track I import it to, but wanted to know if anyone else had any tips or tricks they use.
    Thanks
    RH

    sigh...don't people search forums anymore?
    http://discussions.apple.com/thread.jspa?messageID=7042093&#7042093

  • JDev 10.1.3.4: How to properly loop through the rows of a VO?

    Hi,
    This is a newbie question. Using JDeveloper 10.1.3.4 I am trying to loop through the rows of a view object. I am sure that the VO returns the following rows in that order:
    200809
    200902
    200906If I use this code (where termsOpen is the VO instance):
    while (termsOpen.hasNext()) {
       System.out.println(termsOpen.getCurrentRow().getAttribute("Term"));
    }it proves to be an endless loop and I get "200809" printed on the console endlessly. The API says that hasNext() "does not move the current row". A book says that the pointer initially is at row 0. I wonder why it prints the first row. So the code is changed to:
    while (termsOpen.hasNext()) {
       Row currRow = termsOpen.next();
       System.out.println(currRow.getAttribute("Term"));
    }But now I get only the last two rows printed on the console, and do not get to see the first row:
    200902
    200906What's wrong?
    Thanks for helping!
    Newman

    Hi, Branislav,
    Thank you for the suggestion.
    I tried that also. When the code is
    while (termsOpen.hasNext()) {
       System.out.println(termsOpen.getCurrentRow().getAttribute("Term"));
       termsOpen.next();
    }I get only the first two rows and last row is dropped:
    200809
    200902To get all the three row, I end up using this code:
    System.out.println(termsOpen.first().getAttribute("Term"));
    while (termsOpen.hasNext()) {
       Row currRow = termsOpen.next();
       System.out.println(currRow.getAttribute("Term"));
    }But that shouldn't be the way of doing the work. If I use a block of 50 lines of code to process each row, the code will have to be written once before the while loop and another time inside the while loop.
    The book which says that the pointer starts at the row slot before the first row is found on the internet, on p.469. It makes sense to me that the pointer starts at row 0. But unfortunately the actual copy of JDev 10.1.3.4 I am using behaves otherwise.
    Newman

  • In Acrobat Professional 8, what is the best way to insert/combine multiple pdf's together in a large

    In Acrobat Professional 8, what is the best way to insert/combine multiple pdf's together in a large volume?
    We have 300 pdf reports and need to insert a 2 page cover page infront of each report. Not sure if Batch processing is best???
    Thanks for any tips.

    Probably each cover page is different too. I would probably just bite the bullet and do each individually. I would create the 2 cover pages in WORD or other word processor and print to cover.pdf. Then open a PDF and Pages>Insert Pages or the cover.pdf to the front of the open PDF and save as to the current PDF. Then repeat 299 times. Each time you would make the appropriate change to the DOC file and print a new cover.pdf file (you might want to turn off open in Acrobat for this processing in the printer properties to save time). Probably a good idea to keep a list of the files to check off what has been done (you can generate a list in DOS by Start>cmd, change the directory to your location [cd path], and do "dir >>list.txt". That will give you a list to use.). There may be an easier way, but by the time you get it figured out you might be done this way.

  • Best way to update through testing repo

    As I am finding out, there are certain limitations to pacman. I enabled the testing repo to try out xorg 1.7, and to see if this could help with my X delay at startup. I enabled the repo and installed xorg, gcc, and among other packages. My problem is, I dont want the testing repo enabled by default. So I comment out testing from my pacman.conf, and now I cannot upgrade without dependency errors.
    Should I have used the ABS to install xorg 1.7...? Now I would like to disable the testing repo and be able to still sync and upgrade as normal. Am I missing something here...? Since I upgraded all packages from the testing repo, and now all my revisions are newer, and when I disable the repo to prevent any other updates, I am now unable to upgrade normally...  So... what is the best way to upgrade through the testing repo..?
    Last edited by StanIsTheMan (2009-10-23 10:15:00)

    Allan wrote:
    You can revert all packages to versions in [core]/[extra] by using "pacman -Suu".  Otherwise, you need to wait for these to move out of [testing].
    What problems are you observing?
    I didn't necessarily want to downgrade all of the packages I upgraded through the testing repo. It was after upgrading the packages from the testing repo, and then commenting out the "testing"  in pacman.conf, and then trying a normal 'pacman -Su'. I was then receiving errors on dependencies that were not met, and was refusing an upgrade. (which i can understand, since the testing db is being ignored, and the revision numbers are different and would cause conflicts)
    I have reverted back to the earlier versions from the upgrade with a 'pacman -Suu'  Now what is the proper way to upgrade just xorg..? Should I use the ABS..? I dont want to enable the testing repo, because if I do, It wants to pull in all of the testing branch that I dont want. So really my original question is... What is the bet way, or proper way to upgrade a package from the testing branch...?
    Last edited by StanIsTheMan (2009-10-23 10:40:00)

  • Although we have iPhones and iPads, this is our first mac pc and we wanted to know the best way to set up multiple users with parental contro;s

    although we have iphones and ipads, this is our first imac and we wanted to know the best ways to set up multiple users with parental controls

    I'm assuming you have the lastet OSX version 10.9 "Mavericks." Here are some useful links from Apple I think will help:
    http://support.apple.com/kb/PH14414
    http://support.apple.com/kb/PH14099
    http://support.apple.com/kb/PH14280
    and a video:
    http://support.apple.com/kb/VI28
    I suspect you have a newer iMac than the pre-2006 models this forum covers (the forum labels are unbelieveably vague). If you can confirm that yours is newer than 2005, I can ask the Hosts to move you the the forum for current iMacs, which gets many more views.

  • I finally was successful in burning a CD of a slideshow I created in iPhoto, however, it is blurry. What is the best way to burn to a CD or DVD for clarity. Also, I realize if burned in iPhoto it will only be playable in iPhoto. Help! This is needed soon!

    I finally was successful in burning a CD of a slideshow I created in iPhoto, however, it is blurry. What is the best way to burn to a CD or DVD for clarity. Also, I realize if burned in iPhoto it will only be playable in iPhoto. Help! This is needed soon for a wedding reception!

    What version of iPhoto are you using?  How do you plan to view the slideshow at the wedding reception, on a TV screen?  If so then you will need to send the slideshow to iDVD and burn a disk from there.
    If you're in iPhoto 11 and the slideshow was created in the slideshow mode and not from an album, then go to the Share menu and select iDVD.  That will create a QT movie of the slideshow and import it into iDVD.
    In iDVD select your theme and setup the menu as you'd like.  If you want the movie to begin plahying immediately when the disk is inserted into the DVD player go into the Gallery mode and drag the movie into the Autostart  bin at the left.
    Click to view full size
    If you want the movie to loop continuously go to the Advanced menu and select Loop.
    Click to view full size
    When you're finished setting upb the iDVD project save it as a disk image via the File ➙ Save as Disk Image menu option. This will allow you to check it with DVD Player before tryingto burn to disk.  Mount the disk imnage by double clicking on it and launch DVD Player and play.  If the movie plays as you want and everything is good you can  burn to disk with Disk Utility at the slowest speed available to assure the best burn quality.  Always use top quality media:  Verbatium, Maxell or Taiyo Yuden DVD-R are the most recommended in these forums.
    OT

  • How do I add multiple rows in Numbers for iPad?

    how do I add multiple rows in Numbers for iPad?

    Hi James,
    On the iPod I can only insert what is on the clipboard but I can insert however many rows I have there. Is it working differently for you? Benjoon seemed to think that he could not do this in Numbers. He was ruling Numbers out because of it. He doesn't need to do that because of this issue.
    If I was needing to insert multiple blank rows often I might keep a table of blank rows or just some blank rows at the end of the working table that I could copy/paste. This is no different than Numbers on the Mac.
    quinn

  • What is the best way to get a tune created in GB for iPad into iMovie for iPad?

    What is the best way to get a tune created in GB for iPad into iMovie for iPad?

    Haven't done it myself, but seems like the correct workflow would be:
    From GarageBand (iOS), My Songs -> select song -> Send to iTunes
    From iMovie HD (iOS), My Project -> Insert Media -> select by song name
    I'm not sure if GB creates its own playlist for tagging exported songs in your iTunes library so selecting by name would be the next-best method.
    Have you tried this?

  • What is the best way to query planned orders or work orders for make items and identify the buy component that is short for supply and vice versa?

    What is the best way to query planned orders or work orders for make items and identify the buy component that is short for supply and vice versa?

    What is the best way to query planned orders or work orders for make items and identify the buy component that is short for supply and vice versa?

Maybe you are looking for

  • Flash builder 4.7 throwing errors for no reason - is there a fix?

    Hello, I am using FB4.7, right now on an AS project. For some reason, FB has started "locking up" on runtime errors. Meaning, if I run a code with an error, then fix the error, FB still reports an issue at that line, even if the line is blank. In the

  • Visual Studio prevents SQL 2008 Express installation on win 8.1

    I wanted to install SQL Express 2008 on my Win 8.1 desktop. It gives an error indicating that I should install Visual Studio 2008 SP1 first. I tried, but SP1 installation fails. I also tried to remove VS2008 completely but I still get the same fail w

  • Control printing from report

    Hi friends ,          i have to control the printing of a report on the condintion that if a field value is changed then printing should not happen. so i want to know how to control this behavior of a report. your hints are highly appreciated. Thanx

  • ITunes cannot open files in the "MP3 Audio File" format

    Lately I've been getting this error that iTunes can't open MP3 files. It happens when I try to double click on an MP3, however, if I click and drag the MP3 into my iTunes library it opens fine. Not a huge problem....just a nuisance. Running iTunes 10

  • Override flash player ESC function in fullscreen?

    I have a video player (using a video MC created via the library and pulling in video via NetConnect) that I have set for fullscreen using the fullscreen actionscript 2.0 code to set the stage for fullscreen. (seen below). Once the user goes full scre