Can you record for an object of TYPE input COLLECTION and use it as a table?

My PL/SQL stored procedure creates a list of employee number and phone record numbers. I don't want to store them in a table. I will pass this list from one procedure to another in my package.

I created the type (folder) and type of collection (table) using this statement.
CREATE TYPE obj_emp_phone_rec AS OBJECT
  (
     emp_number   NUMBER,
     emp_phone    VARCHAR2(100)
  )
/

CREATE TYPE obj_emp_phone_recs_table AS TABLE OF obj_emp_phone_rec
/
Thing is, can I use the obj_emp_phone_recs_table 'table type' as an array?

I.e. can I insert records that in the procedure of package and pass reference to him in called secondary procedures.

that is something like that
PACKAGE BODY abc IS

  PROCEDURE kdkddk IS
  BEGIN
    -- Insert records to the  obj_emp_phone_recs_table 
    obj_emp_phone_recs_table(1).emp_number := '1';
    obj_emp_phone_recs_table(1).emp_phone   := '0774949494';

    obj_emp_phone_recs_table(2).emp_number := '234';
    obj_emp_phone_recs_table(2).emp_phone   := '285494';

    -- Pass the table to the sub procedure
    xyx(obj_emp_phone_recs_table);

    ........
    ......    
   
  END kdkddk;

END abc;
If yes how to insert the obj_emp_phone_recs_table?

Nothing on the net. In the Net I found only where u set normal column of a table as an object type and then insert records him.

Any help would be greatly appreciated.

Published by: user12240205 on October 6, 2011 02:08
mhouri > drop type obj_emp_phone_recs_table;

Type dropped.

mhouri > drop type obj_emp_phone_rec ;

Type dropped.

mhouri > CREATE TYPE obj_emp_phone_rec AS OBJECT
  2    (
  3       emp_number   NUMBER,
  4       emp_phone    VARCHAR2(100)
  5    )
  6  /

Type created.

mhouri > CREATE TYPE obj_emp_phone_recs_table AS TABLE OF obj_emp_phone_rec
  2  /

Type created.

mhouri > create or replace procedure p1(pin_tab IN obj_emp_phone_recs_table)
  2  is
  3   begin
  4     for j in 1..pin_tab.count
  5     loop
  6      dbms_output.put_line('record number '||j ||'-- emp number --'||pin_tab(j).emp_number);
  7     end loop;
  8
  9  end p1;
 10  /

Procedure created.

mhouri > create or replace procedure p2
  2  is
  3  lin_tab  obj_emp_phone_recs_table := obj_emp_phone_recs_table();
  4  begin
  5  FOR i IN 1 .. 5
  6     LOOP
  7        lin_tab.extend;
  8        lin_tab(i) := obj_emp_phone_rec(i, 'i-i-i');
  9     END LOOP;
 10
 11    p1(lin_tab);
 12
 13  end p2;
 14  /

Procedure created.

mhouri > set serveroutput on
mhouri > exec p2
record number 1-- emp number -- 1
record number 2-- emp number --2
record number 3-- emp number --3
record number 4-- emp number --4
record number 5-- emp number --5                                                                                                                                                                                                                          

PL/SQL procedure successfully completed.

Best regards

Mohamed Houri

Tags: Database

Similar Questions

  • can you make a password reset disk on a computer and use it on another using the same operating system?

    One of my friends has forgotten his password and I was wondering if I could make the password reset disk for him?

    A password reset disk only works on the computer, on which it was made.

    What to do if you forget your Windows password

    If you have forgotten your Windows password and you are on a domain, you must contact your system administrator to reset your password. If you are on a working group (the majority of individuals are on a working group), you can reset your password by using a reset disk of password or by using an administrator account.

    Create a password reset disk:

    http://Windows.Microsoft.com/en-us/Windows7/create-a-password-reset-disk

    Reset your Windows password:
    http://Windows.Microsoft.com/en-us/Windows7/reset-your-Windows-password

    If you forget the administrator password, and you do not have a password reset disk or another administrator account, you will not be able to reset the password. If there is no other user account on the computer, you will not be able to connect to Windows and you will need to re - install Windows.

    What to do if you forget your Windows password:

    http://Windows.Microsoft.com/en-us/Windows7/what-to-do-if-you-forget-your-Windows-password

    Solutions to common problems with logging on Windows:

    http://Windows.Microsoft.com/en-us/Windows7/solutions-to-common-problems-with-logging-on-to-Windows

    Recently changed the password? Use the system restore and restore point from before it was modified:

    http://Windows.Microsoft.com/en-us/Windows7/what-are-the-system-recovery-options-in-Windows-7

    Change your Windows password:

    http://Windows.Microsoft.com/en-us/Windows7/change-your-Windows-password

    Microsoft's strategy concerning lost or forgotten passwords:

    http://support.Microsoft.com/kb/189126

    Keep secure passwords - Microsoft strategy on move the passwords:

    http://answers.Microsoft.com/en-us/Windows/Forum/Windows_7-security/keeping-passwords-secure-Microsoft-policy-on/39f56ef0-5d68-41AD-9daa-6e6019c25d37

  • My acrobat 8 is recorded for a computer that has been hacked and is fried, but I can't reg to this computer and now I cannot use it for 30 days on this computer

    My acrobat 8 is recorded for a computer that has been hacked and is fried, but I can't reg to this computer and now I cannot use it for 30 days on this computer

    Serial number and activation support (no-Cloud) https://forums.adobe.com/thread/2041990 to adjust the number of activations

  • Can you run the Interface of Inspection VBAI only once and then once more by a guest user?

    Can you run the Interface of Inspection VBAI only once and then once more by a guest user?

    I don't think I understand what you are trying to accomplish. You can connect a button on the front of the smart camera and trigger each acquisition. In VBAI check the triggered Acquisition under the tab trigger for the step to acquire Image (smart camera).

    Your smart camera is hooked up to a monitor? Is there something that you must do in LabVIEW that you can't do in VBAI about the step of user input?

  • I'm a composer of musicals for children and do a site for my work, but am a perfect beginner in Web design! Sound application what would you recommend for playback of tracks of my musicals and how to install it?

    I'm a composer of musicals for children and do a site for my work, but am a perfect beginner in Web design! Sound application what would you recommend for playback of tracks of my musicals and how to install it?

    There is no "request" in itself, and according to which browser and the device is used, this could end by into a mess of different options of incorporation. So to save your sanity upload your files to a service like Soundcloud and use their built-in widgets and code.

    Mylenium

  • Can I do a fresh install of Windows 7 Home and use the old product key?

    Hello

    I got a laptop from a former employer who removed the hard drive before give me the computer.

    I installed a new hard drive and you want to do a fresh install.

    The previous operating system was Windows 7 Pro OA Enterprise Edition and I have the product key for it.

    Can I do a fresh install of Windows 7 Home and use the old product key?

    and after that I still increases to 10 Windows using the same product key?

    Concerning

    Regrow72

    If you have plans to upgrade to Windows 10 Home, I would skip trying to reinstall Windows 7 and go directly to Windows 10.

    You can use your family Windows 7 product key to install Windows 10, learn how:

    How to install and activate Windows 10 using your Windows 7 or Windows 8 product key

    Step 1: How to download official Windows 10 ISO files

    Step 2: how: perform a clean installation of Windows 10

    If you are experiencing problems activating Windows 10, see:

    Activate your Windows 10 license with Microsoft Chat support

    I recommend to go to Windows 10 now while you can, because Microsoft will stop the free upgrade offer at the end of July:

    Windows 10 free upgrade offer ends July 29 as planned

    Microsoft to remove Windows Notification Nag upgrade 10

    Resources:

    Windows Free Upgrade on schedule 10 to end July 29, 2016 - what are your options?

    If you still want to reinstall Windows 7 Home Premium, please see:

    For 5 years, Microsoft made it fairly easy for users of the Windows 7 operating system to get reinstall media. If you have lost your support disc or installation retail collection; either it has been damaged or defective; You can download a copy of the edition that you have licensed from a membership site called Digital River. More recently, Microsoft ended the availability to reinstall media that you can download as a. File ISO in Digital River, which is a digital reproduction of an optical disc.

    It was particularly convenient for people who could not easily get the manufacturer's recovery media, did not want to pay the fees required to get or preferred a clean configuration without the software packaged manufacturers or even a recovery partition does not work. It's easy to use, all you had to do was reinstall and reactivate using the product key located on the certificate of authenticity and download all the drivers on the manufacturers website.

    Given that this option is no longer available, what are your options? See the article for more details:

    How to: What are my options for Windows 7 reinstall media?

    Make sure you scroll down and read the section:

    What to do if you cannot get your manufacturer recovery media, refuse to use or to buy it or the Microsoft Software Recovery Website does not work?

  • I have an IMAC of mid-2011.  Can I connect a Mac mini to this iMac 2011 and use this monitor that has a built in processor?

    I have an IMAC of mid-2011.  Can I connect a Mac mini to this iMac 2011 and use this monitor that has a built in processor?

    You should be able to, given the Mac Mini has the correct connections (in this case, a Thunderbolt connection).

    Use your iMac as a display with the target - Apple Support Display Mode

  • I bought lightroom 6 for my mcbook pro in June, installed and used one or two times very well.  (I also had a version of lightroom track 5 and separately installed creative cloud before buying 6)  I haven't used the application a few months

    I bought lightroom 6 for my mcbook pro in June, installed and used one or two times very well.  (I also had a version of lightroom track 5 and separately installed creative cloud before buying 6)  I haven't used the application a few months and tried to open it this week without success, it launches the image of the foliage of the forest and freezes.  I uninstalled the version of lightroom 5, nothing helps.

    Hi Cyril,.

    If you are using the trial of both creative cloud, please uninstall it from the computer and try to revive the Lightroom.

    Thank you

  • How to select records from an object of type

    CREATE TABLE BOOKING_ITERATION
    (
      SK_BOOKING_ID               NUMBER(20)        NOT NULL,
      BOOKING_TRANS_DATE          DATE              NOT NULL,
      LAST_CALCULATED_DATE        DATE,
      MAX_CALCULATED_TOLERANCE    NUMBER(2),
      CALCULATION_SUCCESSFUL_IND  VARCHAR2(1 BYTE),
      BOOKING_CALC                BOOKING_CALC_ATTRIBUTES_T
    )
    
    
    CREATE OR REPLACE /* Formatted on 24/06/2009 14:57:50 (QP5 v5.115.810.9015) */
    TYPE booking_calc_attributes_t AS OBJECT(
      booking_rec                      top_bkg_basic_rec_t,
    
      accom_costs_initialsed           VARCHAR2(1),
      flight_costs_initialsed          VARCHAR2(1),
      fin_details_initialsed           VARCHAR2(1),
      business_transaction_id          INTEGER,
      accom_unit_service_id            INTEGER,
      product_id                       INTEGER,
      subproduct_id                    INTEGER,
      subproduct_code                  VARCHAR2(3)
    )
    now my requirement is to select values in the table BOOKING_ITERATION where product_id = 101
    can you please advise me on how to do it.

    Concerning

    Nested object type attributes can be considered with the notation by simple point. However, this is slightly obscured by the fact that a table alias is required for name resolution. I hope that this example will help...

    SELECT bi.sk_booking_id
    FROM   booking_iteration bi
    WHERE  bi.booking_calc.product_id = 101;
    
  • Can you Record calls on Moto Droid? All the apps? Most of the legal States

    Any Verizon Droid phone model is worthless if I can't record phone calls, both sides as my Palm phone. What is legal in the U.S. States, some N.C. wort... I've heard rumors that Verizon's Motorola Droid does not permit recording of phone calls without the old vacuum and a recorder separated... really of the 70s. Does anyone know of an app. I have googled and looked everywhere, but must have missed it. Thanks: [email protected]

    "No matter what model of phone Verizon Droid is worthless if I can't record phone calls, both sides as my Palm phone"

    This is what it takes to make a phone without value? There is no suction cup which is compatible with most mobile phones and they do not work with smartphones. How you would cover the speaker and the microphone of a suction device and then still hear and talk into it?

    This Palm phone is maybe what you really need.

    You hear rumors?

  • For each object, create a new layer and rename it

    Hello!

    I want to export an Illustrator file to DWG, and I have many things I want to keep the name. But to keep this info in AutoCAD, I need to transfer them as layer names (DWG/DXF export does not record the name of the object, but the name of the first level layer) and put all these layers as layers of level first (DWG/DXF export maintains just first layers of level).

    So I would like to make or find a capable script something like this:

    in my file,.

    for each object,.

    see if there is a layer with the name of the object

    If there is any layer with the same name

    then

    Create a layer,

    give the name of the object to the layer

    endif

    Place the object in this layer

    Is there someone who can help me?

    Thank you!

    You can select your layer, then use "Release to layers", which will create a sublayer for each object that you have, and then a script can rename these layers based on the named object it contains... so you can drag them all out of their layer sublayers parent so that they become the main layers... everything that is explained here, including the script

    Selected lap HAVE sublayers in top-level layers?

  • I can't advocate for windows to start. Have uninstalled and not reinstalled no difference. Error OX 800106ba. Can someone help me please?

    Sorry I'm new.  I accidentally deleted windows Defender. So I tried to install just that - it did not work, so I uninstall and then reinstalled and it still does not work.  I'm a great Grandma with no. kids to help hope someone can - thank you.

    Hello

    Here is the Vista Forums.

    If you have uninstalled then reinstalled Defender using Vista.

    Defender is part of the Vista operating system.

    Read this information on the Defender:

    If you use Norton, AVG, Avira, Microsoft Security Essentials, McAfee, etc. the default action is for Windows Defender must be disabled, that these AntiVirus programs have their own Antispyware Applications.

    There is nothing to worry.

    Using both programs at the same time can cause system conflicts, etc.

    If you are using one of the above AntiVirus programs, this Information from David O - Support Engineer shows you how to manually enable Windows Defender (disregard information from uninstalling; not possible in Vista):

    http://answers.Microsoft.com/en-us/Windows/Forum/windows_vista-security/how-do-i-manually-start-Windows-Defender-in-Vista/dab845b2-9ba5-47F3-9518-c4c6781e7d5b

    "Go to start, Control Panel, Administrative Tools, Services. Look for Windows Defender.

    Right click and select Properties , ensure that Startup Type is automatic.

    Once modified, click apply and OK.

    Quit and restart your computer. Check the back take the same path to confirm that Windows Defender has started"

    .

    If you want to have additional protection against malware using the version FREE of Malwarebytes AntiMalware:

    http://www.Malwarebytes.org/products/malwarebytes_free

    And for now, change startup Vista programs without using Defender, use one of these methods:

    "How to use MSCONFIG in Windows Vista"

    http://netsquirrel.com/Msconfig/msconfig_vista.html

    Or the program Autoruns for FREE:

    "V11.21 Autoruns for Windows"

    http://TechNet.Microsoft.com/en-us/sysinternals/bb963902

    See you soon.

  • Can you do random split A / B test Eloqua forms and landing pages?

    I know you can use a connector of cloud to randomize A / B testing for email, but what are the forms and landing pages?

    The two ways that I would suggest would be to either:
    (a) have two emails leading to two separate landing pages (containing the same (or different) forms, - using A / B test on the email you can randomize which in your segment Gets A email or email B,-which would be duly can be spent at LP A or B of the LP - this would allow you to see exactly the number of visiting each page.)

    or (more technical, but tidy solution):

    b) -have separate two distinct forms, both hosted in the LP even, but as the content blocks.
    Then use a little JavaScript function to randomize a number between 1 and 100 from the loading of the page and for all even numbers display content a. (form containing A) & for all the odd numbers display content block B (containing the form B).  -you could then report on shipments of respective form to see how successful they were. -
    You may have a third form with only two fields (e-mail & random number) by on page load after has defined the random number which content is displayed, an AJAX form Send behind the posts of scenes the email of visitors & random number to the third form - this would include visitors who bounce before submitting a form, & then you could report to the actual visitors to each page against the numbers they have been assigned (thusly allowing you to see the content that was displayed to then report on the rate of success of subsequent form remittances).

    I hope that helps?

    Sincere greetings,

    AB

  • Can you explain to us what is p, in, out and corner in AIPathSegment?

    Hello

    typedef

    struct

    {

    AIRealPoint p, in, out.

    AIBoolean angle;

    } AIPathSegment;

    AIPathSegment is declared in AIPath.h in CS4 SDK. but the documentation is not given in the API reference.

    So, could you please tell me what is p, inside, outside and corner?

    Suppose if I want to change the position, what is the point in AIPathSegment what I have to change?

    I mean how is represented the position of the segment?

    I use cubic Bézier to all their lines. If you don't care to Béziers, make sure just the in & points are the same as p. 'p' is what you normally expect a Summit to be on a path. Technically, a segment is not a Summit, this is the line between two vertices. The EPS on the first point & her more in the second point and the second p. There is a post where I explain Béziers to someone else a page or so back that's worth looking on these forums.

    The key however, is if you don't care about Bezier curves, just pretending as/p/output are the same and make sure that put you all to the same value. Then you can pretend that a segment is just a tip.

  • Can I buy a phone unlocked in an Apple Store and use it immediately?

    Can I buy an unlocked iPhone 6s in an Apple Store in the United Kingdom and use it immediately?

    As long as you have a SIM card active, then Yes. You will need the SIM card for activation.

Maybe you are looking for

  • Is it possible to have thunderbird have an icon in the taskbar?

    Is it possible to make an icon in the toolbar view if you have messages in your mailbox thunderbird? It is very convenient power, look in the lower right and see a number, which indicates that you have mail. Is it possible to do this with thunderbird

  • HP Pavilion Notebook 15-p119: USB charge, but does not sync devices

    Dear folk to HP support, I have a situation very similar to the mentioned in this thread, the only difference is my OS: http://h30434.www3.hp.com/t5/Desktop-Software-and-How-To-Questions/VGA-and-USB-Driver-Not-Working/m-... With any device (iPad, Sam

  • Satellite Pro 4300 series - is there an available wireless card

    Hi all New to this forum I bought an old laptop Toshiba Satellite Pro 4300 series recently as a starter machine for my son. The computer is currently connected to the internet using 3Com Megahertz 10/100 LAN PC Card PCMCIA 3CCFE574BT with dongle conn

  • Wireless printing problem: Mac OS 10.5 to HP6600 all-in-One

    My customer just bought a printer all-in-one HP OfficeJet 6600. Naturally, the CD than canme with the printer is for a newer Mac OS, so it wouldn't install. I was able to locate and download the printer drivers for Mac OS 10.5 and install without any

  • "Dark Style"?

    Most of the screenshots that I see in the docs seem to be sort of a dark theme, but my QML applications (using all default widgets and parameters) are white and light.  Is this just outdated screenshots, the Simulator is different, or am I supposed t