Why the hell use nested tables?

Hello
I'm boning up on top of the PL/SQL (again) waiting to get a new job.
I have several years of experience in various roles related to the data, including many used Oracle.
On the issue of collections, I ask myself, in light of my experience, to find and not for the first time, why the hell would anyone want to do this:

create or replace type TEST_TT as table of varchar2(10);
/

create table TEST_TABLE ( X number
                         ,Y test_tt) 
                         nested table Y store as Y_TABLE;                      
I really, really, can't think why we want to store data like that. It seems unnecessarily complex, hiding a one-to-many relationship inside TEST_TABLE, which should rather be modeled and implemented as a separate table.
In addition, there are a lot of tutorials on the collections that tell us how to do the above (in fact I read Feuerstein right now), but nobody seems to tell us WHY we should do it.

Can someone help me out here?

Thank you.
Jason

I can't imagine wanting to create a table like this one either (or, if this can help, can Tom Kyte).

The collections are terribly useful in PL/SQL, when they help you avoid one treatment per line. I can't imagine wanting to integrate into my data model. Frankly, it's much the same with the types of objects - they are quite useful in PL/SQL, but I would never want to create a table in my data model that contained an object.

Justin

Tags: Database

Similar Questions

  • Why the hell I see adds anywhere in the browser, even if I have my ad running block? and why the hell every time I put the default home page, this isn't?

    Hello

    Why the hell it adds every where now? It was not the case before? and why the hell every time I change the home page to be the default, the min that I restart Firefox, it came again on the same silly page I don't know where the hell it came from?

    It was a very pleasant experience to use Firefox, but no more, I still love him his heavy on the machine and stuck a lot lately!

    incident reports NEVER managed to send that I don't know why!

    Come on guys, you can do better than that!

    Hi ajag,.
    Sorry, you have problems, but probably some adware or malware.

    Thank you for including the information system. I'm not familiar with "Vonteera free ads" However, he is apparently adware. Pay attention to the advice, followed by research on the internet I would be, for example, do NOT try the YAC website or tool.

    Using the Firefox addons Manager and Panel configuration remove toolbars unwanted obvious or programs. Then fully analyze up to tools date and multiple.

    Please follow the tips in the link above immediately and then do full scans as shown below in this post.
    I notice that you have a user.js file require separately.
    Post back saying that you tried and what the results were.

    You can try these free programs to search for malicious software that work with your existing anti-virus software:

    Microsoft Security Essentials is a good permanent antivirus for Windows 7/Vista/XP, if you do not already have one. Windows 8 already has integrated antivirus.

    More information can be found in the article troubleshooting Firefox problems caused by malware .

  • Why the hell is it impossible to contact Adobe?

    OK, I'm sorry, but this is totally off the hook. I want to cancel my subscriptions creative cloud because it is not allowing me access my previous purchases of Photoshop and Lightroom, I bought entirely in a software shop. Why the hell am I supposed to pay on top of it, especially when I chose not too? My job is to me using photoshop, and since yesterday I am not js! It's not just your customers, and now I'm sure that I'll never use creative cloud again. Now I just need someone in your Department to get back in touch with me cause this is totally unacceptable!

    Hello

    Thanks for sharing the adobe ID.

    You can please consult the discussion at the link below.

    How we stop to resume my perpetual license CS6 creative cloud?

    Hope this will help you.

    Kind regards

    Hervé Khare

  • Anyone know why the images using the viewer keep appearing behind the thumbnails?

    Anyone know why the images using the viewer keep appearing behind the thumbnails?

    Can you provide a link?

    Probably your best way to do it would be to create your first "lightbox" like a ToolTip by using the ToolTip Widget, and then that way you nest not viewers.

    But if you can provide a link maybe I can think of a better way to do it.

  • Where is the filter of the CC 2014 OIL paint?  Why the hell would they remove?

    Where is the filter of the CC 2014 OIL paint?  Why the hell would they remove?

    If I remember correctly, he uses the PixelBender technology and which has been abandoned.

  • When to use nested Tables vs Varrays

    Nested tables

    When data must be stored in a database table
    When the size of the data cannot be predefined i.e. the collection / data container must be dynamic
    When the dml operations should be made on individual items in the column.


    VARRAY
    When the number of elements are predefined
    When data must be stored in the database

    But when it comes to performance

    Please can anyone suggest some example scenario in which case it is best to use one of them and why.

    Thank you.

    Here is a link that you should try:

    http://www.williamrobertson.NET/reframe.HTML?documents/collection-types.html

  • How to load data from matrix report in the base using ODI table data

    Hello

    How to load matrix report data in the base table data using oracle Data Integrator?

    Description of the requirement:

    This is the data from matrix report:
    JOB                       DEPT10                DEPT20  
    ___________________________ _____________
    ANALYST                                           6000
    CLERK                   1300                     1900 
    Need to convert it to the format below:
    JOB                             Dept                        Salary
    _____________________________________________
    ANALYST                  DEPT10      
    ANALYST                  DEPT20                     6000
    CLERK                       DEPT10                    1300
    CLERK                       DEPT20                    1900
        
    Thank you for your help in advance. Let me know if any other explanation is needed.

    Your list seems to be a bit restrictive, you can do much more with the procedures of ODI.

    If you create the new procedure and add a step. In the 'source' tab command you define technology and pattern according to your source database. Use the unpivot operator as described in the link, please, instead of using "SELECT *' use the column names and aliases for example:"

    SELECT workstation,
    deptsal as deptsal,
    saldesc as saledesc
    OF pivoted_data
    UNPIVOT)
    deptsal-<-->
    FOR saldesc-<-->
    IN (d10_sal, d20_sal, d30_sal, d40_sal).<-->
    )

    Then in your tab 'command on target' defined technology and drawing on your target db, then put your INSERT statement for example:

    INSERT INTO job_sales
    (employment,
    deptsal,
    saledesc
    )
    VALUES
    (
    : job,.
    : deptsal,.
    : saledesc
    )

    That's why you use bind variables from source to load data into the target.

    Obviously if the source and target table is in the same database, you can have it all in a single statement to the "command on target' as

    INSERT INTO job_sales
    (employment,
    deptsal,
    saledesc
    )
    SELECT workstation,
    deptsal as deptsal,
    saldesc as saledesc
    OF pivoted_data
    UNPIVOT)
    deptsal-<-->
    FOR saldesc-<-->
    IN (d10_sal, d20_sal, d30_sal, d40_sal).<-->
    )

    also assign the log count "Insert" on the tab corresponding to your INSERT statement, so that you know how many rows you insert into the table.

    I hope this helps.

    BUT remember that this feature is out in Oracle 11 g.

  • Why the blocks of temporary tables are placed in the buffer cache?

    I read the following statement, which seems quite plausible to me: "Oracle7.3 and generates from close db file sequential reading of the events when a dedicated server process reads data from temporary segment of the disc." Older versions of Oracle would read temporary segment data in the database buffer cache using db file scattered reads. Releases latest exploit heuristics that data of temporary segment is not likely to be shareable or revisited, then reads it directly to a server process programs global (PGA). »

    To verify this statement (and also for the pleasure of seeing one of these rare close db file sequential read events), I ran a little experiment on my Oracle 10.2 Linux (see below). Not only it seems that different this v above, the blocks of temporary tables are placed in the buffer cache, but also$ BH. OBJD for these blocks does not refer to an object in the database's existing (at least not one that is listed in DBA_OBJECTS). Either incidentally, I traced the session and have not seen any file db close sequential read events.

    So, I have the following questions:
    (1) is my experimental set-up and correct my conclusions (i.e. are blocks of temporary tables really placed in the buffer cache)?
    (2) if so, what is the reason for placing blocks of temporary tables in the buffer cache? As these blocks contain private session data, the blocks in the buffer cache can be reused by another session. So why do all cache buffer management fees to the blocks in the buffer cache (and possibly remove) rather than their caching in a private in-memory session?
    (3) what V$ BH. OBJD consult for blocks belonging to temporary tables?

    Thanks for any help and information
    Kind regards
    Martin

    Experience I ran (on 10.2 /Linux)
    =============================
    SQL*Plus: Release 10.2.0.1.0 - Production on Sun Oct 24 22:25:07 2010
    
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    
    
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    
    SQL> create global temporary table temp_tab_4 on commit preserve rows as select * from dba_objects;
    
    Table created.
    
    SQL> alter system flush buffer_cache;
    
    System altered.
    
    SQL> select count(*), status from v$bh group by status order by 1 desc;
    
      COUNT(*) STATUS
    ---------- -------
          4208 free
          3 xcur
    
    SQL> select count(*) from temp_tab_4;
    
      COUNT(*)
    ----------
         11417
    
    SQL> -- NOW THE BUFFER CACHE CONTAINS USED BLOCKS, THERE WAS NO OTHER ACTIVITY ON THE DATABASE
    select count(*), status from v$bh group by status order by 1 desc;
    SQL> 
      COUNT(*) STATUS
    ---------- -------
          4060 free
           151 xcur
    
    SQL> -- THE BLOCKS WITH THE "STRANGE" OBJD HAVE BLOCK# THAT CORRESPOND TO THE TEMPORARY SEGMENT DISPLAYED
    -- IN V$TEMPSEG_USAGE
    select count(*), status, objd from v$bh where status != 'free' group by status, objd order by 1 desc;
    SQL> SQL> 
      COUNT(*) STATUS      OBJD
    ---------- ------- ----------
           145 xcur       4220937
          2 xcur        257
          2 xcur        237
          1 xcur        239
          1 xcur    4294967295
    
    SQL> -- THE OBJECT REFERENCED BY THE NEWLY USED BLOCKS IS NOT LISTED IN DBA_OBJECTS
    select * from dba_objects where object_id = 4220937 or data_object_id = 4220937;
    
    SQL> 
    no rows selected
    
    SQL> SQL> -- THE BLOCKS WITH THE "STRANGE" OBJD ARE MARKED AS TEMP IN V$BH
    select distinct temp from v$bh where objd = 4220937;
    SQL> 
    T
    -
    Y
    
    SQL> 
    Edited by: user4530562 the 25.10.2010 01:12

    Edited by: user4530562 the 25.10.2010 04:57

    The reason to put the blocks to the global temporary table in the buffer cache is the same thing why you put ordinary table blocks in the cache buffers-> you want some of them to be in memory.

    If you ask why don't keep us somehow temporary tables in the PGA - well what happens if this temporary table will be 50 GB? 32-bit platforms cannot even handle this and you do not want a process of becoming uncontrollable so great.

    Moreover, TWG will allow you to restore, back to a backup (or savepoint implied when an error occurs during a call DML), and this requires protection by the cancellation. Place lines / revenge in PGA would have complicated the implementation even further... now GTT is almost of the regular tables which just happened to reside in temporary files.

    If you really want to put data in the PGA only, then you can create collections of PL/SQL and even access through the use of SQL (coll CAST AS xyz_type) where xyz_type is a TABLE of an object any.

    --
    Tanel Poder
    New online seminars!
    http://tech.e2sn.com/Oracle-training-seminars

  • Properties of the object using nested in the dataField DataGrid

    I fill a DataGrid with an ArrayCollection of objects collection. Each of these objects has a property that is itself an object. I want to use a property of the object of the second (or "nested") as a dataField for one of my articles.

    No idea how to make this work? A rendering custom element would be the only way?

    ~ dimival:

    Thanks for the reminder. I use point made almost exclusively, so I forgot about the functions of label. I was able to make it work like this:

  • Why the hell you block flash?

    For a few days, you have been blocked flash for "security reasons." Can not simply give a freaking message and let that be us? Hell, you really want people to leave your for Google Chrome?

    Hello, we support volunteers are not responsible for the blocking of the plugins, but we can help you deal with it if you give us the chance.

    Adobe has released an update today to solve critical problems, he admitted were in the 18.0.0.203 version. You can get 18.0.0.209 on this page:

    https://www.Adobe.com/products/flashplayer/distribution3.html

    In the first table, find the row corresponding to "browser plugin", and you can use either the EXE or the MSI installer.

    No one can promise that this kind of block will never happen. If that happens, if you are not accustomed to using the "Request to activate" feature a plugin, here's what to expect:

    When you visit a site that wants to use the Flash, you should see a notification in the address bar icon and one of the following: a link in a black rectangle in the page or an information bar slides between the toolbar and in the page area.

    If you see a good reason to use Flash, and the site looks trustworthy, you can go ahead and click on the Lego-like icon in the address bar to allow Flash. You can trust the site for the time being or permanently.

    But some pages use Flash only for tracking or play ads, so if you do not see an immediate need for Flash, feel free to ignore the notification! It will just sit there in case you later want.

  • Why the coldfusion costs number tables and dates from 1

    Why is coldfusion number tables and other structures of 1. Its pretty exasperating when the rest of the world for the most starts at 0?

    Zero base tables are a legacy from the time of the system who need to work on the address offset base memory table is stored to locate the starting address of each element.  So it makes a little sense that the first element is offset from the base address by a factor of zero.

    There are languages that predate C (where the C++ germinated some sort of horrible nightmare) that using 1 that the marketing of the index... it is just C has been reduced to minimize the translation of C code machine, and in this case 0 is more logical.  And other languages 'hug' just copied.  It is - in the modern era in which the source language is usually so far away from the machine language - illogical to persist with this kind of approach for one good reason other than to copy makes another language.

    On the human level, there is not a zero element in a collection, and because it is not really a treatment save one more just to start the table to a position more respectful man, why not?

    I mean... How confusing is really remember what language is that?

    --

    Adam

  • Why the hell don't lightning let me import .ics file in my current schedule?

    I'm starting to regret using Thunderbird and Lightning rather than Outlook. At least Microsoft was smart enough (for once) to allow an appointment stored in .ics file to import into my calendar. Lightning requires me to create a new calendar for a single date. That's all just stupid. At the time wherever I'll be back with a doctor/dentist appointment, there is already an email with a file .ics with relevant information on my next appointment already sitting in my mailbox. I can't do anything useful with it without going back to Outlook.

    Looking for a way to do what I want to tell all go to file-> new-> calendar. I don't want a new timetable for this. I don't need a separate calendar for each single event/appointment. Intuitively, they should all be able to be imported into the calendar of my choice. At the time when physical calendars were the way this was done, you (or your parents) buy a new calendar for every appointment, day of vacation, meeting, etc., you had? Why should it be different for electronic calendars?

    If you use the instructions above to create a new calendar, you will get a new calendar.
    If you try to add an event, then you will use the import option on the tab events and tasks.
    I also read that you can drag and drop the file in the component today but I've never tried.

  • Why the values in a table get deleted once completed VI?

    I have a weird problem with my code. I have a 2D array that receives the data via a connection series microcontroller. My VI search this table for a specific value, and when this value is found, it goes to another part of the code. The problem is that when I run the VI mulitple without closing times, the data in the table not get deleted so the value resulting in the VI move is immediately and the first part of the VI is ignored.

    I have to do something to ensure that all data are deleted after a full run?

    Thank you

    Without seeing a VI, we can only guess.

    My guess is that your code uses shift registers and these shift registers are not initialized.

  • What are the APIs used or tables of the interface used for the conversion of the Bank

    Hi all

    Please let me know if there is no table interface or api used to make the conversion of the Bank in r12.

    Thank you

    There is no interface for the Bank conversion table in r12, but you can use APIs such as: CE_BANK_PUB. CREATE_BANK, CE_BANK_PUB. CREATE_BANK_BRANCH, CE_BANK_PUB. CREATE_BANK_ACCT, ce_bank_pub.create_bank_acct_use etc...

  • Transpose the text column of the Oracle using ODI table

    Here's what I'm trying to do:
    Source table that contains the columns:
    Time, Blob, Item-ID

    The expected target has the columns:
    Time, data, Item1, Item2. ItemN

    1. where Item1, Item2 are as shown: say for example the source table has 10 rows of different IDS, there are 10 columns in the table target from Item1 to article 10. (Assuming that no. different IDs are fixed)
    How to do this? I learn ODI for a few weeks now. Understand the basics and terminology, I don't know how to do this.

    2 data (the target table) is a return value from a stored procedure that would transform the Blob (of the Source table)
    The stored procedure is ready, but how do you use the procedure to get the target to the source.

    Any help/direction would be greatly helpful.
    -Vincent

    Published by: user12397263 on December 29, 2009 23:53

    1. a question: How do you who would determine row goes to which column? You can say that the 1st line value becomes item1, but without a rank ORDER 1 will always random. If you have a way to ensure the order of the rows (say, a column that can store the rownum) then what you need is in the interface, you specify for n - th element mapping must be MAX (Case when n = rownum then point else ' ' end). Who should take care of it.

    2. There is a way to do this in ODI. Because you are a beginner, I would recommend that you create a temporary table and you use a PL/SQL block to generate data of BLOB and serve another table of the source that can update the column of data in the temporary table target table.

Maybe you are looking for

  • Problems with App Store

    I was gifted with a very old iPad (I think that generation 1) and its max OS is 5.1.1. I asked for the iPad to play a game that is not sync with the cloud that I had saved on the tablet. The app now needs an update, but even if I went to App Store ID

  • A30 satellite itself stop

    System:IT WinXP sp2Toshiba Satellite A30, P4 2. 4 GHz: it XP sp2, NTFS Phoenix NoteBIOS 4.0 release 6.0, 478 MB RAM Page file: 330 MB used, 788 MBavailable, DirectX 9 .0c (4.09.0000.0904) Video Intel (r) 82852/82855 GM/GME Graphics Controller - displ

  • Camera Skype problem

    Registered with Skype, camera tested it worked I saw me, but when placed the call that they couldn't see me. camera icon was not on Skype screen. I could see and hear the caller, but they couldn't see me. My eye motion sensor light camera tested new

  • Reference stored in shift register

    Hi, I'm having trouble with references. The LabVIEW Wiki reads control references (http://labviewwiki.org/Control_References) are the right way to switch the user interface elements in subVIs. So, this is the path that I took. I have this ActionEngin

  • Error with 2 Daq assistant

    Hello Another noob to join the community. Here's my question. What I am doing wrong? I use 2 assistants for the acquisition of data on the module of NI9401 for output and input digital. I use it to generate signals of 2. If I test with 1 it works but