How can you add item (object) complex "nested table"?

Hello I did some reading on * "Associative" * and * "Nested Table" * and I would like to enumerate the collection using the later version (http://www.devshed.com/c/a/Oracle/Database-Interaction-with-PLSQL-Nested-Tables/2/)
-know list "Nested Table"

However, encountered problem try to * 'EXTEND' * my nested table (add items to the complex type or OBJECT I defined, namely 'TmpHierarchyMapObjType' below) - detail as follows:

-NOTE 1: Here's how to create the type object (be well if I just say "CREATE or REPLACE TYPE TmpHierarchyMapObjType AS OBJECT (_TMP_HIERACHICAL. ROWTYPE_)"instead of having to duplicate the column definition.
CREATE OR REPLACE TYPE TmpHierarchyMapObjType AS OBJECT
(
ID numeric (19.0),.
ParentId numeric (19.0),.
ChildId numeric (19.0),.
...
TmpUID varchar2 (32),
ReferencedId numeric (19.0),.
...
);

-NOTE 2: I can't put 'TmpHierarchyMapObjType' inside the package, but it's not crucial, I guess.
Types of CREATE or REPLACE PACKAGE
AS
TYPE cursorType IS REF CURSOR;
TYPE TmpHiearchyMapTableType IS TABLE OF THE TmpHierarchyMapObjType; / * Use 'Nested Table' instead of an associative array * /.
/ * TYPE TmpHiearchyMapTableType IS TABLE OF THE TMP_HIERARCHYMAP % ROWTYPE INDEX DIRECTORY. */
END;

-NOTE 3: Here is my FUNCTION TABLE that now returns a "Nested Table" as assumed to 'Associative' (with a syntax different enumeration)
FUNCTION to CREATE or REPLACE spGetParentsTable
(
Number to the ObjectId,
ObjectClassifier varchar2
)
RETURN types . TmpHiearchyMapTableType -now a 'Nested Table', not 'voluntary '.
IS
Types of TmpHierarchyMap. TmpHiearchyMapTableType;
ThisTempId varchar2 (32);
CURSOR spGetParents_cursor IS
SELECT
ReferencedId Id,
ParentId,
ChildId,
...
OF TMP_HIERARCHYMAP
WHERE TmpUID = ThisTempId;
BEGIN
SELECT sys_guid() IN the double ThisTempId;

spRecursiveGetParents (ObjectId, ObjectClassifier, ThisTempId);

-(Commentary) TmpHierarchyMapMAX: = 0;
FOR oMap in spGetParents_cursor LOOP
-(Commented out) TmpHierarchyMapMAX: = TmpHierarchyMapMAX + 1;

-QUESTION: FAILED here! How can I add/elements of complex types?
TmpHierarchyMap.EXTEND (cast (oMap as TmpHierarchyMapObjType));

/*
NOTE: (In the comment) use is not "Associative", now using "nested table" instead.
TmpHierarchyMap (TmpHierarchyMapMAX). ID: = oMap.Id;
TmpHierarchyMap (TmpHierarchyMapMAX). ParentId: = oMap.ParentId;
TmpHierarchyMap (TmpHierarchyMapMAX). ChildId: = oMap.ChildId;
...
*/
END LOOP;

DELETE FROM TMP_HIERARCHYMAP WHERE TmpUID = ThisTempId;

RETURN TmpHierarchyMap;

END spGetParentsTable;

-Finally, I would like to enumerate the nested table.
DECLARE
types of oMappingTable. TmpHiearchyMapTableType;
BEGIN

oMappingTable: = spGetParentsTable(2,'ThinkFundamentals.Util.Security.SystemUser');

-NOTE 4: this is my final goal!
Select * from table (cast (oMappingtable as types.) TmpHiearchyMapTableType));

dbms_output.put_line ('done!');
END;


REF:
http://download.Oracle.com/docs/CD/B19306_01/AppDev.102/b14261/Collections.htm#LNPLS005
http://www.DevShed.com/c/a/Oracle/associative-arrays-in-Oracle-PLSQL-introduction/2/
http://www.DevShed.com/c/a/Oracle/database-interaction-with-PLSQL-nested-tables/2/

Hello

Try this,

TmpHierarchyMap.Extend();
TmpHierarchyMap(TmpHierarchyMap.Count) := TmpHierarchyMapObjType( oMap.Id
                                                                , oMap.ParentId
                                                                , ... );

Kind regards

Christian Balz

Tags: Database

Similar Questions

  • How can I add items to the Menu of the button lock, I don't, change user, close and lock. I want to add 'restart '.

    How can I add items to the Menu of the button lock, I don't, change user, close and lock. I want to add 'restart '.

    How can I add items to the Menu of the button lock, I don't, change user, close and lock. I want to add 'restart '.

    This tutorial should do what you want. Use method 2.
    http://www.Vistax64.com/tutorials/105003-shutdown-options-start-menu.html

    Please read all notes caefully, not only the parts of the statement.

    t-4-2

  • Watch does not recognize the weight class as exercise-how can you add the duration of activity manually because none of the presets eg elliptical etc. is appropriate. Also does not count calories for example 35 when the rest of the group is around 500

    Look does not recognize the weight class as exercise-how can you add the duration of activity manually because none of the presets etc for example elliptical is appropriate and therefore do not count toward the daily goal. Also does not count calories for example 35 when the average of the others in the group is around 500.

    Hello

    When you use the application of the training session, choose the type of activity that best fits your business. For anything else - like weight - select the other category.

    During the follow-up of one year to the next helps:

    • Activity app will credit the ring of progress of exercise with one minute for every minute of the workout.
    • Active calories will be based on the data recorded by the heart rate sensor or a brisk walk, whichever is greater.

    Note, however, that the heart rate sensor is likely to give better results for the workouts that involve rhythmic (for example running) rather than the irregular movements.

    More information:

    Use of the workout on your Apple Watch - Apple Support

  • How can you add comodities in Indian currency in finance Bing app?

    Hello

    How can you add comodities in Indian currency in finance Bing app?

    This is a great app, but I would like say gold and money in Indian currency.

    Thank you

    HP

    Hello

    We cannot change the food in Indian currency. They will be always displayed in Dollars.

    However, you can change your location in the application of Finance to get updates in your area. To do this, refer to the following steps.

    a. open finance app, tap/hit Windows key + C.

    b. click on settings, click Options, click on change content and language of app

    c. Select the India English, close the application and open it again.

    I hope the above information helps!

  • How can you add transparency in Dreamweaver

    How can you add transparency in Dreamweaver

    With CSS.

    Opacity of the effects everything including the text.

    {#divName}

    opacity: 45%;

    }

    RGBA backgrounds allow you to set transparency alpha in the last value.

    {#divName}

    background: rgba (0,0,0,0.45);

    }

    Or, for older browsers, using a semi-transparent PNG background image.

    {#divName}

    background-image: url (my_transparent_BG.png);

    }

    Nancy O.

  • How can you add a context Menu to a TableView header?

    How can you add a context Menu to a TableView header?

    I would like to add a context menu to a table header that allows you to select the columns that are displayed in a table. I'll give a list of available columns that the user can select.

    See you soon,.
    Jeff

    You can use tableColumn.setContextMenu (.) to install a ContextMenu in a TableColumn, or alternatively, the functionality you're after is also integrated with TableView by calling tableView.setTableMenuButtonVisible (true).

    -Jonathan

  • How can I add items to the desktop right click

    How can I add or remove items from right click menu

    Hello

    These should help control the right click Menu:

    The ShellExView utility displays the details of shell extensions installed on your computer and allows you to turn on and off easily each shell extension.
    http://www.NirSoft.NET/utils/shexview.html

    Manage the entries in the context menu for files, folders, disks, and objects in the Namespace
    http://WindowsXP.MVPs.org/context_folders.htm

    ShellMenuView is a small utility that displays the list of menu items which appeared in the context menu when you right click on a file/folder on Windows Explorer and allows you to easily disable unwanted menu items.
    http://www.NirSoft.NET/utils/shell_menu_view.html

    How to change or remove items from the right click Menu.
    http://www.WinVistaClub.com/E11.html

    I hope this helps.

  • How can you add text 'language' in a ts file Momentics correctly handles?

    OK leave us...

    How did you add any character outside the range of 7-bit ascii in a ts file and cause the * w? IDE to compile in fact successfully.

    For example an Italian ts file with any what accentuated tanks below the falls in the course.





       
     
          accented_char
          e
     

     

    Analyze the error in the C:/ndk-10.0.4-workspace/XXX/translations/XXX_it.ts:1:38: met badly encoded content.
    Unexpected characters

    Similarlty in a plain English ts copyright symbol file causes the same problem





       


        copyright_symbol
        ©
     


    You can try this version 10.0.6?  I couldn't reproduce it in the updated version.

  • How can you add more fonts

    How can I add more fonts and options?

    You would have to root (on Android) or jailbreak (on iOS) in order to install more fonts. ('Root' and the 'jailbreak' mean basically the same thing, only on different operating systems). I wouldn't say it for the average user because it is very involved, will wipe the folders and documents in the storage of your device and can brick (break) your device and void the warranty of your device.

    Without jailbreak, I think that iOS has AnyFont but your mileage may vary it.

  • How can you add more options of basic research for the Service Profile Configuration Directory profile

    In the CUCM, under Service Profile Configuration.  I created a service profile.  In the profile directory section, I can only have 3 Research Bases.  I have 6 domains I have to link them.  They are in a forest.  How can I extend the search to users?

    It is with regard to the Jabber Clients.  I can't find the users in the second research base.

    IN the LDAP authentication, it allows only 2 additional redundant LDAP servers.  Why not add each of them?

    Thank you

    Cathy

    Hi Cathy,.

    Please take a look at the following link: Jabber - config.xml

    I hope this helps.

  • How can you add additional Google accounts without doing a hard reset?

    I can't add additional accounts of Google. I created another account Google using my PC and I am trying to add from the Menu--> Settings--> accounts--> add--> Google account and by signing then to my new Google account, but it won't let me. It keeps saying "cannot establish a connection of reliable data on the server. I have 3G coverage full where I tried to add the new Google account and tried to add other places as well. I have 'data base' are checked, as well as "Data roaming" within the parameters of the data delivery. I read in another thread that you may need to do a hard reset and then add all your Google represents both. That seems pretty extreme. Are there any other way to add a Google account, once you set up your main Google account days before?


  • How can you add two signatures

    The DC version does not give me that option, but the older version of Acrobat has allowed me to have two different signatures to be applied to the documents I missed something?

    Hi jeanines364,

    If you use the Digital Signature option, then it is possible to have multiple signatures in a PDF document when you have several signs in fields.

    Or if you want to use the functionality available in filling signature & sign app you can simply add a signature and apply it to the PDF format. After that, delete the stored signature and add a new one.

    Thank you

    Abhishek

  • In design mode, how can you add a paragraph after a div?

    Example of the problem:
    1. create a new HTML document
    2. Insert a div tag, insert > layout objects > tag Div
    3. type a few things
    4. How can I now put a paragraph after the Div? Or just get any content inserted after the div?

    I'm competent enough to use Code view, but I plead for a solution in Design mode.

    all the best
    Dave

    Thanks, but it wasn't quite what I was looking for.

    However, the good news is that I just thought about it how do.

    1. Select the div tag (press Ctrl + [a couple or several times])
    2. press once press the cursor right or down
    3 start typing, or press enter

    Beginning to insert after the div. Insert to the place before the left div use or the cursor keys.

    all the best
    Dave

  • How can I add a 'formula' in a table?

    I would like to add an event (or a formula) in a table, but I can't figure out how to do this. Here is the table example again:

    var = personStats { }

    "Jim Bean" : [45, "brown", 70, 175],  

    "Nancy Cardashian" : [36, "black", 68, 122],  

    "Bobby Gentry" : [72, "grey", 71, 165],  

    "Megan Foxx" : [28, "black", 67, 126]  

    }


    I would add this formula event after the (4th entry) weight in each section:

    You forgot the last part:

    Event.Value = personStats [this.getField("Name1").valueAsString] [4] (this);

  • How can I add a value in a table that contains "and other characters

    Dear all
    I have a Varchar2 column and I need to insert some values into it.

    My value is like that contains "."

    Hello: I need "help" (from you); How can I insert this line in a column;
    Insert into abc values ('Hello: i need a 'help' (from you) ; How can i insert this line into a column);

    Insert into abc values (' Hello: I need "help" (from you);) How can I insert this line in a column ");"
    Insert into abc values (Q'[Hello: I need "help" (from you);]) (How can I insert this line in a column]');

Maybe you are looking for

  • How to export a project of photo slideshow to iDVD

    Hello.. I created a slide show of Photos & I would like to export to iDVD. My operating system is OSX El Capitan 10.11.1. After that I click export it has no option to take my iDVD project. Robyn cordially

  • SimplePass allow me not to sign up to ANY fingers

    I have a laptop HP ENVY M6. Last week, my SimplePass, I * LOVE *, started telling me that my finger, to connect to Windows, was not working so I used my password. After countless attempts, I FINALLY got SimplePass to accept my footprint...  BUT, now

  • Is there a way to transfer files from a computer that has no power on a work computer?

    I have a new computer because my old one no longer lights due to a charging problem. The battery only lasts a few seconds, and the old computer does not work on AC. The computer's power cable is fine, it is internal to the old computer. My question i

  • can I transfer my dell xp on mac/parallels or I have to buy a full version?

    iMac and Parallels I have a Dell with Windows XP. I have an iMac and I want to run windows on it through Parallels. Can I transfer my XP for Mac using the switch to Mac? If this is not the case, what I need to improve my windows to windows 7 and tran

  • get the response XML string

    Hello friends, I get an XML response like below. Now, I want to get is the string ' hello world '. How can I retrieve the XML response? I have to change something in the side Server? Y at - it a tutorial for sending xml soap request? Hello World from