Approach & understanding of collection

Hi all

I just want to understand more about the use of the Collections and approach since I'm working on it, for the first time.

Created a procedure and an example of a table to compare several values returned, added comments in Proc where I need some pointers and advice.

Also should I go with collections of cases below:

Example of Table *.

Select "kallis '""Player_Name,"BATTER"Skill of double

Union of all the

Select "kallis '""Player_Name, 'BOWLING' Skill of double

Union

Select "McCullum" Player_Name, "FLEECE" Skill of double

Union

Select "Steyn" Player_Name, 'BOWLING' Skill of double

CREATE OR REPLACE PROCEDURE GET_PLAYER_TYPE

(P_NAME IN VARCHAR2, OUT VARCHAR2 P_TYPE) AS

TYPE charTable TABLE IS OF VARCHAR2 (1000);

Player_Type charTable;

BEGIN

Select the Player_Type skills of

SAMPLE_TAB where Player_name = P_NAME; / * Is this way it is Incorrect? * /

If Player_Type IN ('STICK', 'BOWLING') / * how to retrieve data and compare? * /

then P_TYPE: = "ALL ROUNDER".

on the other

Player_Type IN ('STICK')

then P_TYPE: = "DRUMMERS."

on the other

Player_Type IN ("BOWLING")

then P_TYPE: = "MELON";

end if;

END GET_PLAYER_TYPE;

/

I guess it's just for learning purposes:

CREATE OR REPLACE

PROCEDURE GET_PLAYER_TYPE)

P_NAME IN VARCHAR2,

P_TYPE OUT VARCHAR2

)

AS

TYPE charTable TABLE IS OF VARCHAR2 (1000);

Player_Type charTable;

BEGIN

Select skills

Bulk collect - you must use bulk collect

in Player_Type

of SAMPLE_TAB

where Player_name = P_NAME; / * Is this way it is Incorrect? * / - Yes, that is correct

If Player_Type = charTable ('BATTING', 'BOWLING') / * how to retrieve data and compare? * / - you compare collections

then P_TYPE: = "ALL ROUNDER".

elsif - elsif, no other

Player_Type = charTable ('BATTING')

then P_TYPE: = "DRUMMERS."

ELSIF

Player_Type = charTable ('BOWLING')

then P_TYPE: = "MELON";

end if;

END GET_PLAYER_TYPE;

/

Now

Player_Type = charTable ('BATTING', 'BOWLING')

checks if a player has just two skills. If you want to check if the player has two skills among all player's skills, that you can use

CharTable('BATTING','BOWLING') Player_Type MULTISET INTERSECT = charTable('BATTING','BOWLING')

SY.

Tags: Database

Similar Questions

  • Need help to understand the collection

    Hi all

    I'm trying to understand the concept of collection, but when I look in the documentation that exists in google.ca, then, it seems very confusing. If someone suggest me or send me some simple examples and good collection and I really appreciate it. Thanks in advance.

    Concerning

    Line

    Thanks for the explanation, could you please explain what does really to take care of the index as a whole and clause varchar2 and if yes then what condition we use varchar2 index and in which condition we use index as a whole, be we just use index by integer in our daily practice. Really appreciate your response. Thank you

    Generally if you use collections, especially PL/SQL-only collections, your architecture is probably wrong. Collections are rarely necessary, but are often USED in the mistaken belief that they will help performance.

    The use of the collections usually DEGRADES performance, sometimes severely, and they are often used in a way that is not scalable. You should avoid using collections if possible.

    So don't use the collections AT ALL in your 'common practice '.

    For the rare cases where there is to use an array associative index type to use depends on the data type of the element that you will use for the index. If you plan to use a string, then you use INDEX OF VARCHAR2. If you plan to use an integer, then you use INDEX BY PLS_INTEGER.

    What type of index to use has NOTHING to do with performance.

    One of the WORST mistakes developers make is to use an associative array as target of a BULK COLLECT INTO instead of using a TABLE IMBRIQUEE. Collection in bulk is more often used in a FORALL statement so that the elements are accessible only in the order. Useds "indexed" access with associative arrays isn't even necessary or used.

  • Basic questions about the Permanent Collections

    I'm learning just on Collections, discover that a Collection preserves all the work I did in the collection. So, I guess that the images of a collection are virtual copies which can be adjusted in the develop Module, with the difference that they appear in the catalogue under the imported original files. I suppose also that a changed image can be locked to prevent other changes, say if another virtual copy should be made.

    I understand that Collections should be protected somehow, for example if I have a collection with images adjusted to look good on the web, and another collection of the same images adjusted to the for look good, using a certain printer.

    Maybe I'll ever need adjust the images for different applications, except outside of Lightroom for applications in the CMYK offset printing. As different settings for the slideshow, Web and print can all be contained in a collection, it would probably be best to use the same images, without changing the images for each output.

    Some of you who have more experience can add thoughts here about how best to use the Collections. My goal is to keep things simple.

    TIA,

    Ken

    Ken-

    Put an image in a Collection made not a virtual copy. Either you have to have VC to reside in a Collection. These distinctions may be among the most important! Can I suggest that run you a few tests with VC in and out of the Collections?

    Best wishes

  • Favorites missing username

    I upgraded to Yosemite a few months to get used to it.  I had to open a new finder window and click on my user name in the bookmarks bar (username being the route to almost everything I use really; the rest is by default, except for a strange couple shared items that I have no idea how they got there).  I must have accidentally hit keyboard the wrong way and with an audible Ottoman (cloud of smoke?) my user name had disappeared from the Favorites bar.  I don't understand how collect, or how to find what anyone without him.  Fortunately, I already had a few other open finder windows but I notice that now the directory does not further back than [Documents of Miz V].  I remember well, this folder resides in my user name folder.  I'm afraid that once I restart I won't be able to find whatever it is [(depuis le début d'utiliser Yosemite j'ai eu la chance pauvre avec recherche Spotlight – il semble Rechercher les fichiers, mais pas leurs voies/annuaires).]  Yikes!  "I hope someone can help.

    Try EasyFind I find it much better than Spotlight. When you find it, just drag it to the Favorites bar.

    http://www.DEVONtechnologies.com/products/freeware.html

  • LaserJet M451: Assembly output duplex

    I have a Laserjet M451, and I like it.  But, I can't understand how collect the copies.  I just print a document of 34 pages, two copies, duplex, and I had 1, 2 Pages and then the Pages 1, 2 again, then two copies of pages 3, 4 and so on.  So now I have to manually separate into two copies.

    Yes, I know that I can print the same document in two different moments.

    However, never in reputable printer maker offers an option of "gathering" in the software, so the software will collect and print a full copy, and print the next and so on until all copies are printed.  Then are then correctly numbered.

    There is no mention of "gathering" in any help document that I can find.  Is the missing functionality that will make me to tell my clients to avoid this printer and its "software?

    The User Guide manual for printers Laserjet Pro 300/400 M351/M451 indicates there (should be) a Collate box in the dialog (Windows) Print :

    I don't have Windows 7, so I can't confirm this.

    On my Windows 8.1 Pro 64-bit system, the dialog print for my LaserJet Pro MFP color 400 M475dn (Variant multifunction printer M451 ) fact include such a box.

    A point to note: with some printers (offhand, I don't know if this applies to M451/M475 models), the ordering method depends on whether or not a hard drive is mounted on the camera.

    • If one is fitted, the printer driver needs to send the job to print once, with a PJLcommand (working level) to produce ' is best. the printer stores the job on the hard drive and print copies from there.
    • If it is not available, the pilot must send all the work print ' once (unless it's just a job of the leaf), since it is highly unlikely that a work of several sheet can be stored in its entirety in the RAM of the printer.

    With this mechanism, the printer driver must obviously know (through automatic detection, or through manual property settings) or not a hard drive is mounted on the device

  • GROUPING OF NICS ESX

    I need to understand the collection of NETWORK adapters so I can understand the flow of traffic and models and failover.

    Bare with me if I ask very simple questions...

    The scenario I have in mind is a blade server, but I guess that the question applies to any server. So for simplicity, lets use servers in a rack mount...

    Suppose a half rack with 2 network cards that are associated with one of the 3 grouping mechanisms used in ESX. With the consolidation of NETWORK cards, there's never a physical NETWORK card that is inactive, correct? According to oither, two interface cards physical network in the team will have traffic passes through them - IE the load balancing/sharing. Isn't it?

    vmware forum.jpg

    Based on hashed IP NIC teaming will most likely a simple VM with a unique vNIC to use two physical network cards (depending on the workflow). And although based on the port and on MAC do not allow a virtual machine to use two physical network adapters, it will very probably an ESXi host with multiple virtual machines to use two physical network adapters. Therefore, any type of grouping of NETWORK cards is used, it is very likely that the physical NIC in the team will be forwardign traffic - perhaps at different levels, but nevertheless, both will be active.

    Yes, both the natachasery in the team can be active according to the flow of traffic and the grouping policy. Even if a single virtual machine cannot use several uplinks if it is configured with at least 2 cards policy network based on the Port and MAC. With IP-political Hash, it is possible for an adapter single virtual machine to use multiple uplinks if the destination addresses are different. Addition to these is LBT (as Andre mentioned), it will monitor uplinks and if one of the uplink is saturated (greater than 75% by default), it will move the virtual machine to another uplink traffic.

    Apart from the docs shared by others, I suggest you to watch pt.3 of "Great VSwitch debate"... I found it very useful for me.

    http://kensvirtualreality.WordPress.com/2009/04/05/the-great-vswitch-debate%E2%80%93part-3/

  • Determine the use of the instance

    We have a replicated environment up and running, was designed to provide a location for performing low priority queries in order to discharge this load on one server other than the database of production.

    I am asked to determine how often and to what extent, this database is used. Essentially, if it is grossly underutilized, we seek to get rid of it, or find another solution. Is there a common approach for the collection of these types of settings? Should I be poking around in OEM for that? Or, should I be building something that periodically seizes the usage information and stores it in an array?

    Thank you
    -= Chuck

    I could something put in place with the triggers of opening and closing of session and eventually connected the track time and gets consistent from closing session or something.

    You can do it.

    I was wondering if there was something that we already had.

    StatsPack
    schedule a task to run every hour.
    create tablespace with couple of GB size because it fills the space quickly.

  • Record type.  Display the entire register with DBMS_output.putline

    Hello. I have the following code, I've played with to better understand the Collections. I have a 'how' question. Is there a way to dbms_output.putline a complete file or I have to name each column as I began to do in the code below?

    If there is no single statement to display a record, is it a good way to dynamically loop through the registration and use of dbms_output.putline for each output column without having to name each column explicitly?

    Thanks much for any help.
    DECLARE
    pc_info_rec performance_clusters%rowtype;
    
    CURSOR C1 IS 
         SELECT * 
         INTO pc_info_rec
         FROM performance_clusters 
         WHERE rownum < 11; 
    
    BEGIN
         OPEN C1;
         LOOP
         FETCH C1 INTO pc_info_rec;
         EXIT WHEN C1%NOTFOUND;
    
                    -- Currently have to name each column in the record, but would prefer a simpler way to output the entire record
              DBMS_OUTPUT.PUT_LINE (pc_info_rec.pc_code||', '||pc_info_rec.zip3);
    
    
         END LOOP;
         CLOSE C1;
    END; 
    /

    You can not 'loop' in the columns folder. You must list the columns individually. As I already mentioned, if you need display case in many places, you can create a procedure (you don't need a package as I suggested earlier):

    SQL> create or replace
      2    procedure print_dept_rec(
      3                             p_rec dept%rowtype
      4                            )
      5      is
      6      begin
      7          dbms_output.put_line(p_rec.deptno || ', ' || p_rec.dname || ', ' || p_rec.loc);
      8  end;
      9  /
    
    Procedure created.
    
    SQL> set serveroutput on
    SQL> DECLARE
      2      v_rec dept%rowtype;
      3      CURSOR C1 IS SELECT  *
      4              FROM  dept;
      5  BEGIN
      6      OPEN C1;
      7      LOOP
      8        FETCH C1 INTO v_rec;
      9        EXIT WHEN C1%NOTFOUND;
     10        print_dept_rec(v_rec);
     11      END LOOP;
     12      CLOSE C1;
     13  END;
     14  /
    10, ACCOUNTING, NEW YORK
    20, RESEARCH, DALLAS
    30, SALES, CHICAGO
    40, OPERATIONS, BOSTON
    
    PL/SQL procedure successfully completed.
    
    SQL> 
    

    Obviously, you will need to create a procedure for each record type.

    SY.

  • I got a license number for Adobe Master Collection from my school (Stevens Institute of Technology) and I can't understand how to use it to obtain the product. I created a user name and this is as far as I'm away.

    I got a license number for Adobe Master Collection from my school (Stevens Institute of Technology) and I can't understand how to use it to obtain the product. I created a user name and this is as far as I'm away. I need to download the product and I may not know where to start.

    Ask someone to your school... You have a Cloud redemption code, or a number of series CS6?

    If cloud, http://helpx.adobe.com/x-productkb/global/redemption-code-help.html Redemption Code and

    http://www.Adobe.com/products/creativecloud/FAQ.html

    http://helpx.adobe.com/creative-cloud/help/install-apps.html to install or uninstall

    http://forums.Adobe.com/community/download_install_setup/creative_cloud_faq

    What is http://helpx.adobe.com/creative-cloud/help/creative-cloud-desktop.html

    To start https://helpx.adobe.com/creative-cloud.html the Cloud

    If CS6, download to other downloads and enter your serial number when prompted

    Once again, your 1 resource is your school

  • Can you help me understand a better approach?

    I'll try to keep this as short as possible (to get answers as much), but give you enough information so that you understand my situation.

    First of all, I'm on ColdFusion 9 with IIS 7.5 on Windows 7 Pro x 64.

    In my application.cfc (app.cfc) the only code I have outside of methods is a simple < cfif isDefined ("application") > get a < cfelse > B < / cfif >.  I have the intent of this code to do is to determine when the first call to demand is made vs. when calls are made (after that the application has already been initialized).

    If the application is not yet initialized, it simply creates a myIdName variable (to ensure conflict with other applications, it chops the path of current model) and defined a treatment with CFSETTING directive.  He then, to my knowledge, goes to SystemFramework (OAS), which loads a file config.ini.  This configuration file has a series of keys that begin with appVar, are separated by a '.' and end with a key name that corresponds to a variable in the THIS scope.  For example:

    appVar.sessionManagement = true

    appVar.sessionTimeout = createTimeSpan (0,0,30,0)

    Once the OAS analysis this, it load these settings in the application scope so that a key of APPLICATION.appVar.sessionManagement (and so on) exist.  Well, is where the problem begins.

    As you may know, at this point, CF work so by other methods in the order as usual, but through this initium, the appVar settings that I pulled from the configuration file are not addressed in THIS application-scope settings.  To my knowledge, I can't be in the OAS (or any other method in the app.cfc) and define THE scope of variables (THE scope of the app.cfc, not the app.cfc of executing method).  If the request moves to the front, but didn't need to THIS set of scope settings which have been drawn from the config.ini file.

    SOLUTION POSSIBLE?

    I thought that if after the OAS works I could use the CFLOCATION for re - ask the current URL, and then when that initial CFIF isDefined ("application") the code fires AGAIN, it will run then the ELSE, that will iterate through the APPLICATION.appVar structure and actually defined in the THIS scope (outside), correctly giving the application it is associated with CF settings.  Problem is that I can't intercept the flow method.  If I use CFLOCATION before the CFRETURN REAL of the OAS, the application never starts, and it will not process the audit of the FI.

    I hope I explained it well enough.  Does anyone have an idea (Please NOTE: the solution MUST allow to load me in settings THAT range from a file config.ini rather than having hard-coded them in the app.cfc).  I look forward to hear from you.

    First of all, I'm not sure that your approach to set the property myIdName to the inside if block works the way you want.  It is my understanding that the code outside any method in the Application.cfc file is intended to be run whenever a template is executed.  And that the myIdName property is intended to be set each time.  It is not part of the persistent normal litters.

    At least that's how it used to work and how I contintue to use.  I put it simply:

    
    

    I think that you CAN actually set "this" scope in the Application.cfc methods properties.  "Thie" the scope of the Applicaiton.cfc, no matter which component referred to the scope of the public property of the component that is used in a method or not.  It does not refer to a different scope within the method that is private or local to just the method.  Even in the scope of "variables" referring to all private components properties.  We should use the "local" scope, or before the CF9, to use unscoped variables that had been initilized with the "var" keyword in the method to access the local scope to just the method.

    But you pouvez some work two hard.  There is nothing which prevents to use the code in an INIT file in the constructor of pseduo (i.e. a code outside all methods) of the Application.cfc component to read your INIT file and set the scope properties 'this' as you wish.  In the case of good practices or not really depends on what you're trying to do and if it must be done with each model call or just a first.

  • Best approach - whether to return Collections or the Ref Cursor?

    I have the table that the column is a nested table (column address) type. Now, I want to fill the same
    in a jsp page.

    As his collection type I am thinking to send variable Collection to front-end. And most of java professionals
    argue that the collections are the best approach.

    But here, in a lot of posts, I read that collections at the front end is the worst approach and it degrades performance
    and increases the load.

    But java assert that even if connection fails they can always display the data as the data set is with them
    How to get a set of results COLLECTION.

    As ref cursor is just a pointer to the real cursor lies in the comics... they're going to make one record of the other instead and once the connection is lost... they can no longer display the data. This assertion seems
    to be reasonable!

    How you condemn it? and prove ref Cursor is good way?


    Here's the example scenario that I have with me.
    create type t_adress is object(t_h_no varchar2(500),t_pin_code number);
     /
     
     create type t_address_tbl is table of t_adress;
     /
     
     create table r_dummy (emp_name varchar2(200),emp_id number,emp_address t_address_tbl)
     nested table emp_address store as emp_address_tbl;
     
     insert into r_dummy values('raghu',1,t_address_tbl(t_adress('598',500035),t_adress('600',500036)))
     
     insert into r_dummy values('raghu nadh',2,t_address_tbl(t_adress('598',500035),t_adress('600',500036)))
    Using the Collection
    Create or replace procedure p_using_col
     (
     p_emp_id          in     r_dummy.emp_name%type,
     p_emp_dtls          out     t_address_tbl
     )
     is
     begin
              Select     t_adress(cl.t_h_no,cl.t_pin_code)
              bulk collect into p_emp_dtls
              from     r_dummy,table(emp_address) cl
              where     emp_id = p_emp_id;
     
     end;
     /
     
     set serveroutput on;
     declare
              l_emp_id          r_dummy.emp_name%type := 1;
              l_emp_dtls          t_address_tbl;
     begin
              p_using_col(l_emp_id,l_emp_dtls);
              
              for i in 1..l_emp_dtls.count
              loop
              
                   dbms_output.put_line(l_emp_dtls(i).t_h_no);
              
              
              
              
              end loop;
     
     
     end;
    Using Ref Cursor
    Create or replace procedure p_using_ref
     (
     p_emp_id          in     r_dummy.emp_name%type,
     p_emp_dtls          out     sys_refcursor
     )
     is
     begin
              Open p_emp_dtls for
                   Select     cl.t_h_no,cl.t_pin_code
                   from     r_dummy,table(emp_address) cl
                   where     emp_id = p_emp_id;
     
     end;
     /
     
     set serveroutput on;
     declare
              l_emp_id          r_dummy.emp_name%type := 1;
              l_emp_dtls          sys_refcursor;
              
              l_h_no               varchar2(500);
              l_pin_code          number;
              
              
     begin
              p_using_ref(l_emp_id,l_emp_dtls);
              
                   loop
                        fetch l_emp_dtls into l_h_no,l_pin_code;
                        
                        exit when l_emp_dtls%notfound;
                        dbms_output.put_line(l_h_no||'    '||l_pin_code);
                   
                   
                   end loop;
              
                   close l_emp_dtls;
     end;
    Concerning
    RUSSO

    RUSSO says:
    I would like to know what really happens behind the screen IE in PGA... when we return collections...

    A collection is a PL/SQL variable. Like all PL/SQL variables, it resides in the global area of the server process that executes PL/SQL code. This memory is part of the process the process's private memory.

    If need more memory, more memory server be malloc' ed by the process.

    As he is dedicated and private memory, no other process can reap the benefits of this memory in use. It is not 'ideal' - shared memory however benefits all the processes that are involved in sharing that allocated the memory. As is the case with the SGA

    How long my set of data will reside in the PGA? He immediately fade after returning to the calling procedure? and how it degrades performance. Help me with a good link.

    Assume that you create a collection of 10 MB. The process server malloc' ed 10 MB of server memory. The PGA has thus extended.

    When your code executes the variable usage (it is out of reach of runtime), the PL/SQL engine can theoretically free up 10 MB of memory. However, it may have allocated 4 KB memory after this assignment of 10 MB. Only 4 KB is still in use. This moment results in that the process cannot shrink its allocated memory - as this free piece of 10 MB is slapbang in the middle of the used memory space.

    PGA memory is 'expensive' because it's not shared memory is private, with only the current process. PGA in memory is not so easy to decline. Memory management is a complex issue and you who ceases to use a large part of the PGA memory almost never means that this memory suddenly become free and available for other processes to use.

    Also, you have to ask yourself why you want to copy data from disk blocks into the SGA buffer (for SQL procedures) cache, then copy these data blocks of APG in the PGA (using a collection and extraction in bulk) and then copy this PGA memory on the network to the client process (TOAD or .net or Java or whatever).

    It's a lot of moving parts - which increases the complexity, lowers the performance and scalability and ups the risk of something going wrong due to the increased complexity.

    It is much simpler and much stronger, to maintain the number of moving parts to a minimum. For example to copy data directly from cache buffers of the SGA to the customer via a ref cursor

  • Intervals of collection for the IC Agents

    Hi all

    Not sure how many of you are on 5,6 and use the cartridge of the Infrastructure. Does anyone know if it is possible to set different collection interval for different indicators? We are ok to collect measures of performance (CPU/memory/process, etc.) every 5 minutes, but we want to collect EventLog and Services every 1 min, we used to be able to do it with the old cartridge to OS, but with the new cartridge Infra, I couldn't quite understand how.

    Thank you

    Xiaoning

    It is not possible to do so today with a single agent. The HostAgent uses a calendar of unique collection for all the measures that it collects. You might approach creating two agents - a to collect metrics based on the frequency of 5 minutes by default and the other to collect only events and services according to a schedule of 1 minute. I filed an enhancement request to consider separate in a later collection times.

    Message edited by Stuart Hodgins to correct typos.

  • On bulk collect forall vs fusion simple statement

    I understand that a single DML statement is better that use bulk collect to have all the intermediary undertakes. My only concern is that if I load a large amount of data as a record 100 million records in a 800 million table with foreign keys and indexes and the session is killed, the cancellation may take some time which is not acceptable. Using bulk collect forall with interval of validations is slower than a declaration unique fusion straight, but in the case of dead session, the restore time will be not too bad and a reload of the not yet committed data will be not as bad. For the design of a load of recoverable data which may not be affected as badly, is in bulk collect + for all the right approach?

    So if I chunk it upward in 50 lines, the child table must be loaded to its matching when records the parent table loaded and validate them.

    ... and then create a procedure that takes care of the parent AND child data at the same time.

    SQL for DBMS_PARALLEL_EXECUTE would be:

    "start load_parent_and_child (: start_id,: end_id); end; »

    PS - you don't want to run ECD and DML PARALLEL at the same time...

    MK

  • What is the difference between pls_integer index and index of directory for a collection?

    Hi all

    I have a bit of difficulty understanding the difference between pls_integer and directory when you declare a collection...

    Is not so much pls_integer than the supposed to be the same in 10g and 11g?

    My problem is that I've declared a collection in a procedure with directory and by record type, it takes 10 seconds to process. (IE TYPE test_table IS the TABLE OF test % rowtype directory INDEX ;))

    However, the same procedure with the declared collection with index of pls_integer, take only 1 second to process. (IE TYPE test_table IS the TABLE OF test % rowtype INDEX BY PLS_INTEGER ;))

    Any help would be welcome.

    Thank you.

    MichaelR wrote:

    I don't understand when say you not to use DML in a LOOP and use sql only. Can you please give me an example?

    I usually of code like this:

    1. I'm looped slider
    2. Update table_name
    3. the value of col1 = i.rec1
    4. where col2 = i.rec2;
    5. end loop;

    This approach is incorrect.

    All SQL is parsed and executed as SQL cursors. There is no such thing as use SQL or cursor.

    A cursor is a "compiled SQL program. Source SQL that has been analyzed in a cursor executable code. When you retrieve the cursor, you push the button the cursor or program execution. It finds a row and return lines. He's on a break. You get the rows returned, these processes and then click the button run the cursor using fetch. Until the cursor/program finds no additional data (or he faces a snapshot too old for example, where it can not rebuild a coherent reading to find the next set of lines).

    A cursor is and has never been a set of cached data in memory that you are recovering from.

    Take a look at your code. You use a slider/program to retrieve data from the database. For each row in the cursor returned, you call another slider/program and pass this line as input data.

    It's slow. Data line moves a cursor to your PL/SQL code, and then again from your PL/SQL code to another cursor.

    A single slider that makes the reading (the SELECTION cursor) part and the part of writing (the slider to UPDATE), requires no PL/SQL to read and write the parts together.

    How to write this unique SQL cursor? You can use:

    UPDATE (SELECT... Of... JOIN THE... WHERE...) SET...

    You can use the MERGE statement. Or maybe just a statement UPDATE simple vanilla.

    What is the problem of a conceptual, performance and scalability point of view, is the approach that you have indicated above. That approach will ALWAYS be slower than just SQL. This approach cannot scale.

    The mantra of performance for Oracle is simple: Maximise SQL . Minimize the PL/SQL.

    Use the SQL language correctly and properly. Do not what SQL is designed to do, in PL/SQL.

  • Question about the Type of SQL equivalent Collection Oracle

    (1) I read documentation collections oracle, can I know why the 'STORE AS' clause is used only when creating the table, but not when the object creation?

    Table:

    CREATE TYPE CourseList AS TABLE OF VARCHAR2(64);
    CREATE TABLE department (
      name     VARCHAR2(20),
      director VARCHAR2(20),
      office   VARCHAR2(20),
      courses  CourseList)
      NESTED TABLE courses STORE AS courses_tab;
    

    Object:

    CREATE TYPE CourseList AS TABLE OF VARCHAR2(10)  -- define type
    CREATE TYPE Student AS OBJECT ( -- create object
       id_num  INTEGER(4),
       name    VARCHAR2(25),
       address VARCHAR2(35),
       status CHAR(2),
       courses CourseList)  -- declare nested table as attribute
    

    (2) also can I know what is the difference between OBJECT & RECORD?

    My understanding is that the OBJECT is entity sql where you create and store data in this document, while the RECORDING is PLSQL entity where you group different types of data elements in one?, hope you can give me an example to better understand.

    Thank you.

    Ariean wrote:

    (1) I read documentation collections oracle, can I know why the 'STORE AS' clause is used only when creating the table, but not when the object creation?

    Fix. The column of the course are (similar to an array) collection type. This requires a "nested table" for this column store the list of the values in this column.

    This approach however is an exception to the rule - as it flies in the face of robust and sound design mathematically, relational.

    (2) also can I know what is the difference between OBJECT & RECORD?

    A record is similar to a struct in C/C++. A record contains one or more fields/variables. It's a basic structure for the creation of a 'container of variables' and by the way this container between code units, as oppose to pass individual variables. It is also the basis for the creation of intelligent data structures in structured programming. For example an IP socket structure is a unique smart container consisting of items/variables such as socket, protocol family and type, flags address and so on.

    It is a standard feature in most (if not all) of the structured programming languages - C / C++ and Pascal, Cobol and Visual Basic. PL/SQL is based on the Ada language - and like other members of language (including Pascal), PL/SQL uses the word registration reserve to set a record structure.

    Objects are created in Oracle using the "create or replace type... as object'clause. The correct term is an object oriented class. This differs from a record as a class has data and code. Unlike a record that counts only data.

    Given in a class are called properties. The code of a class is called methods. There are different types of member methods and methods such as the static class constructors, destructive methods.

    Oracle class object is defined using SQL. (Methods) code of this class is set using PL/SQL.

    The classes also supports features like inheritance. Allowing a child class extend the implementation of the parent class. This is not supported by a record structure, beyond a structure that contains another structure as a field attribute. Classes supports the substitution in a child class, the methods of the parent class. As records are composed only of data and not code, there is nothing like ito feature for structures Records.

Maybe you are looking for

  • Audio Hum on Satellite P750

    I just bought (24 hours) a P750 with Harmon Kardon speakers. Great sound, except that every minute or so there's this loud buzzing, crackling, electronic that goes on top of the audio.It seems to coincide with the little glitches in video as well. It

  • HP Mini 210-2145dx for windows xp drivers

    Hello can someone please let me know what should I divers I need to install HP mini 210-2145dx with windows xp professional sevice pack 3 wireless, lan, chipset, mouse, audio etc. thank you in advace for alll your help.

  • Corrupted recovery disk &amp; battery bad health

    Laptop model: HP Pavilion 15 (ENERGY STAR) ab288sa OS: Running Windows 10 Home (x 64-bit) RAM: 8 GB HARD DRIVE: 2 TB [personal information] Product no.: P5P67EA #ABU Bought: UK Currently using: Sri Lanka My laptop is slow although it has 8 GB of ram.

  • Hard drive was named as a backup drive. How to change the designation?

    Some how my hard drive was named as a backup drive. This prevent me to upgrade the operating system. How can I remove this designation without losing the information on my hard drive? The machine is iMac mid 2011. Thank you

  • need windows xp sp3

    I need to install windows xp sp3