Creating a dynamic Integer Array

Hi there.
This may seem trivial, but how do I create a dynamic array to store integers?
I tried Integer integerArray [] = new Integer (); but i get Cannot Resolve Symbol Error.
I am using Java 1.4.2 version.
Any suggestions would be helpful. Thanks

Doesnt an ArrayList store values as
String? Even if i did use Integer.parseInt to cast to
Integer from String doesnt it become tricky if i have
to do much calculations?Hi,
An ArrrayList can store any object you wish not just String. All you need to specify when retrieving an object is the type of object you want.
For example, if you have an ArrayList of integers an you want to retrieve an integer from the list you would use:-
int myInt = (int)myArrayList.get(myIndex);Therefore if you want to store an arbitrary object foo in an ArrayList the code is thus:-
//replace foo with the object you are storing.
foo foobar = (foo)myArrayList.get(myIndex);There is a slight change with ArrayLists in Java 5 where you should declare the objects that should be stored in the list but hopefully the above helps you to understand that an ArrayList or any other Collection as it happens can store objects of your choosing.
Regards,
Chris

Similar Messages

  • How do I create a dynamic 2xN array?

    Hey All,
    I've got a question that seems pretty easy in concept but for some reason I just can't quite figure it out. All I want to do is run through a matrix using for loops and if a value in that matrix is equal to the value I set (my cutoff value), I take the coordinates (the iterations of the loops) and pop them into an array, which I hope to use as a set of graphable points. So I start out by building a 2x1 1D array from the two points I get (my loop iterations again, which would represent my X and Y values), by using the Build Array VI. Now I try feeding that into another Build Array VI that has a feedback loop on it which feeds back into itself. The output from this is then sent to an Array Size VI (which is outside the loops) so that I can see just how big my 2xN array got.
    Now the good news is that I do get a 2D array as an output. The bad news is that try to get the data exactly when my cut off point occurs (ie. if(data == cutoff) ) I get no size, but if I created a range of even one lower (ie. if( (data <= cutoff) || (data >= (cutoff-1))) ) then the size of my array turn out to be 2x49152, which is the total range of my data (192*256). Now I know for a fact that not every point in my data is one less than my cutoff point (which is the maximum value in this case) as I have a meshing that shows me the values. I also thought that maybe conflicting data types might be a problem, so I converted my cutoff value from a int to a float type. No dice there either. Soooo, I figure it must be some underlying logic that I'm missing or something that LabView does differently than I expect.
    I guess my actual question is this then: Why does LabView gives me either a 0 element array or a complete array (as in ALL the data points not just the ones at the cutoff value)? Also if there is a better way to build the array than this.
    I have attached a picture of my current set up that retrieves the data points, builds the 2xN array and gets the size. If there's any other part that you may need to see, just let me know.
    Thanks,
    Phil
    [url=http://img114.imageshack.us/my.php?image=buildinganarrayjl7.jpg][img=http://img114.imageshack.us/img114/3226/buildinganarrayjl7.th.jpg][/url]
    P.S. Here's an direct link to the image if the above doesn't work: http://img114.imageshack.us/img114/3226/buildinganarrayjl7.jpg

    If I understood you correctly, you want to find the indices where the array element value matches a certain fixed value. One thing you must understand is that you must never perform equality operations on floating point values with computers. Computers operate in base 2, while you operate in base 10. It is not possible to precisely represent a floating point number using computers. This issue comes up a lot. How you choose to do the comparison depends on your numbers and what level of precision you want.
    That said there is no need to use a formula node for simple arithmetic. LabVIEW has functions to do that, and they're much faster than using a formula node. Don't try to write LabVIEW code using text-programming techniques. It won't work. I don't use Feedback Nodes because I hate them. I prefer shift registers since they're much easier to understand, and you can't accidentally flip their direction. Here's a simple implementation using shift registers. That little white plus function is a custom function to check if a floating point value is approximately equal to some value, within a specifed number of decimal places.
    Message Edited by smercurio_fc on 08-12-2008 04:59 PM
    Attachments:
    Example_VI.png ‏10 KB

  • How to crate a dynamic size array, collection

    Hi,
    Can someone point me to some tutorial on how to create a dynamic size array. Actually I have multiple cursors and on different tables and want to loop through each cursor and get some values from each cursor and put it in an array. But don't know how to create or initialize an array as I don't know the size. Is there any other way.
    Here is what I am doing I have 6 cursors on different tables, I loop through each cursor and get some specific data that I need to place at one place after looping through all the cursors which then finally needs to be inserted in one table. But before the insert I need to validate each data so want to have all the data in some array or some other place for temporary storage from it's easier to do the validate and insert rather than while looping through the cursors as there may be duplicates which I am trying to remove.
    As this procedure will be called multiple times so wanted to save the cursor data in temporary array before inserting in the final table. Looking for some faster and efficient way.
    Any help is appreciated.
    Thanks

    guest0012 wrote:
    All the 6 cursors are independent and no relation i.e. can have a join and have one sql as no relationship in tables.If there is no relation, then what are your code doing combining unrelated rows into the same GTT/array?
    Now using GTT when I do an insert how do I make sure the same data doesnot already exists. i.e. GTT will only have one column. Then create a unique index or primary key for the GTT and use that to enforce uniqueness.
    So everytime I iterate over a cursor I have to insert into GTT and then finally again have to iterate over GTT and then do an insert in the final table which maybe a performance issue Which is why using SQL will be faster and more scalable - and if PL/SQL code/logic can be used to glue these "no relationship" tables together, why can't that not be done in SQL?
    that's why i was wondering if can use any kind of array or collection as it will be a collection of numbersAnd that will reside in expensive PGA memory. Which means a limit on the size of the collection/array you can safely create without impacting server performance, or even cause a server crash by exhausting all virtual memory and causing swap space to trash.
    and finally will just iterate ovr array and use FOR ALL for insert but don't know what will be the size of the array as I only know after looping the cursors the total number of records to be stored. So wondering if how to do it through collection/array is there a way to intialize the array and keep populating it with the data with defining the size before hand.You cannot append the bulk collect of one cursor into the collection used for bulk collecting another cursor.
    Collections are automatically sized to the number of rows fetched. If you want to manually size collection, the Extend() method needs to be used, where the method's argument specifies the number of cells/locations to add to the collection.
    From what you describe about the issue you have - collections are not the correct choice. If you are going to put the different tables's data into the same collection, then you can also combine those tables's data using a single SQL projection (via a UNION for example).
    And doing the data crunching side in SQL is always superior in scalability and performance, than doing it in PL/SQL.

  • 2 parts: 1) integer array to string 2) string out to a jTextField

    I am completely new to Java and Netbeans, but I'm writing my 1st
    application that takes a "hex" character input from a jTextField,
    then converts it to an "binary" integer array. I then do a lot of bit
    manipulation, and generate a new "binary" integer array.
    String myhex = jTextField1.getText();
        int len = myhex.length();
        int[] binarray = new int[len*4];
            for (int i = 0; i < len; i++) {
               if (myhex.charAt(i) == '0'){
                  binarray[4*i]=0;
                  binarray[4*i+1]=0;
                  binarray[4*i+2]=0;
                  binarray[4*i+3]=0;
               else if (myhex.charAt(i) ==
               // repeat for '1 to 9' and 'a-f/A-F'
               // generate new integer array(s) using various bits from binarrayI realize it might not be the best way to do the
    conversion, but my input can be of arbitrary length,
    and it is my first time trying to write Java code.
    All of the above I've completed and it works...(thanks Netbeans
    for making the gui interface design a real breeze!)
    So I end up with:
    binarray[0]=0 or 1
    binarray[1]=0 or 1
    binarray[2]=0 or 1
    binarray[n]=0 or 1
    Where n can be any number from 0 to 63...
    I then manipulate the bits in binarray creating a new integer array
    and for the sake of expediency let's call it "newbinarray".
    newbinarray[0]=0 or 1
    newbinarray[1]=0 or 1
    newbinarray[2]=0 or 1
    newbinarray[n]=0 or 1
    Where n can be any number from 0 to 63...
    I first need to know how to convert this "newbinarray" integer array to a string.
    In the simplest terms if the first three elements of the array are [0][1][1],
    I want the string to be 011.
    Then I want to take this newly formed string and output it to a jTextField.
    string 011 output in JTextField as 011
    I've scoured the net, and I've seen a lot of complex answers involving
    formatting, but I'm looking for just a simple answer here so I can finish
    this application as quickly as possible.
    Thanks,
    Thorne Kontos

    Here's an example, not using NetBeans:
    import javax.swing.*;
    public class TextDemo extends JPanel
        public TextDemo()
            int[] newbinarray = {0, 1, 1};
            StringBuffer sb = new StringBuffer();
            for (int value : newbinarray)
                sb.append(value);
            String st = new String(sb);
            this.add(new JTextField(st));
        private static void createAndShowGUI()
            JFrame frame = new JFrame("TextDemo");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.add(new TextDemo());
            frame.pack();
            frame.setVisible(true);
        public static void main(String[] args)
            javax.swing.SwingUtilities.invokeLater(new Runnable()
                public void run()
                    createAndShowGUI();
    }

  • Creating a dynamic Array

    Thanks for reply.
    I want to create a dynamic array and for this I used ArrayList Collection and Vector Class. I am using JDK 1.4.1 . But , I have a problem in that. In ArrayList, I used the following code:
    ArrayList al = new ArrayList();
    while(rs.next())
    al.add(rs.getString("Enter_Year"));
    al.add(rs.getString("UG_Production_Mi_Te"));
    al.add(rs.getString("OC_Production_Mi_Te"));
    al.add(rs.getString("Total_Production_Mi_Te"));
    al.add(rs.getString("OBR_MM3"));
    al.add(rs.getString("OMS_Te"));
    al.add(rs.getString("Coal_Offtake_Mi_Te"));
    al.add(rs.getString("Supply_to_Steel_Plant_Th_Te"));
    al.add(rs.getString("Royalty_SalesTax_MP_Crs"));
    al.add(rs.getString("Royalty_SalesTax_CG_Crs"));
    al.add(rs.getString("Total_ManPower"));
    al.add(rs.getString("Fatality_Rate_per_Mi_Te_Output"));
    al.add(rs.getString("Total_Wellfare_Expenditure_Crs"));
    String rpt[][] = new String[al.size()][];
    rpt = al.toArray(rpt); // ArrayStoreExecption error
    String colheads[] = {"...........My Table's Column names are here....."};
    JTable table = new JTable(rpt,colheads);
    JScrollPane jsp = new JScrollPane(table);
    add(jsp);
    At the statement having comment line I received the error ArrayStoreException. The JTable accepts the 2 D array for storing the info and I think the toArray() method is not working there and can't convert the ArrayList elements into an Array. Similarily, Vector Class is also not converting the elements into an array object and showing the same error only.
    Please help me to convert it into an array object so that I can pass it into the JTable argument.

    That isn't a jdbc problem but rather a collection problem.
    You certainly can't convert a one dimensional collection into a two dimensional array automatically. And that is what you are creating with the while loop.
    Since you know the column names you also know the inner array size so you can start by creating a statically sized string array (not collection) in the loop and add that to the outer collection. That might solve the problem.

  • Create a 2-dim array dynamically

    Hello!
    I have had this problem here before but try one moore time :-)
    This is the thing: We have a text-file from which we read. This textfile can be different from time to time. From this textfile we can catch numbers of columns and numbers of rows that a 2-dim array should have. The problem is how one can create this 2-dim array dynamically? We have a while-loop that the program runs inside already. Must one use the while-loop to solve this problem? Or can one solve this with only a for-loop? Hope you understand how I mean :-) Best regards

    OK, I thought you want to read an array of the same size as the actual data in the file. You cannot read a 4x10 array if the file only contains data for a 3x5 array .
    Is the array size determined by the data in the file or by some other calculation?
    I would still read the entire file, then you can cut out a 2D subset using "array subset". This should not be a problem unless you have millions of array elements.
    LabVIEW Champion . Do more with less code and in less time .

  • Creating dynamic sized arrays and filling them automatically on speedy 33

    hi all,
    I am trying to create dynamic sized arrays on Speedy-33. Specifically, depending on the user input, I want to be able to create
    arrays with 128 or 256 elements and fill them automatically. However,
    array constant element is fixed for Speedy 33; thus I have to manually set the
    size of the array with the mouse and enter the values in to the array by
    myself. I want to make this tedious process automatic. Would this be possible? thanks so much for comments!
    ~casiopea

    Casiopea,
    There is a really great article on using arrays with LabVIEW DSC which can be found here:
    How Can I Be Successful With Arrays In the LabVIEW DSP Module?
    One of the biggest things that should be noted about DSP is that there is no dynamic memory allocation.  Your array size must be fixed, and thus, your array needs to be initialized by using a constant. 
    An easy way to initialize an array constant that has many elements that are all the same is to simply create a numeric constant that has the value that you want.  Then, create a new blank array constant and drag the numeric into it.  In the index input for the array constant, type in the index of the last element that you want to be initialized.  Then type in the value in the element that is displayed and all of the elements before it will be initialized to the default value of the numeric constant that you dropped into the array constant.  I hope this helps.  I would really recommend reading through that article, as it has a lot of great information about using arrays with DSC.
    Brian Coalson
    Software Engineer
    National Instruments

  • Creating a dynamic array in Actionscript

    I am wondering how I would create a dynamic array in Acionscript, i.e. one that utilizes fields for mapping data like this:
    public var SMITH:Array = [
               {date:"29-Aug-05", close:45.87, profit:52},
               {date:"23-Aug-05", close:45.74, profit:32},
               {date:"21-Aug-05", close:45.77, profit:22},
               {date:"25-Aug-05", close:46.06, profit:51},
    but where you would just be reading in data without knowing what your data looks like.  In other words, I'd like to take something like a database table with X number of columns and have Actionsctipt map each row to an item in my array.  Something like this:
    for each row in table
    add {col1:value, col2:value, col3:value, ... colX:value} to Array
    So I won't know "date" or "close" or whatever at runtime, I'll just have X number of items for each element in the array. How would this be done?
    The reason I need this mapping feature is because I then want to map the table-like array as the data provider to charts, datagrids, etc.
    Thanks.

    If this post answers your question or helps, please mark it as such.
    You can download the lib for JSON in Flex here:
    http://code.google.com/p/as3corelib/downloads/list
    These pages describe using JSON and Flex, and databases:
    http://www.switchonthecode.com/tutorials/flex-php-tutorial-transmitting-data-using-json
    http://www.switchonthecode.com/tutorials/using-flex-php-and-json-to-modify-a-mysql-databas e
    http://www.switchonthecode.com/tutorials/flex-php-json-mysql-advanced-updating
    http://www.mikechambers.com/blog/2006/03/28/tutorial-using-json-with-flex-2-and-actionscri pt-3/

  • How to create and destroy dynamically an array

    How to create an array of container dynamically and destroy it. I have an array of container which is to be sorted by comparision, but in sorting out the elements i want to delete some of the elements based on comparision.I run a for loop based on the number of elements in the array to be sorted. So what i do is take the elements into another array which i want to create it dynamically and reassign the new array back to the old one after sorting and delete it.

    Hi kpraveen,
    Maybe this thread helps,
    http://forums.ni.com/ni/board/message?board.id=330&message.id=18421&query.id=288653#M18421
    Greetings
    Juergen
    =s=i=g=n=a=t=u=r=e= Click on the Kudos button (Gold Star) and see what happens =s=i=g=n=a=t=u=r=e=
    =s=i=g=n=a=t=u=r=e= Click on the Star and see what happens :-) =s=i=g=n=a=t=u=r=e=

  • Create a dynamic attribute for each user

    Hi All,
    I request you all to let me know how to give an approach to the following requirement.
    REQUIREMENT: I have to create a dynamic attribute in UME for each user and the read the attribute on lead selection of a table having list of Users.
                             On lead selection, the dynamic attribute value should be either true or false. Based on this value the rest of the application specific operations wil be taken care.
                              If a particular User does not have the dynamic attribute associated to it, then we need to create the same.
    Looking forwarrd for your help.
    Regards
    Dipendra

    //@@begin javadoc:UMSavePropertiesByNode()
         /** Declared method. */
      //@@end
      public boolean UMSavePropertiesByNode( )
        //@@begin UMSavePropertiesByNode()
              try {
                   if (wdContext.currentUserDataElement().getVaIUserMaint().setAttribute("com.sap.security.core.usermanagement", this.getUMPropertyName(null) + ".TableColumns", this.getPropertiesByNode())) {
                        wdContext.currentUserDataElement().getVaIUserMaint().save();
                        wdContext.currentUserDataElement().getVaIUserMaint().commit();
                        msg.reportMessage(IMessageTableUtilsComponent.UMPROPERTY__SAVE__FIELDS__SUCCESS, null, false);
              } catch (UMException ex) {
                   wdContext.currentUserDataElement().getVaIUserMaint().rollback();
                   msg.reportMessage(IMessageTableUtilsComponent.UMPROPERTY__SAVE__FIELDS__ERROR, null, false);
                   return false;
              return true;
        //@@end
      //@@begin javadoc:UMLoadFieldsProperties()
         /** Declared method. */
      //@@end
      public petrobras.com.br.classes.FieldsTable UMLoadFieldsProperties( petrobras.com.br.classes.FieldsTable fields )
        //@@begin UMLoadFieldsProperties()
              String properties[] = wdContext.currentUserDataElement().getVaIUserMaint().getAttribute("com.sap.security.core.usermanagement", this.getUMPropertyName(null) + ".TableColumns");
              if (Compare.getLenght(properties) > 0) {
                   //msg.reportWarning("[UMLoadFieldsProperties]: properties.length = " + properties.length);
                   for (int i = 0; i < properties.length; i++) {
                        int attrPos = Integer.parseInt(properties<i>.substring(properties<i>.indexOf("(") + 1, properties<i>.indexOf(")")));
                        String attrName = (String) properties<i>.substring(properties<i>.indexOf(")") + 1, properties<i>.indexOf("="));
                        int attrValue = Integer.parseInt(properties<i>.substring(properties<i>.indexOf("=") + 1, properties<i>.indexOf(";")));
                        Field item = fields.getField(attrName);
                        if (item != null) {
                             item.setPosition(attrPos);
                             item.setVisibility(WDVisibility.valueOf(attrValue));
                             fields.removeFieldByName(attrName);
                             fields.addField(item);
              return fields;
        //@@end
    regards,
    Angelo

  • Creating a dynamic lov based on a column

    Hi,
    I want to create a dynamic lov based on a column in a database-table.
    Eg. the query
    'select code, description from code_table'
    is the contents of the column 'lov_query' in the table 'parameters'.
    For every parameter there can be a different lov-query, but the result is always
    two columns (code and description, number and name, etc.), exactly what you need to use in a lov.
    I've written a (dbms_sql) function that takes the parameter-id and returns the lov_query.
    create or replace function "GET_PMR_LOV"
    (pmr_id in NUMBER)
    return VARCHAR2
    is
    cur INTEGER := DBMS_SQL.OPEN_CURSOR;
    fdbk INTEGER;
    l_pmr_id NUMBER(9) := pmr_id;
    l_stmnt VARCHAR2(2000);
    begin
    DBMS_SQL.PARSE
    (cur, 'select pmr.lov_query from parameters pmr where pmr.ID ' || ' = 'L_PMR_ID', DBMS_SQL.NATIVE);
    DBMS_SQL.BIND_VARIABLE (cur, 'L_PMR_ID', l_pmr_id);
    DBMS_SQL.DEFINE_COLUMN (cur, 1, l_stmnt, 2000);
    fdbk := DBMS_SQL.EXECUTE (cur);
    fdbk := DBMS_SQL.FETCH_ROWS (cur);
    IF fdbk > 0
    THEN
    DBMS_SQL.COLUMN_VALUE (cur, 1, l_stmnt);
    return (l_stmnt);
    ELSE     
    return null;
    END IF;
    DBMS_SQL.CLOSE_CURSOR (cur);
    END;
    But now I'm stuck on how to pass on this statement in HTMLDB
    as an dynamic lov, I don't seem to be able to execute this statement
    into the two display and return columns. Any ideas?

    Hello again,
    This lov is on an updatable report-column where the user has to make a choice from an non-named, popup and query-based lov. In the lov-query box I have just put:
    "return get_pmr_lov(:p41_param_id)" (without the quotes ;-)
    Here's my latest version plus an alternative, which both seem to work fine:
    create or replace function "GET_PMR_LOV"
    (pmr_id in NUMBER)
    return VARCHAR2
    is
    cur INTEGER := DBMS_SQL.OPEN_CURSOR;
    fdbk INTEGER;
    l_pmr_id NUMBER(9) := pmr_id;
    l_stmnt VARCHAR2(1000);
    begin
    DBMS_SQL.PARSE (cur, 'select pmr.lov_query from paramaters pmr where pmr.ID ' || '= :L_PMR_ID', DBMS_SQL.NATIVE);
    DBMS_SQL.BIND_VARIABLE (cur, 'L_PMR_ID', l_pmr_id);
    DBMS_SQL.DEFINE_COLUMN (cur, 1, l_stmnt, 1000);
    fdbk := DBMS_SQL.EXECUTE (cur);
    fdbk := DBMS_SQL.FETCH_ROWS (cur);
    IF fdbk > 0 THEN
    DBMS_SQL.COLUMN_VALUE (cur, 1, l_stmnt);
    return (l_stmnt);
    ELSE
    return null;
    END IF;
    DBMS_SQL.CLOSE_CURSOR (cur);
    END;
    create or replace function "GET_PMR_LOV2"
    (pmr_id in NUMBER)
    return VARCHAR2
    is
    l_pmr_id NUMBER(9) := pmr_id;
    l_stmnt VARCHAR2(1000);
    BEGIN
    EXECUTE IMMEDIATE 'select pmr.lov_query from parameters pmr where pmr.ID = :1'
    INTO l_stmnt USING l_pmr_id;
    return l_stmnt;
    END;
    The error-message remains the same, unable to bind :p41_param_id !

  • Can I create a dynamic number of inputs during runtime?

    Can I create a dynamic number of inputs during runtime?
    Oracle 11g
    Application Express 4.0.2.00.06
    Here is my problem:
    We have a table that holds metadata about files (hardcopy or softcopy files).
    We expect we may need more columns in the table at some point and don't want to modify the table or the application.
    So in order to do this I would like to create:
    A table called TBL_FILE with the columns:
    TBL_FILE_ID               NUMBER                (This will be the primary key)
    TBL_FILE_NAME          VARCHAR2(1000) (This will be the name of the file)
    A second table will be called TBL_FILE_META with the columns:
    TBL_META_ID               NUMBER               (This will be the primary key)
    TBL_FILE_ID               NUMBER                (This will be the forign key to the file table)
    TBL_META_COLUMN     VARCHAR2(30)     (This is what the column name would be if it existed in TBL_FILE)
    TBL_META_VALUE          VARCHAR2(1000) (This is the value that record and the 'would be' column)
    So a person can have as much meta data on the file with out having to add columns to the table.
    The problem is how can I allow users to add as much data as they like with out having to re develop the page.
    Other things to note is that we would like this to be on a single page.
    I know how to add we can create multi-row inserts by using a SQL Query (updateable report),
    however the TBL_META_VALUE column in the TBL_FILE_META will sometimes be a select list and other times a text box or number field.
    So I don't see now a SQL Query (updateable report) would work for this and I can't create an array of page items at run time can I?
    Any idea's how I could accomplish this? Is there a better way of doing this?
    Also is there a term or a name for what I am doing by creating these 'virtual' columns in another table?
    I found this method when looking at Oracles Workflow tables.

    Welcome to the Oracle Forums !
    >
    Can I create a dynamic number of inputs during runtime?
    Oracle 11g
    Application Express 4.0.2.00.06
    Here is my problem:
    We have a table that holds metadata about files (hardcopy or softcopy files).
    We expect we may need more columns in the table at some point and don't want to modify the table or the application.
    So in order to do this I would like to create:
    A table called TBL_FILE with the columns:
    TBL_FILE_ID NUMBER (This will be the primary key)
    TBL_FILE_NAME VARCHAR2(1000) (This will be the name of the file)
    A second table will be called TBL_FILE_META with the columns:
    TBL_META_ID NUMBER (This will be the primary key)
    TBL_FILE_ID NUMBER (This will be the forign key to the file table)
    TBL_META_COLUMN VARCHAR2(30) (This is what the column name would be if it existed in TBL_FILE)
    TBL_META_VALUE VARCHAR2(1000) (This is the value that record and the 'would be' column)
    So a person can have as much meta data on the file with out having to add columns to the table.
    The problem is how can I allow users to add as much data as they like with out having to re develop the page.
    >
    Creating Page Items dynamically is not available. You will have to create excess items and hide/show , etc. But you cannot change the Item Type. All in all, too many limitations in this approach.
    >
    Other things to note is that we would like this to be on a single page.
    >
    The 100 item limit will hit you if you go with extra item on page. With Tabular Form that should not be a limitation, unless you are exceeding the 50 item limit of APEX_APPLICATION.G_Fnn items, and the 60 column limitation of Report region with "Use Generic Column Names (parse query at runtime only)" of Dynamic region.
    >
    I know how to add we can create multi-row inserts by using a SQL Query (updateable report),
    however the TBL_META_VALUE column in the TBL_FILE_META will sometimes be a select list and other times a text box or number field.
    >
    If the type if item is variable it only means you need a way to store the item type. Meta Data of the Meta Data.
    >
    So I don't see now a SQL Query (updateable report) would work for this and I can't create an array of page items at run time can I?
    >
    Yes, you can do it. Updatable report/ Tabular Form query can be constructed from the Meta Data using PL/SQL Function Returning SQL Query . It will be a bit of coding in PL/SQL where you use the Meta Data and the Meta Data of the Meta Data to piece together your SELECT with the right APEX_ITEMs. It might have a performance penalty associated with it, but will not be a serious degradation.
    >
    Any idea's how I could accomplish this? Is there a better way of doing this?
    Also is there a term or a name for what I am doing by creating these 'virtual' columns in another table?
    I found this method when looking at Oracles Workflow tables.
    >
    I guess that is just a good TNF. It is the Master-Detail Design Pattern, that sound more modern ? ;)
    Regards,

  • How to bind SelectManyChoice to Integer array parameter

    Hi.
    I am using JDev TP4. I need to populate an integer array with the keys of the items selected in a SelectManyChoice.
    I have created a page with a parameter form for the three parameters and a readonly table for the result class from a data control for this method:
    public FreeGuaranteeModel[] getFreeGuarantees(Timestamp firstDate, Timestamp lastDate, Integer[] companyIds)
    In the parameter form i have created a SelectManyChoice which displays a list
    from a viewObject by dragging the companyIds parameter onto the parameter form, creating a SelectSingle component and then converted it to a SelectManyChoice.
    The page renders ok, I can select one or more items in the list, but when I press the button to execute the method, the companyIds array is empty.
    (The two date parameters are populated).
    What am I missing? Is the binding wrong? I am new to JDev so if there is some other way to do this, please let me know.
    This is the relevant part of the jspx:
    <af:selectManyChoice value="#{bindings.companyIds.inputValue}"
              label="#{bindings.companyIds.label}"
              shortDesc="#{bindings.companyIds.hints.tooltip}"
              binding="#{backing_ViewFinancialResult.selectOneListbox1}"
              id="selectOneListbox1">
    <f:selectItems value="#{bindings.companyIds.items}"
         binding="#{backing_ViewFinancialResult.selectItems1}"
         id="selectItems1"/>
    </af:selectManyChoice>
    The pagedef contains this:
    <?xml version="1.0" encoding="UTF-8" ?>
    <pageDefinition xmlns="http://xmlns.oracle.com/adfm/uimodel"
    version="11.1.1.49.49" id="ViewFinancialResultPageDef"
    Package="com.ispartner.gvg.pageDefs">
    <parameters/>
    <executables>
    <variableIterator id="variables">
    <variable Type="java.sql.Timestamp" Name="getFreeGuarantees_firstDate"
    IsQueriable="false"/>
    <variable Type="java.sql.Timestamp" Name="getFreeGuarantees_lastDate"
    IsQueriable="false"/>
    <variable Type="java.lang.Integer[]" Name="getFreeGuarantees_companyIds"
    IsQueriable="false"/>
    </variableIterator>
    <methodIterator Binds="getFreeGuarantees.result"
    DataControl="CapacityReader" RangeSize="25"
    BeanClass="com.ispartner.gvg.util.capacity.FreeGuaranteeModel"
    id="getFreeGuaranteesIterator"
    RefreshCondition="#{adfFacesContext.postback == true}"
    Refresh="renderModelIfNeeded"/>
    <iterator Binds="CompanyLOV1" RangeSize="-1"
    DataControl="ChoiceListAMDataControl" id="CompanyLOV1Iterator"/>
    </executables>
    <bindings>
    <methodAction id="getFreeGuarantees" RequiresUpdateModel="true"
    Action="invokeMethod" MethodName="getFreeGuarantees"
    IsViewObjectMethod="false" DataControl="CapacityReader"
    InstanceName="CapacityReader.dataProvider"
    ReturnName="CapacityReader.methodResults.getFreeGuarantees_CapacityReader_dataProvider_getFreeGuarantees_result">
    <NamedData NDName="firstDate" NDType="java.sql.Timestamp"
    NDValue="${getFreeGuarantees_firstDate}"/>
    <NamedData NDName="lastDate" NDType="java.sql.Timestamp"
    NDValue="${getFreeGuarantees_lastDate}"/>
    <NamedData NDName="companyIds" NDType="java.lang.Integer[]"
    NDValue="${bindings.getFreeGuarantees_companyIds}"/>
    </methodAction>
    <attributeValues IterBinding="variables" id="firstDate">
    <AttrNames>
    <Item Value="getFreeGuarantees_firstDate"/>
    </AttrNames>
    </attributeValues>
    <attributeValues IterBinding="variables" id="lastDate">
    <AttrNames>
    <Item Value="getFreeGuarantees_lastDate"/>
    </AttrNames>
    </attributeValues>
    <tree IterBinding="getFreeGuaranteesIterator" id="FreeGuaranteeModel">
    <nodeDefinition DefName="com.ispartner.gvg.util.capacity.FreeGuaranteeModel">
    <AttrNames>
    <Item Value="companyId"/>
    <Item Value="name"/>
    <Item Value="guaranteeRequired"/>
    <Item Value="guaranteeToDate"/>
    <Item Value="guaranteeAmount"/>
    <Item Value="bookedValue"/>
    <Item Value="freeGuarantee"/>
    </AttrNames>
    </nodeDefinition>
    </tree>
    <list IterBinding="variables" id="companyIds" DTSupportsMRU="false"
    StaticList="false" ListIter="CompanyLOV1Iterator"
    NullValueFlag="start" NullValueId="companyIds_null">
    <AttrNames>
    <Item Value="getFreeGuarantees_companyIds"/>
    </AttrNames>
    <ListAttrNames>
    <Item Value="CompanyId"/>
    </ListAttrNames>
    <ListDisplayAttrNames>
    <Item Value="ShortName"/>
    </ListDisplayAttrNames>
    </list>
    </bindings>
    <ResourceBundle>
    <PropertiesBundle xmlns="http://xmlns.oracle.com/adfm/resourcebundle"
    PropertiesFile="com.ispartner.gvg.gvg-webBundle"/>
    </ResourceBundle>
    </pageDefinition>
    Regards,
    TL

    Hi,
    Thank you for your answer.
    Following the example I was able to get the selected entries into an Integer array property with accessors which I created in a managed bean.
    But I have not been able to get the values into the companyIds parameter of the method to execute.
    Is there a way to bind directly to this parameter, or do I have to collect all parameters through separate properties and then call my method manually when the button is pressed?
    TL

  • Passing a integer array  client to server

    Hi
    Is it possible to pass integer array from client to server
    Through soap.
    Basically i want to pass this array buffer
    int[] buffer = new int[(int)len];
         for(int i=0;i<len;i++){
              buffer[i] = F.read();
              System.out.print(buffer[i]+ " ");
    Nams Thanks

    Yes, if the server is written to accept one.
    To create a server to accept one, create a service endpoint
    interface that has a method that takes a int[] as a parameter and
    generate the service from that by following the steps in the jaxrpc
    tutorial. Then generate the client from the generated WSDL.

  • Creating a dynamic excel file

    Is it possible that i can create a dynamic excel file (destination)
    ex, i want to create a Dyanamic Excel destination file with a filename base on the date
    this will run on jobs. Is this possible?
    11172006.xls, 11182006.xls

    This example is useful for loading data from an OLEDB source into a dynamically created Excel file.
    NOTE:
    This is the core functionality. Things like logging, checkpointing, documentation, etc., are at the user's discretion.
    Steps:
    1. Click on package properties. Set "DelayValidation" property to True.
    The package will not validate tasks, connections, until they are executed.
    2. Create a package level variable "XLFileRootDir" as string and set it to the root
    directory where you want the excel file to be created.
    Example: C:\\Project\Data\
    3. Create an Excel connection in the connection manager. Browse to the target directory
    and select the destination XL filename or type it in. It doesn't matter if the file doesn't exist.
    4. Go to the Excel connection properties and expand the expressions ellipse (The button
    with "..." on it).
    Under the property drop down, select 'ExcelFilePath' and click on the ellipse to
    configure the expression:
    @[User::XLFileRootDir] + (DT_WSTR, 2) DATEPART("DD", GETDATE()) + (DT_WSTR, 2) DATEPART("MM", GETDATE()) + (DT_WSTR, 4) DATEPART("YYYY", GETDATE()) +".xls"
    This should create an xl file like 01132007.xls.
    5. Add a SQL task to package and double click to edit.
    In the general tab, set 'ConnectionType' to 'Excel'.
    For 'SQLStatement', enter the create table SQL to create destination table.
    For example:
    CREATE TABLE `Employee List` (
        `EmployeeId` INTEGER,
        `EmployeeName` NVARCHAR(20)
    Copy the create table command. It will come in handy later.
    6. Add a Data Flow task. In the data flow editor, add an OLEDB source and an Excel destination.
    Configure the source to select EmployeeId and EmployeeName from a table.
    7. Connect this to Excel destination. In the destination editor, select the Excel connection in the
    manager, choose 'table or view' for data access mode and for 'name of the Excel sheet' click on
    new button and paste the create table command from Step 5.
    Map the columns appropriately in the mappings tab and you are done.
    Let me know if you have any questions.
    I was able to get this to work (dynamic Excel file name with date), but I want to process multiple
    data files per day, so I must add hour and minute to the file names "..._2014.xls".  But as soon as I add the hour/min to the 'ExcelFilePath' of the Connection Manager the Excel Destination task fails because it can't find the file.
    So can you please help me how do i do this ? 
    Thank you 

Maybe you are looking for