Two dimensional Grouping

Hi 2 all,
I'm trying to build a report starting from two complex PL/SQL query like this(simplified):
SELECT SUM(x),SUM(y),SUM(z),Name,type,product
FROM DESC A, STORE1 B, STORE2 C, store3 D, store4 E
WHERE b.ID=c.ID(+)
AND b.ID=d.ID(+)
AND b.ID=e.ID(+)
AND a.code=b.code
AND a.product='oneproduct'(...another query with !='oneproduct')
group by b.Name,b.type
I need to have on each report page the results of the two queries grouped by type, one page for each (Name).
how can I have the content of Name field on the header/margin (as a title) and the remainder data below grouped by the same Name?
=> In the end I should have one page for each Name
thanks
Matteo

On the other hand I do recall having read somewhere
that the "new" operator
is very costly and should strictly be
avoided in loops.Not that expensive performance-wise. It could potentially suck up a lot of memory if you are creating LOTS of objects
Now for the concrete case of reading some user's
datasets from a database
and then processing them further, is it advisable
to instantiate a new user object for each row, or
where is the alternative
to be found?I think you should create an object to represent each row.
two dimensional collections (any favourites in java)I always create my own. I try to use Vectors and Hashtables exclusively, depending on my needs re: ordering and lookup. Mixing and matching these could result in Vectors of Hashtables, Vectors of Vectors, Hashtables of Vectors, and Hashtables of Hashtables.
synchronized one dimensional collections each
representing one field in a
table ? (is this really more performant than simple
classes)Doubtful - any gain that you get by avoiding the constructor call would be obviated by the overhead of iterating through multiple lists and keeping them synchronized.
a Collection of Collections (here comes the new
operator again)Same as two-dimensional collections.
I remember having seen inner classes used for the
purpose of holding just a
couple of attributes, is there some performance
advantage like "the class
loader does not have to look for the class".No advantage - the only reason to create an inner class is to prevent other classes from using those objects. The inner class still compiles to a separate class object that needs to be loaded separately.

Similar Messages

  • Please change the view in the top sites, the 6.1 upgrade has reverted back to a plane two dimensional view, which is a little plain. Can I revert back to an older version via my time capsule save?

    Please change the view in the top sites, the 6.1 upgrade has reverted back to a plain two-dimensional view, which is a little dated. Can I revert back to an older version via my time capsule save? C'mon Apple upgrades supposed to leap into the future not the past. :-(

    Please change the view in the top sites, the 6.1 upgrade has reverted back to a plain two-dimensional view, which is a little dated. Can I revert back to an older version via my time capsule save? C'mon Apple upgrades supposed to leap into the future not the past. :-(

  • Two resource groups one on each node.

    Hi I am setting up a sun cluster with two nodes and storage.
    I want to run oracle and weblogic.
    I dont want to run both on the same server as the load matters and there are two boxes which can be used.
    I am planning to setup two resource groups with logical hosts one on each box and buind oracle to one and weblogic to second logical host on the other box.
    Now my requirement is,,
    I want first box to be primary for oracle resource group and second box to be primary for weblogic resource group.
    Can you please tell me how to configure different resource groupes to start on different boxes?
    Thanks in advance for the help.
    Ramesh.

    Hi, This document talks about bonding the resources in different ways. But doesnot suggest setting dependency between resources in different resource groups.
    To make it little more clear.
    I have box1 and box2 as nodes of cluster.
    the resources are distrebuted as follows.
    -----Box 1-------------------------Box2-------
    resourcegroup1--------Resourcegroup2
    logicalresource1-------logicalresource2
    Weblogicresource-----Oracleresource
    I will configure the resources to start on different nodes on startup by providing node list in different sequence for each resource group.
    But I want to set the dependency here..the "WeblogicResource" should not start before "Oracleresource".
    Can I straightaway set the dependency as we do for resources in same group or is there any other method to do this?
    Since I donot have a ready/usable test cluster I am unable to try it before posting the question.
    Please let me know the possible solution for this.
    Message was edited by:
    Ramesh_PS1

  • How to get number of rows and columns in a two dimensional array ?

    Hello,
    What would be the simplest way to get number of rows and columns in a two dimensional array represented as integers ?
    I'm looking for another solution as For...Each loop in case of large arrays.
    Regards,
    Petri

    Hi Petri,
    See a attached txt file for obtaining two arrays with upper and lower index values
    Regards
    Ray
    Regards
    Ray Farmer
    Attachments:
    Get2DArrayIndex.txt ‏2 KB

  • Why does my iTunes show apps in two different groups?

    When I open my iTunes 10 and look at the Apps tab, it shows my iPhone and iPad apps distributed amongst two different groups: iPhone, iPod Touch and iPad Apps and iPhone and iPod Touch apps.  I don't really understand this as I don't have a iPad.  An I only loaded a few apps to my iPod Touch years ago.  Seems to me that the Listing should be showing apps sorted by the "Authorized Devices" to which they have been installed.
    Another complication is that I have two Apple Store accounts...my US account from when I bought my first iPod Touch while living in the US and then a Thai account since I am living in Thailand and it makes payment easier.  Isn't there a way to see the apps loaded into my Library sorted by Apple Store account??
    Apple software is becoming more and more like the Microsoft products we all love to hate.  Sadly, ease of use for the user is out the door.  It's why I continue to use iTunes 10 and OS 10.6.8...stable and I know what I get and don't get already :-?
    Thanks for the feedback.

    You got it right.  Thank you.

  • Can a same member be in two product group?

    hi,
    Can we plan for a member which is part of two  Product group.  Right now I see when transfer demand from Second PG,  the calculations and PIR out of first PG is getting overwritten.  My requirement is to add to existing PIR rather than overwriting it.   Is it possible?
    regards
    Rav

    I think you're confusing Albums and Projects.
    each time i connect my camera to the laptop, i import the photos to a new album,
    No you don't. You can't import to an Album, you import to a Project. A Project has a Box like icon. Projects are a reflection of the organisation if the originals on the HD. Move a shot from one project to another and the file moves too. You cannot have a photo in more than one project +without duplicating the file+.
    Albums, on the other hand, have an icon like a Blue Book. You can have Albums that refer within a single project and Albums that refer all over the Library. Create an album (File -> New -> Album) and drag the images you want to it. The Files remain in their respective projects and are simply linked to the Album. Photos can be in 100's of Albums with no duplication.
    I have previously created an album called 'the best shots of 2010',i now want to add some photos to this album
    Use ratings and a Smart Album and do this automatically.
    Regards
    TD

  • Create a two dimensional table in Acess

    Hi,
    I am working with a database and the toolkit "the database connectivity tooset". I know how to create a new table from labview, but is it possible to create a "two dimensional" table from labview, i.e, where one table in Microsoft Access is linked to another one. I know how to do it in access, but it should be possible in program to crate a new table and this one has to be linked to another one then, just like the others. Does someone know how to do it??
    Thank you!

    Hi
    I assume you are not so familiar with databases, are you?
    First I want to comment your previous post:
    well I have a table for a product that contains, say different data for the product, i.e. the date of the test, who is responsible for the test, where it was performed. Also, linked to the date (I guess it is the primary key), there are also some data related. so in my table in the database, next to the date, there is a "+"-sign, so I can open up the page of all the data related to the date.
    Well, did you create this database on your own? So you must have created two tables (table one with fields Datum, Responsible & Cost and table two with fields Place1, Place2, Place3 & Place4). Then you must have dragged on field from one table to another field in the other table in the "Relations" view of access. Doing so, you created a relation. Due to this, access now knows how this date is related and displays the "+"-sign. You can not assume that the date is the primary key.
    In fact you do not have a "2D" table, but just different datasets from two tables connected to each other. This connection is created by relations.
    So, if I know would like to create a new table in my program (each product has its own table, so a new product=a new table), I would also like to create this "data" sheet that is connected to the data. Bu how do I do that?
    I can easily just create a new table (i.e. a new product), just using the "DB Tools Create Table.vi". But I guess it is when I actually want to add the data to the database, where I create the "data" sheet? Using the "DB Tools Execute Query" and a SQL statement with INSERT INTO, is that the way to go?
    As mentioned before, this "datasheet" is just a dataset from a second table which is made displayable by the relation. So if you're question is "how to create a relation using LV", you are quite on the right way. First create two tables one of which has to contain a field where the primary key from the other table is linked to. Then you have to set a PK in one table (using SQL statements) and then build the relation (also using SQL statements). I can't tell you, if you have to define the foreign key in the second table too.
    Have a look at the MS-Access help on how to assign relations and how to define primary keys. There may be something to take care off. Basically standard SQL should do - but using MS you never know .
    As this is somehow complicated, I always create the database structure in MS Access and that's it - afterwards all is done programatically (write and read data). Usually I don't open the database again with Access unless there is a special task.
    Hope this helps you a little bit otherwise come and ask again.
    Thomas
    Using LV8.0
    Don't be afraid to rate a good answer...

  • Processing a Two-Step Group in parts

    Dear all,
    I am processing my Two step group with LT0e and would like to process it partially.
    Is there a way to do that?
    Some background: When Picking from one of the Storage Types I want to use a Return Storage Type. Since this applies to one Outbound flow only, I have defined the Return Storage Type in my WM movement, NOT in the Pick Storage Type.
    In 2-step customizing, I have omitted the movement type, and am entering the Movement Type myself in LT0e. Only thing, I want to be able to make some kind of selection here so with my Movement Type I process only those items from the One Storage Type I am focussing on.
    To much info?
    Again, thank you for your time.
    Sandeep

    In LT0E once you have selected your group and via subsequent function do the picking step(2step picking -> start picking), you should be able to make the lines which you dont require "Inactive". Then you have only those lines for which you want to do the picking with your required movement type.
    Sandeepan

  • Risks of two development groups in the same system

    Hi,
    I need your help.
    I'm looking for a document about the risks having two development groups in the same system.
    The point is: An external party will come soon and start the implementation of a mini H2R in the same system as we (the internal team) are working for SD, MM, CO,... As the developments are cross-client, I'm asked to write a document explaining the risks in such cases like:
    conflicts: working on the same objects
    authorisations: each group should be assigned to different packages
    planning: the go-live should be at the same time
    transports: there can be conflicts on a transport-level
    If you have any documentation that can help me, please let me know.
    Kind regards, Gilles.

    I hope this is not considered a link farm:
    Potential conflicts between already released transports:
    Program to validate transport sequence
    Uwe Schieferstein's blog on "Dangerous Liaisons in User-Exits and How to Avoid Them":
    /people/uwe.schieferstein/blog/2008/11/11/dangerous-liaisons-in-user-exits-and-how-to-avoid-them
    Just two of many things to observe...
    Thomas

  • How to copy data in text file into two-dimensional arrays?

    Greeting. Can somebody teach me how to copy the input file into two-dimensional arrays? I'm stuck in making a matrix with number ROWS and COLUMNS according to the data in "input.txt"
    import java.io.*;
    import java.util.*;
    public class array
        public static void main (String[] args) throws FileNotFoundException
        { Scanner sc = new Scanner (new FileReader("input.txt"));
            PrintWriter outfile = new PrintWriter("output.txt");
        int[][]matrix = new int[ROWS][COLUMNS];
    }my input.txt :
    a,b,c
    2,2,1
    1,1,1
    2,2,1
    3,3,1
    4,4,1
    5,5,1
    1,6,2
    2,7,2
    3,8,2
    4,9,2
    5,10,2

    import java.io.*;
    import java.util.*;
    public class array {
        public static void main(String[] args) throws IOException {
            FileInputStream in = null;
            FileOutputStream out = null;
    try {
        in = new FileInputStream("input.txt");
        BufferedReader reader = new BufferedReader(new InputStreamReader(in));
        String line = null;
        while ((line = reader.readLine()) != null) {
            String split[]=line.split(",");
    catch (IOException x) {
        System.err.println(x);
    } finally {
        if (in != null) in.close();
    }}}What after this?

  • How to use two dimensional array in custom.pll

    HI
    How to use two dimensional arrays in custom.pll
    I tried by the following way .
    type ship_array is table of number index by binary_integer;
    type vc_array is table of ship_array index by binary_integer;
    But I am getting the error as that
    A plsql table may not contain a table or a record with composite fields.
    Please tell me the way how to use them

    which forms version are you using? two dimensional arrays are available in >= 9i if memory serves.
    regards

  • How can I put a contact in two different groups?

    How can I put a contact in two different groups.  I downloaded Glite and have developed many groups, but I have some contacts that I would like to include in two different groups.  Any solutions?

    If I want to copy a contactl to another address-book I simly hold down the ctrl-key when I drag and drop

  • Variable number of two dimensional arrays into one big array

    I have a variable number of two dimensional arrays.
    The first dimension is variable, the second dimension is always 7.
    i.e.:
    Object[][] array0 = {
    {"tim", "sanchez", 34, 175.5, "bla", "blub", "[email protected]"},
    {"alice", "smith", 42, 160.0, "la", "bub", "[email protected]"},
    Object[][] array1 = {
    {"john", "sdfs", 34, 15.5, "a", "bl", "[email protected]"},
    {"joe", "smith", 42, 16.0, "a", "bub", "[email protected]"},
    Object[][] arrayi = ...I'm generating these arrays with a for-loop:
         for (int i = 0; i < filter.length; i++) {
              MyClass c = new MyClass(filter);
              //data = c.getData();
    Where "filter" is another array which is filled with information that tells "MyClass" how to fill the arrays.
    "getData()" gives back one of the i number of arrays.
    Now I just need to have everything in one big two dimensional array.
    i.e.:Object[][] arrayComplete = {
    {"tim", "sanchez", 34, 175.5, "bla", "blub", "[email protected]"},
    {"alice", "smith", 42, 160.0, "la", "bub", "[email protected]"},
    {"john", "sdfs", 34, 15.5, "a", "bl", "[email protected]"},
    {"joe", "smith", 42, 16.0, "a", "bub", "[email protected]"},
    Any idea on how to accomplish this? It's blowing my mind right now.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Just brainstorming here:
    Why not put your actual data in a class and store that in a LinkedList (so you know the total number of elements for your multi-dimensional array). Then initalize your multi-dimensional array and populate it? Haven't tested the following, but thinking something along the lines of
    public class MyData {
         //data here
         public Object[] toArray() {
              //something similar to this
              return new Object[] = {"tim", "sanchez", 34, 175.5, "bla", "blub", "[email protected]"};
    LinkedList<MyData> data = new LinkedList<MyData>();
    data.add(mydata1);
    //however many times you need
    Object[][] arrayComplete = new Object[data.size()][7];
    for(int i = 0; i < data.size(); i++) {
         arrayComplete[i] = data.removeFirst().toArray();
    }Another option for knowing how many rows you would need might be using something like:
    int rows = 0;
    rows += array1.length;
    rows += array2.length;
    //etc...But is not entirely useful if you don't know how many variable arrays you have (although reflections might help if the name of the array variable is incremented systematically, someone told me earlier to avoid reflections since it could make debugging a LOT more difficult).
    Edited by: bogdana on Apr 1, 2010 10:38 AM

  • Retrieving  two dimensional arrays from a text file.

    Good evening
    I am having a problem with reading a text file, and putting this info into a 2D array to be put into a table.
    I have the table already(but no code to add rows to the table incase the array increases)
    The array is called Product[a][ b ]
    where a is the product number(the row), and b are details about this product.
    The file i want to be read looks like this:
    data.txt
    CPU|AMD|X2, 64bit, 2GHz|$150|9
    Video card|NVidia|7800 GTX 256MB|$400|4
    e.g. product[2][4] would equal 4
    Basically: Type, manufacturer, specifications, price, amount in stock.
    the "splitter" or "field terminator" is "|"
    This is what i want it to do:
    Store fileline into single string,
    split string and put it in product[ j ][ i ]
    repeat with next lines until nothing is read anymore.
    This is the code I have so far:
    try{
            FileReader textFileReader = new FileReader("C://BACKUP2//data.txt");
            BufferedReader textReader = new BufferedReader(textFileReader);
            for(int j=0; j<0; j++){
                 for(int i=0; i<6; i++){ //i starts at 0, condition: i is under 6, 1 is added to i at each loop/update.             
                       ProductT = textReader.readLine();
                       textReader.close();
                       for(String Product[j] : ProductT.split("|")){ //this line is completly wrong, but i don't know how else to do it.
         // for counting for the number of columns
    catch (IOException e) {System.out.println(e);}
    I don't even think this code makes any bloody sense, I don't know if I'm approaching it correctly.
    Would anyone be gracious enough to give me a helping hand and tell me what/how to change my code?
    from what I see, the problem lies less in the loops, but more in the splitting of the string. no function seems to like 2D arrays :(

    So this is where I stand:
         //Reading
        try{
            FileReader textFileReader = new FileReader("C://BACKUP2//data.txt");
            BufferedReader textReader = new BufferedReader(textFileReader);
            for(int j=0; j>0; j++){ // this will go on forever now or what?
    // yes, this will loop forever, which is fine as long as you break out of the loop when you reach the end of the file (which is indicated by textReader.readLine() returning null)
                 // replace the for(String currentField : ProductT.split("|")) loop with this one
                 //for(int i=0; i<6; i++){ //i starts at 0, condition: i is under 6, 1 is added to i at update.       
                      String inputline = textReader.readLine();    // read a single line from the file each time through the loop
                      //while (inputline != null) {
                            if (inputline != null) {    // check if the end of the file has been reached
                           //ProductT = textReader.readLine(); //put to single string
                       //textReader.close(); //shut it off    // move this line to the end of processing, you don't want to close the file until you've read everything from it.
                       //for(String currentField : ProductT.split("|")){   //Split string...      according to JBuilder "The local variable currentField is never read"
                             // switch this loop to use the regular for(  ;  ;  ) type, that way you will have another counter to use as the second index in the product assignment
                                         //currentField = Product[j];
                        product[i][] = currentField; // use the index of the second loop as the second index here
    else {
    break; // break out of the loop when end of file is reached
         //} // the for i etc. end here
    } // End for j et cetera...
         } //end Try
    catch (IOException e) {System.out.println(e);}
    //cut the crap
    // close the reader here
    ok - so I am not quite sure about what you mean here
    "Assign each of the 5 fields to the five [][j]
    positions of the array. "
    should i put 5 "fors" in there? - currently the
    program is compiling - although they do not appear in
    the table.I put comments in the code that should answer those questions.
    The code for the table is
    Object[][] data = {
              {Product[0][0], Product[0][1],
                   Product[0][2], Product[0][3], Product[0][4]},
                   {Product[1][0], Product[1][1],
    Product[1][2], Product[1][3],
    uct[1][3], Product[1][4]},
                          {Product[2][0], Product[2][1],
    Product[2][2], Product[2][3],
    ct[2][3], Product[2][4]},
                              {Product[3][0], Product[3][1],
    Product[3][2],
    Product[3][2], Product[3][3], Product[3][4]},
                    {Product[4][0], Product[4][1],
    Product[4][2],
    Product[4][2], Product[4][3], Product[4][4]},
    ;If I do not declare any of these strings (e.g. I have
    only declared Product[0-2][] oldschol style) an error
    occurs, telling me that
    Caused by:
    java.lang.ArrayIndexOutOfBoundsException: 3
         at data.<init>(data.java:112)
         ... 5 more
    When you declare product, you'll need to give it a size for both dimensions. The first dimension will be the number of lines to be read from the file. You'll need to know this before allocating the array, so either count them in the file, (if that's good enough for this assignment) or loop through the file once before reading it to count the lines. The second dimension of the array will be 5, since that's how many fields each line has.
    btw; do I give those duke stars when all problems of
    my life(currently: reading the two dimensional
    string) have been resolved?I don't know about [i]all the problems of your life, but when the topic of the thread has been solved, then give them to whoever helped. :)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Formatting a two-dimensional list...

    Is there a way to create a two-dimensional ArrayList of Integers with all cells containing certain values, for example zeros? -I will be storing changing Integer values in certain x- and y-coordinates!!
    Something like:
    ArrayList<ArrayList<Integer>> list = new ArrayList<ArrayList<Integer>>();But my problem is that the .get commands cause an Exception if a cell value is not set:
    list.get(x).get(y) and list.get(x).set(y,int)How could I get around the "null" values without Exceptions? Would you first replace the null values with zeros? (Or is there some other way to store such information?)

    If you want to a fill a List up with values, use java.util.Collections.fill().
    But do you really want it full of some kind of value, or do you just want to indicate "no value filled in" for a bunch of positions in the grid? What percentage of positions will not be filled in, or will be filled in with the default?
    Here's a simple sparse grid:
    public class Pair {
      final int x;
      final int y;
      public boolean equals(Object o) {
        Pair p = (Pair) o;
        return p.x == x && p.y == y;
      public int hashcode() {
        return x + y;
    public class SparseGrid {
      private Map<Pair, Integer> grid = new HashMap<Pair, Integer>();
      public Integer get(Pair p) {
        Integer i = grid.get(p);
        if (i == null)
          return 42; // the default.  or just skip this test if you don't want a default
        return i;
      // also a put method, left as exercise
    }That's all untested.

Maybe you are looking for

  • Which table stored the Inbound ASN IDOC # and corresponding In.B Delivery#

    Hi, May i know which table stored the inbound ASN IDOC# and corresponding created Inbound Delivery number?? Thanks!!

  • Mail not synchronising

    I am viewing my email through Apples Mail client and messages I makr as read or I delete from the client do not delete from my email provider. I am using Outlook.com, and the mail between Apple's client and Outlook.com is not matching.

  • MySQL conversion: can't connect to mysql server

    Hi all, I've downloaded the latest migration workbench with the mysql plugin. After I've choosen the source database, I don't get a connection to the source database. The hourglass stays visible for about an hour, no message is shown. The error.log f

  • Images disappearing from Camera Roll?

    I have recently bought an Iphone 4 and immediately upgraded to iOS 4.02. The other day I discovered that all of a sudden I can not see any of the pictures taken with the camera. In the Camera Roll I see the thumbnails. When I try to see the pictures

  • Complete PA transfer structure FI

    Complete PA transfer structure FI Message no. KF018 Diagnosis Hi guru, Cost element 410122 is not assigned to a value field in PA transfer structure FI. Procedure When you post directly to a profitability segment, PA transfer structure FI is necessar