How to reference arrays dynamically?

I have developed a sql query with a dynamic number of rows and columns. I know I can reference the rows by using a ' for i in 1..htmldb_application.g_f01(i) loop' and this is fine. I know that with a query with a standard number of columns you could reference them as htmldb_application.g_f02(i), htmldb_application.g_f03(i) and so on. However, in my case, I have a dynamic number of columns and they are in fact named f02, f03, f04 and so on. I could have 10 or I could have 15 of these. My problem is that now to get the values associated with these columns I have to dynamically determine the names of these columns through a string (ie mstring := 'htmldb_application.g_f0'||colnum||'(i)'') For each row I loop through and build this string which references each of the columns in my array. The problem is that this returns htmldb_application.g_f02(i) as the value and not the actual value of the field.
I thought I could do 'select htmldb_application.g_f02(i) from dual' and then do an execute immediate statement to return the value but this returns an error saying something to the effect that the function does not exist. So without hardcoding the actual names is there a way to reference each of these columns dynamically?

[b[In your OnLoad function try replacing:
var arrName:String = folder+"_thumbs";
with this:
var arrName:Array = new Array();
arrName = this[folder+"_thumbs"];
That should work, and remember to change the variable
declaration:
var arrImages:MovieClip = new Array();
to:
var arrImages:Array = new Array();

Similar Messages

  • How to empty array dynamically

    I am trying to build a array to store the x cursor position data. Each time, I can drage X cursor and move left or right. Then I click "add data in array", the x position is added to array. I can continue to add as many as I want when I move x cursor again and again. All those work good. I want to keep loop and sequence structure as attached VI.
    My problem is: I have difficulty to empty array dynamically. For example, I did not choose right x cursor position, I want clean/empty array just by click "CLEAN" button. I do not want event structure to do this since it cause other problems.
    Please take a look see how to make it.
    Thanks
    Attachments:
    buildArrayclean.vi ‏41 KB

    You need to feed an empty array to the shift register, not to the indicator.
    See attached, LabVIEW 8.0.
    (You don't even need an empty array constant, just use "use default if unwired" on the output tunnel. The default data for an array is an empty array.).
    Also, your outer loop is pointless. It does not do anything since it stops at the same time as the inner loop. You only need the inner loop. ... and why do you need a big sequence structure???
    Message Edited by altenbach on 04-11-2006 09:21 AM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    buildArraycleanMOD2.vi ‏44 KB

  • How to call array dynamically???

    Hi i hv 3 arrays row1 row2 row3,
    I need to call array into a for loop one by one
    var rowno:int=1
    for(i:int=1;i<10;i++){
          this['row'+rowno].push(value)<<< showing error
         rowno++
         if(rowno>=4){    
              rowno=1
    what is the right way to use array dynamically???

    for(var rowno:int=1;rowno<4;rowno++){
    for(i:int=1;i<10;i++){
          this['row'+rowno].push(value);  // assuming value is defined

  • How to reference a dynamically added field

    I'm trying to set the value of a field that was dynamically added as part of a table section and I can't figure out how.
    The table section is added by clicking on a button and that works just fine. I can access any field value in the table section that has the instance '0'. But I can't seem to figure out how to access field values from any other instances of this table section.
    Here's the hierarchy of one of the fields:
    TopmostSubform.Page4.DeveloperIdSubform.DeveloperIdentityTbl.MemberSection.Row8.dteFormedD ateDevMem
    Where 'MemberSection' is the section of rows the button will add an instance of. Now, I can access the value of the date field for the first instance of 'MemberSection' with the following:
    DeveloperIdentityTbl.MemberSection.Row8.dteFormedDateDevMem.rawValue
    If I want to do the same thing say for the 3rd instance of the 'MemberSection', how would I do that?
    Thanks for the help!!
    Marc

    Hi,
    WhyIsThisMe is correct. You must reference the instance of the repeating 'MemberSection' by its index. Otherwise (as you have found) it defaults to the 1st instance.  Sounds easy, right? Well...
    Truth be told, this will depend on the scripting language you have chosen. The actual refernce syntax used for formCalc and javaScript is considerably different.
    WhyIsThisMe's reference:
         TopmostSubform.Page4.DeveloperIdSubform.DeveloperIdentityTbl.MemberSection[2].Row8.dteFor medDateDevMem
    should work for formCalc, but it won't for javaScript. For that you would need to use resolveNode()
    var indx = 2;  // you probably will be selecting a differnt row under different circumstances, right? So, assign the index value to a variable
    or instead
    var indx = 0;
    if(condition){indx= 2;}
    else if(condition){indx= 3;}  //you get the idea
    //then you would do the assigning the value using resolveNode() by building the string that goes inside the ():
    xfa.resolveNode("TopmostSubform.Page4.DeveloperIdSubform.DeveloperIdentityTbl.MemberSectio n[" + indx + "].Row8.dteFormedDateDevMem").rawValue  
    //you're building a string in javaScript, so the + is used. There are 3 parts to the final string for the resolveNode().   finalString = "part1" + indx + "part3"
    ////////////////////////////////////////////  Still with me?  I usually opt for formCalc when referencing instances, since it is generally more forgiving
    // In formCalc, 1st assign an index value to variable.
    var indx = 0;
    if(condition)then
         indx= 2
    elseif(condition)then
         indx= 3   //you get the idea
    endif
    // then, use that variable to reference the instance of 'MemberSection'  //resolveNode() not needed in formCalc
    TopmostSubform.Page4.DeveloperIdSubform.DeveloperIdentityTbl.MemberSection[indx].Row8.dteF ormedDateDevMem
    Good luck!
    Stephen

  • 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.

  • In EPM10, how do you call/reference a dynamic range from a macro.

    Hi Gurus
    In EPM10, [we are using SP16,P1], how do you call/reference a dynamic range from a macro.
    EG, in the BPC input sheet below, we have BPC reports ‘000’,’001’,’002’. For report ‘001’,users are able to select from diffent versions which each have different number of months. In the forecast version below, there are 7 months. We require a macro to select & delete f'cast data content of report ‘002’, there after we will manipulate it via the macro and return it. However, standard excel named ranges don’t work per BPC7.x and don’t dynamically expand.
    The macro code in 7.x was:
    Range(“REPORT1_RANGE”).Select >> Does any oneknow the replacement in EPM10 please?

    The following macro which accesses API's looks like it would help to define the report range:
    Sub TopLeftCell()
    Range("c26").Select
    Application.Run "EPMExecuteAPI", "GetDataTopLeftCell", "", "Sales Planning", "001"
    End Sub
    Anybody able to assist with the syntax of this macro..it currently runs without error, however does not return any result?? Note:
    * the parameter ''" relates to the text which i believe can be left if using macros
    *the parameter "Sales Planning" is my worksheet name
    *the parameter "001" is my report definition.
    I was hoping to return the result back to cell C26. Thanks All

  • How do i implement dynamic feature like arraylist in an array

    how do i implement dynamic feature like arraylist in an array

    funny
    but can u realy give me that code

  • How to reference a user parameter in program unit

    I tried to define a user parameter in Oracle Report 6i and I could reference it (&p_where_clause) in the main query but I failed to reference it in one of the program units. Here is the logic:
    function CF_OTHER_COURSESFormula return Char is
    cnt           number;
    priority     number;
    class_code     varchar2(8);
    oc           varchar2(100) := null;
    cursor oc_cur is
    select class_code, branch_priority
    from nominations n, employments e
    where n.hkic_no = e.hkic_no
    and e.staff_status_code = 'EMP'
    and &p_where_clause --> contain "n.course_code in ('A','B','C')"
    and n.hkic_no = :hkic_no
    and n.class_code != :class_code;
    begin
    cnt := 1;
    open oc_cur;
    loop
    fetch oc_cur into class_code, priority;
    if oc_cur%notfound then
         exit;
    end if;
    if cnt = 1 then
    oc := oc||class_code||'('||priority||')';
    else
    oc := oc||', '||class_code||'('||priority||')';
    end if;
    cnt := cnt + 1;
    end loop;
    close oc_cur;
    return oc;
    exception
    when no_data_found then      
    return '';
    end;
    Does anyone tell me how to reference it in program unit? Does Oracle Reports 6i support this operation?

    There hasn't been any changes to the way lexicals and bind variables work in Reports between 2.5 and 6i. There are different versions of PL/SQL and you might be hitting some problem here.
    In your case, you shouldn't be using the query lexical "&p_where_clause" just the PL/SQL bind variable syntax ":p_where_clause". Since you're creating a PL/SQL cursor, you should probably use dynamic sql creation with a concatenation of the where clause to build up the SQL for the cursor. Check out the PL/SQL documentation for this.

  • How to create a dynamic property in JavaFX

    public class Person() {
    private SimpleStringProperty _Name = new SimpleStringProperty();
    public final String NameGet() {
    return this._Name.getValue();
    public final void NameSet(String Name) {
    this._Name.setValue(ColumnName);
    public StringProperty NameProperty() {
    return this._Name;
    private SimpleStringProperty _SurName = new SimpleStringProperty();
    public final String SurNameGet() {
    return this._SurName.getValue();
    public final void SurNameSet(String SurName) {
    this._Name.setValue(ColumnName);
    public StringProperty SurNameProperty() {
    return this._SurName;
    How to create a dynamic property in JavaFX ?
    ObservableMap, ObservableMapValue, MapPropertyBase, MapProperty
    Which one should I use. Can you give an example?

    I'm not sure what you mean by "dynamic property"; can you be more explicit?
    Your code creates two properties that can be read, written, and observed for changes, though it's probably better to use the standard naming scheme for the methods (e.g they should be getName(), setName(...) and nameProperty()).
    An ObservableMap is an extension of the java.util.Map interface that can be observed; i.e. you can register a listener that will be notified if a key-value pair is added or removed from the map.
    ObservableMapValue is an interface that defines an observable reference to an ObservableMap; i.e. it has a get() method returning an ObservableMap and a set(...) method taking an ObservableMap. You can register a ChangeListener which is notified when the set(...) method is called. It additionally functions as an ObservableMap, so you can also register listeners that get notified when key-value pairs are added or removed from the underlying observable map.
    MapProperty and MapPropertyBase are effectively partial implementations of ObservableMapValue. SimpleMapProperty is a full implementation.
    If you just need a single ObservableMap (i.e. not an observable reference to one), then the FXCollections.observableHashMap() factory method will provide one.

  • How to reference the selected row on a report by click a radiobox

    I created a report with a column displayed as a radiobox.The report source is like "select htmldb_item.radiogroup(1,.....),rec_id,....from .... where ....",after click one radiobox,i want to get other column's value in the selected row in the after submit process ,can anyone help me?????? how to reference "rec_id" of the selected row?

    Hello,
    First, please tell us your first name, and update your forum handle. It’s make it easier to track your threads, and help you.
    >> apex_application.g_f01(1)" only return the first record's rec_id,if i click radiobox in other rows,it returns the same result as click radiobox in the first row?
    The ‘G_F01’ is an array of values, so apex_application.g_f01(1) will always bring you the first element of this array. If you want to retrieve other values from this array, which will include the values of the radiogroup value of the other lines, you need to use a loop. Something like that should work:
    for i in 1.. apex_application.g_f01.count loop
    … apex_application.g_f01(i) …
    end loop;
    >> after click one radiobox,i want to get other column's value in the selected row in the after submit process
    That means that the value of your radiogroup item should include some indication to the line you are on. If, like in Andy’s example, you can retrieve your record from a table, based on a PK, your radiogroup can return this kind of information. However, if the data on the other columns of the select raw, were just entered/updated by the user (like in a tabular form), the radiogroup item should include information about the row you are in, in order for you to be able to access the corresponding array elements – other G-Fxx arrays – of the other columns in the row. In this case, I believe using checkboxes is preferable.
    Regards,
    Arie.

  • How to reference current tab on page zero?

    Hi,
    I have regions placed on page zero. How could I reference the current tab? I have to many pages, so using display condition by using page ID is little uncomfortable. I thought I could make a condition by using SQL expression and referring the label or name of the currently active tab. I think, this is a trivial question, but I can not find how to referre to the current tab's name or label.
    Tamas

    Hi
    I have the exact same problem.
    I cant have multiple navigators on page 0.
    Therefore my navigator on the left hand side should be dynamic, based on the tab I click.
    I've gotten this far (select statement below), but I don't know how to reference the current tab that I've clicked on / the current tab is active (see :P0_TAB_NAME)
    select "MENU_CODE" id,
    "PARENT_MENU_CODE" pid,
    decode(menu_type,'FL','<img src="#APP_IMAGES#folder.png" border="0"
    style="vertical-align:middle">&nbsp<b>' ||menu_description,
    'PG','<img src="#APP_IMAGES#pgm.png" border="0"
    style="vertical-align:middle">&nbsp<b>' ||menu_description,
    'PG','<img src="#APP_IMAGES#tree_group.png" border="0"
    style="vertical-align:middle">&nbsp<b>' ||menu_description) name,
    decode(page_name,null,null,'f?p=&APP_ID.:'||page_name||':&SESSION.') link,
    null a1,
    null a2
    from "CANELAB_NAVIGATOR" a, APEX_APPLICATION_TABS b
    where b.display_sequence = a.menu_group
    and b.tab_name = :P0_TAB_NAME
    order by MENU_CODE

  • How to create Hyperlink dynamically

    Hi All,
    In my application , iam using one table , one of the field in that table is input field,
    when i entered data in that field at runtime, automatically that field value should become hyperlink, to show another table.
    is it possible to do, if possible please help me in this how to create field dynamically.
    regards,
    sush

    Hi Sushma,
    What I get is that at runtime, you will fill the input field with some value & wish to have the field changed to a link.
    Adding to what Armin has said, keep the input field as it is. Add a new column in the table, create the TableCellEditor of type LinkToURL (if it is a URL value) or LinkToAction (if some value).
    For LinkToURL type, set the 'reference' property to the same context value attribute as the input field.
    For LinkToAction type, set the onAction event where you call the appropriate code.
    You can also set the 'text' property as Link or bind it to this context value attribute as well.
    Hope this works.
    Kind Regards,
    Nitin
    Edited by: Nitin Jain on Mar 25, 2009 9:14 AM

  • 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 a byte Array dynamically.Urgent Help needed.

    Hi there,
    I need to create a byte Array with the values
    derived from the array and then am passing this byte array
    to a method.
    Example :
    public static void main(String[] args) throws IOException {
    char chars[] = {'a','j','a','y'};
    byte[] b = {
    (byte) chars[0],(byte) chars[1],(byte) chars[2],(byte) chars[3],
    //** Send name to a server.
    sendRequest(b);
    This is all right.
    But here I know the size of the character array chars.
    If it had more than 4 characters or less than 4,
    is there a way to create the byte array dynamically based on the values in the character array?
    Please can some one help me with creating a byte array on the fly?
    Has anyone understood my question please?
    A response is much much appreciated.

    The actual problem is this.
    The byte array already has some fixed values to it
    and i need to append the values of the character array
    to this byte array
    ie
    char chars[] = {'a','j','a','y'};
    byte b[] = {
    // Predefined values
    (byte) 0x01, (byte) 0x7E, (byte)0x03
    // I have to add the values from the array here
    (byte) chars[0], (byte) chars[1]....
    How can I add these values.? The size of the character array
    can vary

  • How to reference table rows added using addInstance?

    OK, this one's probably quite simple, but I'm at wit's end . . . .
    I have a table with body rows that can be added using addInstance.  what I can't figure out is how to reference the newly added rows and teh fields within them.  If the row reference for the inital row before addInstance is:
    Table.Row1.CellName before the addInstance, after the addInstance wouldn't it be Table1.Row1[0].CellName and the newly added row be Table1.Row[1].CellName?  I try that and the debugger tells me that Table1.Row1[1].CellName has no properties.
    I basically need to determine whether the user has filled out anything in the added rows and I'm having a devil of time figuring out how to reference the added rows and their cells.  Thanks in advance!

    Your logic is correct but to reference that som expression you woudl have to use this notation:
    xfa.resolveNode("Table1.Row[1].CellName").method or property
    The reason for this is the use of the square brackets. Javascript interprets this an an array. When you use the resolveNode method you can pass a string and hence the square brackets get interpretted correctly.
    Paul

Maybe you are looking for

  • Creation of pdf - which product / products do i need

    I am getting a little confused so would like some help. I want to create an editable pdf which can be filled in by a user on a mobile device. I then want the pdf file created to be automatically emailed to an email address. I need to be able to set s

  • How to install Oracle 10g Release 2 (10.2) for RHEL 5

    Hello Guys, I want to install Oracle® Database 10g Release 2 (10.2) for Linux x86-64 in RHEL 5 Please experience people guide me ... please don't give me http://download.oracle.com/docs/cd/B19306_01/install.102/b15667/toc.htm (Oracle® Database Instal

  • Contact name does not appear after upgrading to iOS 5

    I recently upgraded to iOS 5 and after doing so, contact name does not appear when someone calls; but text messages the name appears. I have saved all my contacts under +9 format. 

  • House bank in APP

    Hi I have raised a invoice of 1,00,000 for Vendor X with a house bank as HDFC. In vendor master I specified the house bank as ICICI. But in the payment program, in the ranking order I mentioned u201CState banku201D as 1st. When we are doing payment r

  • Can't open external Firewire disk after upgrade to Leopard

    I recently upgraded a PowerBook G4 from 10.4.11(?) to 10.5.5. Now I cannot open its external disk, a LaCie 400 GB Firewire disk, model number 300925, like this: http://www.amazon.com/Lacie-400GB-7200Rpm-Firewire-300925/dp/B00066989Mreport The disk's