How to Extend an Array of an Array of an Object

Hi!
I'm created these types in my DB:
TYPE SONO_ROW AS OBJECT (DATO NUMBER, FECHA DATE);
TYPE SONO_TABLE IS VARRAY(1000) OF SONO_ROW;
TYPE SONO_ARRAY IS VARRAY(1000) OF SONO_TABLE;
Well, I have a problem when I trying to load SONO_ARRAY, because I can't do a EXTEND for this Type:
DECLARE
V_MULTIVARRAY SONO_ARRAY;
BEGIN
-- Initialize the collection
V_MULTIVARRAY := SONO_ARRAY(SONO_TABLE(SONO_ROW(77, SYSDATE)));
-- Extend the collection
V_MULTIVARRAY.EXTEND(10,1);
V_MULTIVARRAY(2)(1) := SONO_ROW(1, SYSDATE);
END;
Whell, this code extend in 10 the element 1(SONO_TABLE), it is ok, but I don't know how to extend SONO_REG in order to insert elements for SONO_ROW: V_MULTIVARRAY(1)(2). I tried to do it of all the ways but without results.
Someone could help me, please?
Thanks,
Fernando.

Does this help?
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> DECLARE
  2     l_sono_array sono_array := sono_array ();
  3  BEGIN
  4     FOR i IN 1 ..10 LOOP
  5        l_sono_array.EXTEND;
  6        l_sono_array (i) := sono_table ();
  7       
  8        FOR j IN 1 .. 5 LOOP
  9           l_sono_array (i).EXTEND;
10           l_sono_array (i) (j) := sono_row (j, SYSDATE);
11        END LOOP;
12       
13     END LOOP;
14  END;
15  /
PL/SQL procedure successfully completed.
SQL>

Similar Messages

  • How to extend an array?

    Hi,
    how to extend an array
    int[] b = new int[] {1, 2, 3};by adding 4, 5, 6 without copying?
    thanks a lot
    aldo

    You can't
         int [] b = {1,2,3};
         int [] a = {4,5,6};
         int [] tmp = new int [b.length + a.length];
         System.arraycopy(b, 0, tmp, 0, b.length);
         System.arraycopy(a, 0, tmp, b.length ,a.length);
         b = tmp;
         System.out.println(Arrays.toString(b));

  • How to correct copy/append/insert a array

    Hi @ all,
    I have a message type I'd like to iterate through and extract values from array (1).
    Then place into another array (2):
    TestOutputVariable(Array (1)):
    <roottest>
    <AAA>
    <BBB>result1.1</BBB>
    <BBB>result1.2</BBB>
    <testname>test1</testname>
    </AAA>
    <AAA>
    <BBB>result2.1</BBB>
    <BBB>result2.2</BBB>
    <testname>test2</testname>
    </AAA>
    </roottest>
    ReportInputVariable(Array(2)):
    <rootreport>
    <AAA>
    <name/>
    </AAA>
    </rootreport>
    for example ReportInputVariable must be like:
    <rootreport>
    <AAA>
    <name>test1
    </AAA>
    <AAA>
    <name>test2
    </AAA>
    </rootreport>
    <while name="While_1"
    condition="bpws:getVariableData('count') >= bpws:getVariableData('iterator')">
    <assign name="AssignTests">
    <copy>
    <from variable="TestOutputVariable"
    part="parameters"
    query="/ns2:getTests/ns2:result/ns2:roottest/ns2:AAA[bpws:getVariableData('iterator')]/ns2:testname"/>
    <to variable="ReportInputVariable" part="payload"
    query="/client:ReportBPELProcessProcessResponse/client:result/client:rootreport/client:AAA[bpws:getVariableData('iterator')]/client:name"/>
    </copy>
    <copy>
    <from expression="bpws:getVariableData('iterator') + 1"/>
    <to variable="iterator"/>
    </copy>
    </assign>
    </while>
    But exception: XPATH returns null node...
    How to populate Array(2)?

    Ok let's see (staying in english is allright I hope... eventhough my is getting really bad).
    As I said I only can extract the data until now, haven't tried to write it to an array. In addition don't copy the code I give here because it's only to give you an hint. But the JDeveloper is a really cool tool to "click" the right expressions together...
    So the trick is to "build" the xpath to access the arrayfield you want to fetch. Therefore at first you need an counter:
    <assign><copy><from expression="1"><to variable="counter"></copy></assign>
    Now you're going to build your xpath:
    <copy><from expression="concat('/roottest/AAA[',bpws:getVariableData('counter'),']')"/>
    <to variable="xpathPosition"/>
    </copy>
    Now you an xPath which is pointing to the child elements of your first node <AAA>. You use these expression now for the copy process:
    <copy>
    <from expression="bpws:getVariableData(???, ???, concat(bpws:getVariableData('xpathPosition'),'/testname'))"/>
    <to variable="output"/>
    </copy>
    Notice that ??? stands for Variable and Part name - still fighting with the syntax. The main point is that concat gives you the xpath expression to the array field you want (for counter = 1 eg. "/roottest/AAA[1]/testname") - that's it.
    To assign the value to an array - sorry, haven't tried it but the link I posted seemed good. The problem is that in order to insert the data into an array you have to append a new element into the array and therefore use one of the extended functions (=bpelx).
    Viel Spaß damit :-)

  • How to set the value of an array element (not the complete array) by using a reference?

    My situation is that I have an array of clusters on the front panel. Each element is used for a particular test setup, so if the array size is three, it means we have three identical test setups that can be used. The cluster contains two string controls and a button: 'device ID' string, 'start' button and 'status' string.
    In order to keep the diagrams simple, I would like to use a reference to the array as input into a subvi. This subvi will then modify a particular element in the array (i.e. set the 'status' string).
    The first problem I encounter is that I can not select an array element to write to by using the reference. I have tried setting the 'Selection s
    tart[]' and 'Selection size[]' properties and then querying the 'Array element' to get the proper element.
    If I do this, the VI always seems to write to the element which the user has selected (i.e. the element that contains the cursor) instead of the one I am trying to select. I also have not found any other possible use for the 'Selection' properties, so I wonder if I am doing something wrong.
    Of course I can use the 'value' property to get all elements, and then use the replace array element with an index value, but this defeats the purpose of leaving all other elements untouched.
    I had hoped to use this method specifically to avoid overwriting other array elements (such as happens with the replace array element) because the user might be modifying the second array element while I want to modify the first.
    My current solution is to split the array into two arrays: one control and one indicator (I guess that's really how it should be done ;-) but I'd still like to know ho
    w to change a single element in an array without affecting the others by using a reference in case I can use it elsewhere.

    > My situation is that I have an array of clusters on the front panel.
    > Each element is used for a particular test setup, so if the array size
    > is three, it means we have three identical test setups that can be
    > used. The cluster contains two string controls and a button: 'device
    > ID' string, 'start' button and 'status' string.
    >
    > In order to keep the diagrams simple, I would like to use a reference
    > to the array as input into a subvi. This subvi will then modify a
    > particular element in the array (i.e. set the 'status' string).
    >
    It isn't possible to get a reference to a particular element within an
    array. There is only one reference to the one control that represents
    all elements in the array.
    While it may seem better to use references to update
    an element within
    an array, it shouldn't really be necessary, and it can also lead to
    race conditions. If you write to an element that has the
    possibility of the user changing, whether you write with a local, a
    reference, or any other means, there is a race condition between the
    diagram and the user. LV will help with this to a certain extent,
    especially for controls that take awhile to edit like ones that use
    the keyboard. In these cases, if the user has already started entering
    text, it will not be overwritten by the new value unless the key focus
    is taken away from the control first. It is similar when moving a slider
    or other value changes using the mouse. LV will write to the other values,
    but will not rip the slider out of the user's hand.
    To completely avoid race conditions, you can split the array into user
    fields and indicators that are located underneath them. Or, if some
    controls act as both, you can do like Excel. You don't directly type
    into the cell. You choose w
    hich cell to edit, but you modify another
    location. When the edit is completed, it is incorporated into the
    display so that it is never lost.
    Greg McKaskle

  • Using the value "Image/*" for the accept attribute of the HTML input Element, how can I add .pdf to the array of preconfigured file types (.jpe, .jpg, .jpeg, .?

    On a form, using the value "image/*" for the accept attribute of the HTML input Element, how can I add .pdf to the array of pre-configured file types (.jpe, .jpg, .jpeg, .gif, .png, .bmp, .ico, .svg, .svgz, .tif, .tiff, .ai, .drw, .pct, .psp, .xcf, .psd, .raw)?
    Say I wanted to add .gif, .jfif or .ico. I find this array limited, how can I add types to image?
    <input type="file" name="file" accept="image/*" id="file" />
    mimeTypes.rdf does not seem to allow this.

    ''mimeTypes.rdf'' has nothing to do with web development. It's a file that stores your file handling preferences (e.g. if you want ZIP files automatically saved or opened).
    You can't change the file types of the pre-defined content specifiers (audio/*, video/*, image/*), but you can specify additional MIME types. To add PDF to your above example,
    <pre><nowiki><input type="file" name="file" accept="image/*,application/pdf" id="file" /></nowiki></pre>
    For details, see
    * [https://developer.mozilla.org/En/HTML/Element/Input developer.mozilla.org/En/HTML/Element/Input]

  • How do I convert a 1-D array of cluster of 5 elements into a 2-D array of numbers? (history data from a chart)

    Hello,
    in my vi I have a chart with 5 Plots displaying measurement data.
    The user should be able to save all the history data from the chart at anytime. (e.g. the user watches the chart and some event happens, then he presses a "save"-button)
    I know, that I can read out the history data with a property node. That is not the problem. The problem is, how do I handle the data? The type of the history data is a 1-D array of cluster of 5 elements.
    I have to convert that data somehow into a 2 D-array of numbers or strings, so that I can easily save it in a text-file.
    How do I convert a 1-D array of cluster of 5 elements into a 2-D array of numbers?
    I use LabVIEW 7.1
    Johannes
    Greetings Johannes
    Using LabVIEW 7.1 and 2009 recently
    Solved!
    Go to Solution.

    Gerd,
    thank you for the quick response and the easy solution.
    Look what I did in the meantime. I solved the problem too, but muuuch more complicate :-)
    And I have converted the numbers to strings, so that I can easily write them into a spreasheet file.
    Johannes
    Message Edited by johanneshoer on 04-28-2009 10:39 AM
    Greetings Johannes
    Using LabVIEW 7.1 and 2009 recently
    Attachments:
    SaveChartHistory.JPG ‏57 KB
    SaveChartHistory.JPG ‏57 KB

  • How to extract every component in an array?

    Hello everyone!
    Do you know how to extract every component from an array field?
    For example:
    The following is the defination of a table:
    CREATE TABLE test (
    id NUMBER PRIMARY KEY,
    name VARCHAR2(32),
    shape MDSYS.SDO_GEOMETRY
    And then I insert a new record:
    INSERT INTO test VALUES(
    1,'first',
    MDSYS.SDO_GEOMETRY(
    2003,
    NULL,
    NULL,
    MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,3),
    MDSYS.SDO_ORDINATE_ARRAY(1,1, 5,7)
    The Question is I want to read the every component (for example 1,1,5,7) in the sdo_ordinate_array one by one. Who knows how to write the SQL?
    I have tried "select a.shape.sdo_ordinates(1) from test a". But it can't work.
    Thank you very much!

    One solution is to read each ordinate from a cursor ina SQL block. Here is an example:
    set serveroutput on
    SET serveroutput on SIZE 1000000
    set concat on
    DEFINE layername = 'LAYER';
    DEFINE geomcolname = 'GEOM';
    DECLARE
    id varchar2(10);
    longitude number;
    latitude number;
    logmile number;
    i number;
    theLayer varchar2(32);
    theGeomCol varchar2(32);
    BEGIN
    FOR rec IN (SELECT ROWID, id, &geomcolname FROM &layername ) LOOP
    id := rec.id;
    i := 1;
    while i < rec.geom.sdo_ordinates.count loop
    longitude:=rec.geom.sdo_ordinates(i);
    latitude:=rec.geom.sdo_ordinates(i+1);
    logmile:=rec.geom.sdo_ordinates(i+2);
    dbms_output.put_line(id || ',' || longitude || ',' || latitude || ',' || logmile);
    i := i + 3;
    end loop;
    END LOOP;
    commit;
    END;
    Maybe that will help.
    Dave
    David R. Miller
    Michael Baker Jr., Inc.
    3601 Eisenhower Avenue
    Alexandria, VA 22314
    [email protected]
    www.mbakercorp.com

  • How to store logical operator in an array in java

    how to store logical operator in an array in java.
    Array should not be String type if i pass an element of that array it should be considered as logical operator

    my exact requirment is like this, i need some logic
    to convert string like this "2 Equals 3 AND 4 greater
    than 7" to condition like this
    2 == 3 && 4 >7 which i can pass to if
    condition.So you want to create an expression parser?
    No need for something as ugly as what you think you need, a simple nested conditional will do it for just the few logical operations.

  • How can I make a simple 1D array filter.

    When I aquire my data I get a 1D array with anywhere from 10 - 30 data points. There are always ten good data points the rest are noise or false triggeres. a good data point is in the range of .1-.2 a bad point is .001-.01 how can I filter out thse bad points? Im using labview 8.6. also I think this program will work if it could be backconverted from 9 to 8.6.
    Attachments:
    InRange[1].vi ‏11 KB

    Dan K wrote: 1 - get "array size" and connect that to the N of the for loop.
    2 - "index array" so you can compare values one at a time.
    3 - "in range and coerce" - (note: you need to wire values above and below the orange line shown for the range you'd like)
    4 - case structure: if "in range" is true, then take the value and put it into a new array (this new array only has the good values you want) (false case is blank)
     NOOOOOO!!!!
    Step 1 and 2 are not necessary. Simply autoindex the original array at the loop boundary. Voila!
    (an "index array" with the index wired to [i] is never needed. Autoindexing does the same thing and automatically determines the number of iteration, eliminating step 1). 
    The second array is not initialized, meaning it will grow without bounds of you run the VI many times. Every time the loop runs, the array is resized, requiring a new buffer allocation. The original code is much better, because it preallocates the output array, replaces elements, then strips the extra length at the end. For large datasets, the original code will be orders of magnitude faster.
    LabVIEW Champion . Do more with less code and in less time .

  • How can I create a variable size array?

    How can I create a variable size array?

    ok then how can i create a new vector object?If you don't know that, you need to go back to your text book and study some more. Or read the tutorial on the basics of Java: http://java.sun.com/docs/books/tutorial/java/index.html
    After reading that you can move on to: http://java.sun.com/docs/books/tutorial/collections/index.html
    Anyway, the answer to your question is, of course:
    Vector v = new Vector();(But you should probably use ArrayList instead of Vector.)

  • How to correct copy/append/insert a array in BPEL

    BPEL
    Hi @ all,
    I have a message type I'd like to iterate through and extract values from array (1).
    Then place into another array (2):
    TestOutputVariable(Array (1)):
    <roottest>
    <AAA>
    <BBB>result1.1</BBB>
    <BBB>result1.2</BBB>
    <testname>test1</testname>
    </AAA>
    <AAA>
    <BBB>result2.1</BBB>
    <BBB>result2.2</BBB>
    <testname>test2</testname>
    </AAA>
    </roottest>
    ReportInputVariable(Array(2)):
    <rootreport>
    <AAA>
    <name/>
    </AAA>
    </rootreport>
    for example ReportInputVariable must be like:
    <rootreport>
    <AAA>
    <name>test1
    </AAA>
    <AAA>
    <name>test2
    </AAA>
    </rootreport>

    Ok let's see (staying in english is allright I hope... eventhough my is getting really bad).
    As I said I only can extract the data until now, haven't tried to write it to an array. In addition don't copy the code I give here because it's only to give you an hint. But the JDeveloper is a really cool tool to "click" the right expressions together...
    So the trick is to "build" the xpath to access the arrayfield you want to fetch. Therefore at first you need an counter:
    <assign><copy><from expression="1"><to variable="counter"></copy></assign>
    Now you're going to build your xpath:
    <copy><from expression="concat('/roottest/AAA[',bpws:getVariableData('counter'),']')"/>
    <to variable="xpathPosition"/>
    </copy>
    Now you an xPath which is pointing to the child elements of your first node <AAA>. You use these expression now for the copy process:
    <copy>
    <from expression="bpws:getVariableData(???, ???, concat(bpws:getVariableData('xpathPosition'),'/testname'))"/>
    <to variable="output"/>
    </copy>
    Notice that ??? stands for Variable and Part name - still fighting with the syntax. The main point is that concat gives you the xpath expression to the array field you want (for counter = 1 eg. "/roottest/AAA[1]/testname") - that's it.
    To assign the value to an array - sorry, haven't tried it but the link I posted seemed good. The problem is that in order to insert the data into an array you have to append a new element into the array and therefore use one of the extended functions (=bpelx).
    Viel Spaß damit :-)

  • How to delete an  element in an array...(simple way)

    hi,
    Newbie here... please help how to delete an element in an array list?
    there are alot of codes but they're complicated for a newbie like me..
    (simple codes would be better ..:) thank you...

    makk_88 wrote:
    since u want the simple method.....
    just overrite the position of the element that need to be deleted with the next element in the array..
    by doing this, element need to be deleted will not be accessibe..
    i think u got..what i'm saying.
    thnx..Mak,
    Say we wish to delete the second element of an array a[1]. Do you really believe that a[1] = a[2] somehow magically deletes a[1]? I really don't think so Tim.
    Two eggs, minus 1, equals two eggs? Interesting theory, but I think you're probably wrong.
    *@OP:* My advise is just use an ArrayList.
    Cheers. Keith.

  • How to register IN parameter of Types.Array

    I am trying to call a stored procedure in oracle database using a java application. The stored procedure has a IN parameter of Types.Array type. While trying to register the IN parameter using
    callableStatement.setArray(pos,(java.sql.Array)sqlParameter.value)
    (sqlParameter.value is of Object type)
    I get a ClassCastException
    Can anyone tell me how to pass the Array to the stored procedure?

    sqlParameter.value is of Object typeYou have to create the array using the class oracle.sql.ArrayDescriptor; like this:
    Connection dbConnection = dbConnectionAccess.getConnection ();
    ArrayDescriptor arrayDescriptor = ArrayDescriptor.createDescriptor ("HYPOLINE.NTESTARRAY", dbConnection);
    String [] newArrayValue = new String [] {"A1","A2","A3"};
    Array newArray = new ARRAY (arrayDescriptor, dbConnection, newArrayValue);
    See also the Oracle JDBC Developer's Guide and Reference!
    Hope this helps Thomas

  • How to store (non-persistent) multiple float[] arrays.

    Hi;
    In a situation where an object needs to store multiple float arrays, how can I use a 2 dimensional array to store them? I can't use a collection since an array is a primitive.
    I would use a 2 dimensional array, but my keys to get/set these arrays are ints. So I cant do a "int i[][]", nor a "float f[][]".
    Any ideas?
    Thanks;
    -nat

    You could make a Map (such as HashMap) with an
    Integer (java.lang.Integer) key and a "int []" or "float []" as a value (an array is an Object, so can be put as a value).You kid me not! I need to review my basics.
    I simply didn't know that an array of primitives can be stored as a value in a map.
    Thank you!
    -nat

  • How can I inverse the Split 1D Array by recombining the splitting array?

    How can I inverse the Split 1D Array by recombining the splitting array? i.e I have two boolean arrays A and B, and I want them in one boolean array: A array elements followed by B elements (NOT Interleaving)
    Thank you
    Solved!
    Go to Solution.

    Thank you Marcus_Körner , GerdW and thoult for your assistance.
    Sorry I am using Labview 2013, so I saved it in ver 2010 format, and I uploaded a photo for the circuit.
    Attachments:
    Packets.vi ‏8 KB
    Untitled.png ‏5 KB

Maybe you are looking for

  • Error in Inbound JMS adapter(in ESB project)

    Hello all, I am trying out a sample ESB application, where an ESB service is listening on a JMS topic (OEMS database persistence) for new employee notifications. Upon receiving the message, the service will invoke a stored procedure to insert a recor

  • Adobe 7, and opening a pdf file with a auto generated report

    We have upgraded to the latest version of a tool we use to generate reports. The older version, when you exported the report to a PDF file, it would open it in an internet broswer, IE 6/7 in this case, and just display the PDF in the browser. With th

  • Service ORG determination based on partner function

    Hi Pls let me know - How to tell from the config which partner function from a transaction say case or complaint, is being used to determine the service ORG unit at the header level of the transaction? Also Suppose I have 2 partner functions 1. A - s

  • Dimensions of window

    Hi, I am having trouble with my pop up window. i have a button that opens an external swf in a new window. The swf is 145x145 which is small but when it opens in the the window the swf resizes to full screen and i need to find a script to stop this.

  • Primavera P6 Professional command line parameters

    Does anyone can confirm if P6 Professional accepts command line parameters? I'm trying to call it from another application and feed it with an xml file which is in P6 Project format... is this possible? Thanks in advance.