How to fill a collection?

Hello

I need to know how to fill a collection which I will later use to insert into the database. The following is an excerpt from the code I'm writing and please assume that all variables are correct except for the part in question.

declare

R_ipm_ip_addr RECORD TYPE IS
(ip_addr_id, ipm_ip_addr.ip_addr_id%TYPE,
ip_dec ipm_ip_addr.ip_decimal%TYPE,
ip_addrr ipm_ip_addr.ip_address%TYPE,
Comments ipm_ip_addr.comments%TYPE,
own_orgid ipm_ip_addr.owner_organization_id%TYPE,
sharing of ipm_ip_addr.sharing%TYPE,
block_id ipm_ip_addr.block_id%TYPE);

TYPE t_ipm_ip_addr IS TABLE OF THE r_ipm_ip_addr;
l_ipm_ip_addr t_ipm_ip_addr: = t_ipm_ip_addr (r_ipm_ip_addr);

BEGIN

.......

FOR indx IN 1... l_ipm_stat_host. Count

LOOP

ipm_net_index: = l_ipm_net. FIRST;

While (ipm_net_index IS NOT NULL)

LOOP

IF l_ipm_stat_host (indx) .ip_addr_int .start_ip_int l_ipm_net (ipm_net_index) and l_ipm_net (ipm_net_index) .end_ip_int

THEN

dbms_output.put_line (l_ipm_stat_host (indx) .ip_addr |) » --> ' || l_ipm_net (ipm_net_index) .start_ipadd | » /'|| l_ipm_net (ipm_net_index) .cidr_size);

v_ipnet_ipadd: = l_ipm_net (ipm_net_index) .start_ipadd;

v_ipnet_cidr: = l_ipm_net (ipm_net_index) .cidr_size;

OPEN c_get_block_id.

EXTRACT c_get_block_id INTO v_parent_blkid, v_parent_orgid;

CLOSE C_get_block_id;

l_ipm_ip_addr.extend;

l_ipm_ip_addr (l_ipm_ip_addr.last): = t_ipm_ip_addr (gen_uuid () l_ipm_stat_host (indx) .ip_addr_int, l_ipm_stat_host (indx) .ip_addr, .attr1 l_ipm_stat_host (indx) | l_ipm_stat_host (indx) .attr2, v_parent_orgid, 'sharing', v_parent_blkid); < < <-this is the part that gives me an error (PLS-00306: wrong number or types of arguments in the call to 'T_IPM_IP_ADDR')

EXIT;

END IF;

ipm_net_index: = l_ipm_net. Next (ipm_net_index);

y_ctr: = y_ctr + 1;

END LOOP;

-dbms_output.put_line (l_ipm_stat_host (indx) .ip_addr);

v_ctr: = v_ctr + 1;

END LOOP;

END;

Help you enjoy! Thank you!

I got it!

I added another variable to record and the values assigned to it before passing it to the table. See below for more details.

declare

R_ipm_ip_addr RECORD TYPE IS
(ip_addr_id, ipm_ip_addr.ip_addr_id%TYPE,
ip_dec ipm_ip_addr.ip_decimal%TYPE,
ip_addrr ipm_ip_addr.ip_address%TYPE,
Comments ipm_ip_addr.comments%TYPE,
own_orgid ipm_ip_addr.owner_organization_id%TYPE,
sharing of ipm_ip_addr.sharing%TYPE,
block_id ipm_ip_addr.block_id%TYPE);

TYPE t_ipm_ip_addr IS TABLE OF THE r_ipm_ip_addr;

rec_ipm_ip_addr r_ipm_ip_addr;
l_ipm_ip_addr t_ipm_ip_addr: = t_ipm_ip_addr();

BEGIN

.......

FOR indx IN 1... l_ipm_stat_host. Count

LOOP

ipm_net_index: = l_ipm_net. FIRST;

While (ipm_net_index IS NOT NULL)

LOOP

IF l_ipm_stat_host (indx) .ip_addr_int .start_ip_int l_ipm_net (ipm_net_index) and l_ipm_net (ipm_net_index) .end_ip_int

THEN

dbms_output.put_line (l_ipm_stat_host (indx) .ip_addr |) » -->'|| l_ipm_net (ipm_net_index) .start_ipadd | » /'|| l_ipm_net (ipm_net_index) .cidr_size);

v_ipnet_ipadd: = l_ipm_net (ipm_net_index) .start_ipadd;

v_ipnet_cidr: = l_ipm_net (ipm_net_index) .cidr_size;

OPEN c_get_block_id.

EXTRACT c_get_block_id INTO v_parent_blkid, v_parent_orgid;

CLOSE C_get_block_id;

l_ipm_ip_addr.extend;

rec_ipm_ip_addr.ip_addr_id: = gen_uuid();

rec_ipm_ip_addr.ip_dec: = l_ipm_stat_host (indx) .ip_addr_int;

rec_ipm_ip_addr. IP_ADDR: = l_ipm_stat_host (indx) .ip_addr;

rec_ipm_ip_addr.comments: = l_ipm_stat_host (indx) .attr1 | » -'|| l_ipm_stat_host (indx) .attr2 | » -'|| l_ipm_stat_host (indx) .attr3 | » -'|| l_ipm_stat_host (indx) .attr4 | » -'|| .attr5 l_ipm_stat_host (indx);

rec_ipm_ip_addr.own_orgid: = v_parent_orgid;

rec_ipm_ip_addr. Sharing: = 'shared ';

rec_ipm_ip_addr.block_id: = v_parent_blkid;

l_ipm_ip_addr (l_ipm_ip_addr. (Last): = rec_ipm_ip_addr;

EXIT;

END IF;

ipm_net_index: = l_ipm_net. Next (ipm_net_index);

y_ctr: = y_ctr + 1;

END LOOP;

-dbms_output.put_line (l_ipm_stat_host (indx) .ip_addr);

v_ctr: = v_ctr + 1;

END LOOP;

END;

Tags: Database

Similar Questions

  • How to fill a datagrid with a web service result which is an array?

    I know how to fill a DataGrid to a CF of the web service that returns a query result. But what happens if I want to my CF component to run a query, then massage the data and back-is not a query - but a picture from the web service.

    Seems my two dimension table because ColdFusion has no column name, I need to create on the CF side name-value pairs or the side Flex. BTW, I prefer to use mx:webservice and not remoteObject.

    Any ideas on the best way to fill a datagrid from an array?

    Thank you.

    (Sorry for the previous double post).

    A colleague found the answer for me. I hope this saves someone else from 5 days of anquish!

    When a ColdFusion component returns an array of structures (not the result of a query), redesign the table as an arrayCollection collection throws an error.

    IT DOES NOT WORK:
    acSpeeds = new ArrayCollection (wsSpeeds.oneNode.lastResult);

    THIS WORKS!
    acSpeeds = wsSpeeds.oneNode.lastResult;

    It seems that a table generated by ColdFusion structures is already a collection arrayCollection 'official '!

    Hope this helps someone.

  • In FF password manager (30.0), when you open change, what are all the fields and how you fill them?

    When you open Edit, there are two choices: Web form and annotated.
    What is the difference?

    Then, there are fields for the host, submit the prefix, username, password, etc.
    How to fill out these fields?

    When you click for the Manager "assumes that of the current Page", all fields not necessarily fill up, so it's just for the username and password?
    I use constantly editing function, so it's a little strange to not see that further instructions here.

    When I click on tools, the saved password dialog box is on the list, so it's in my toolbar all the time.
    I use it constantly.

    What is the last password security? I know there are competitors of ideas. What is Mozilla?

    Thank you.

    Personally, I do not record the connections site in Firefox. The FireFTP extension records the FTP connections, so I use a master password to protect the people.

    I know I should finally pass a manager based password on a cloud, because if often, I forgot my login and have to reset, but... I have not bypassed by comparing the features and tests.

  • How to fill the discharge battery on Qosmo G30?

    Hello

    How to fill the discharge battery on Qosmo G30?

    Thank you

    Hello

    Disconnect the power adapter and run the notebook until it automatically stops.
    In addition, you should disable or change the battery alert in Windows power management.

  • How to access objects collection

    How to access the collections of objects for example ReportSections report? I can access ReportSection, but not his collection...

    Reference: http://www.ni.com/pdf/manuals/372844e.pdf

    Maybe you don't understand exactly what section of the report is. According to the help:

    Use this class objects to store, update and transfer reports. You typically use the ReportSection objects to avoid creating copies of a report that the report is transferred between the generator of reports, process, Report and ReportView control object models. You can create a new ReportSection object by calling the Report.NewReportSection method. ReportSection objects can contain other ReportSection objects.

    As a general rule, a process template creates and updates the ReportSection object and assigns to the report object by setting the Report.ReportSection property.

    It has a sub-property called ReportSubsections , which specifies a reference to the ReportSections object, which is a collection that contains a list of child ReportSection objects to the current object. Looking at this object, it's a list of items that you can index through to get each.

  • How to fill a list box to a LabView VI TestStand?

    Recently started watching TestStand GUI and I work with one of the examples provided with TestStand.

    An important aspect of my test program, it is that I want the user to be able to dynamically choose which hardware plugged he/she wants to test on.

    so I thought that I have would display the COM ports connected in a ListBox control on the graphical interface, to let the user decide which com ports to use.

    This is a feature that you would 'normally' use the TestStand GUI for?

    How could fill a ListBox TestStand to a LabView VI? Say a simple that uses 'finding the names of resources VISA '.

    You cannot use a ListBox TestStand for this.  All user TestStand UI controls are based on a COM (ActiveX) object.  This means that they connect to the manager controls and then behave based on the events of the controls of Manager.

    You'll want to ouse a LabVIEW control (ListBox control in your case).  Then use the user interface Messages to retrieve information.

    http://www.NI.com/Tutorial/4532/en/

    http://zone.NI.com/reference/en-XX/help/370052N-01/tsexamples/infotopics/handleuimessage_labview/

    Or your other option is to have your movie file just pop up a LabVIEW VI with the list of the HW inside.  Then the user selects.  This is the easiest route, but it would take an annoying popup if you don't like that.

    Let me know if you have any questions on this subject.

    Kind regards

  • How to fill a control ring with chains [] array?

    How to fill a control ring with chains [] array?

    It must be karma. (Try really bad karma because I couldn't post this question in my original)

    I must have been a Really bad guy in a previous life...  It's not like I'm bad in this one...

    So... what I want to do this time around?  Something that I thought would be easy... Well... it's a long story...  I had a simple solution, but the client wants something else.  -sigh-

    Here is what they want...  They want a control that allows for multiple selections to a control of the ring (or a control that allows a drop down selection menu).  Bites are filled at run time because it is based on 10 000 other precedents of things this particular choice.  So it must be dynamic.

    The snippet of code & images below show what I'm doing a little...

    The bottom image shows on the right bites which is filled in the control of the ring.  Since the number of items / items changes, I didn't have a bunch of controls stacked on another.  In addition, I have to deal with an unknown quantity of selections.

    Does anyone have a solution that can be recommended?  If so, can you share the solution / idea?

    Thank you

    RayR

    I have posted a code that does something similar here: http://forums.ni.com/t5/LabVIEW/array-of-cluster/m-p/1822451#M625032

    It uses a table hint and individual controls that are moved on top of the table and populated as needed.  This approach might work for you?  You would need a two-column table and only control ring, which you would fill properly whenever the currently active cell changes.

  • How to fill out the customer type when you submit a form?

    How to fill out the customer type when you submit a form?

    You can't do right now in British Colombia by means of forms.

  • How to fill the forms/interiors?

    How to describe this written?...

    Let's say you have a form of vector of ring.  It's a circle with a hole in the middle.  Apply a fill does not fill the hole because the hole is not part of the shape, it's just space.  How you fill out that form/space?

    Thank you.

    NJ

    Use live paint.

  • How to fill an editing in items 14 session? I continue to win, but nothing changes.

    How to fill an editing in items 14 session? I continue to save him, but a message on the picture again "Ongoing Edit" and it won't let me write a legend.

    Hello

    Where you see this message - current Edit? in the organizer or in the editor.

  • How to fill a pdf form?

    How to fill a PDF form please?

    Hi eaglesandcats,

    Please see this KB document for help help of Acrobat Reader | Complete and sign PDF forms.

    Kind regards

    Nicos

  • How to fill a field of date with today's date when the signature field is signed?

    How to fill a field of date with today's date when the signature field is signed? In the LCD, I insert a signature field and a date field, what parameters in these two fields are necessary to make this work? Is the date field, the value calculated? I tried different JS suggestions I found, but none work. In the form, I named the signature ClaimSignature field and the date in the ClaimSigDate field.

    The thought of her with a little help. In the script editor window, I selected the postSign event and added the following JS:

    Form1.Page1.ClaimSignature::postSign - (JavaScript, client)

    var date = new Date();

    var day = date.getDate ();

    var month = date.getMonth () + 1;

    var monthstring = (month, 10?) ('0' + month: month)

    year var = date.getFullYear ();

    var = year DateString + '-' + monthString + '-' + (day< 10="" "0"="" +="" day="" :="">

    ClsimSigDate.rawValue = dateString;

    I hope this helps someone else save time.

  • How to fill one shape with another shape, but not of models

    Hello

    How to fill one shape with another shape, but not of models. Example of this poster

    Screen Shot 2015-05-18 at 13.41.33.png

    put in a shape of the tree so that it looks like this:

    Heavy_type_tree.jpg

    Select your type with a vector path, which is the subject

    Object > envelope distort > make with top object.

  • HOW TO FILL OUT FORM PDF WITH HEBROW ON CHROME?

    HOW TO FILL OUT FORM PDF WITH HEBROW ON CHROME?

    Chrome uses its own PDF Viewer (incompatible).

    Download the PDF file to your local drive, then fill it out of there with Adobe Reader.  Or use a browser that uses the Adobe PDF plugin.

  • How to fill out the "to:" line with a variable email address?

    I'm new to coding and am not sure how to ask my question. I have a link in an 'Email' symbol that I would like to have the window open to a 'mailto', but there are several instances of that symbol on the timeline, each using a different email address. If the [symbol]. Email.Click code reads as follows:

    Window.Open ('mailto:'+ sym.getVariable = ("emailWindow"), "_self")

    and the line in the Stage.creationComplete code that is supposed to call the variable code reads:

    sym.getSymbol("Details_David").$("Email").html ("[email protected]" "").setVariable("emailWindow","[email protected]");

    With this code, the browser opens a window of mailto, but the ' to: ' line readings, "indefinite".

    Either in the [symbol]. Email code. Click, I have:

    Window.Open('mailto:"emailWindow"',"_self")

    without the "emailWindow" as the variable name, the "to:" line to the mailto line reads, "emailWindow".

    How to fill out the "to:" line with a variable email address?

    Otherwise, it works better:

    1)

    replace

    sym.getSymbol("Details_David").$("Email").html ("[email protected]").setVariable("emailWindow", "mailto:[email protected]");

    with

    sym.getSymbol("Details_David").$("Email").html ("[email protected]");

Maybe you are looking for