How to query an array type without using Loops(FOR,etc)

Hi all

I'm just a beginner working with oracle DB. I have a basic question about the TYPES of TABLES in oracle.

creating table example (a number, b varchar2 (10))
/
Set serveroutput on;

declare
TYPE tab_type IS TABLE of example % ROWTYPE;
t_tab tab_type: = tab_type();
Start

I'm IN 0.2
loop
t_tab.extend;
t_tab (t_tab.last) .to: = i;
t_tab (t_tab.last) .b: = "maru";
dbms_output.put_line (t_tab (t_tab. (Last) .at);
end loop;

-What I CAN DO SELECT * FROM THE TABLE t_tab without using a cursor to iterate line by line
-Since I need to compare the values in a table called HAND with this SAMPLE table.i need to check if all the files present in the table MAIN is present in the
-Type of table table SAMPLE. I do not want to insert into a temporary table (because it becomes an overhead projector) and compare the results.
end;

Kindly help me in this regard and let me know if you need more details.

Thanks in advance.

Maybe you would like

create type mytype as object
(
a number,
b varchar2(10)
);
/
create type tab_type as table of mytype;
/
declare
t_tab tab_type := tab_type();
sRES varchar2(10);
begin
for i IN 1..2
loop
t_tab.extend;
t_tab(i) := mytype(i,'maru');
end loop;

 select b
 into sRES
 from table(cast(t_tab as tab_type))
 where a = 2;
 dbms_output.put_line(sRES);
end;
/

Published by: Alkaron on 27.03.2012 08:37

Tags: Database

Similar Questions

  • How can I register my product without using the online process?

    How can I register my product without using the online process?

    He scored finally got.

  • I have Windows 7 Vista. I asked several times how to open a web browser without using my mouse and the other person has given me the right answer yet, or I misunderstood the answer (the more likely scenario)

    Given that I can't grasp how to open a browser window without using a mouse, it dawned on me that I can open new windows in just a window browser.  In fact, I would like that my home page contains all my most visited sites.  However, I am such a novice at this, I don't understand half the jargon, as what is the difference between a window and a tab.  I am a CPA, and for the first time in my life, I have no support from the computer.  I have called my programmer to answer questions and fix my computer.  Now I'm on my own and not completely lost since I tried to learn from my programmers, but we can't assume that I know nothing (or almost).  Thus, when answering my questions, please pretend I'm in third year.

    What is the difference between a window and a tab, and how can I open multiple windows web browser that a

    Hello tterrie,

    In addition to the link provided by Rick, here's a complete list of available shortcuts Internet Explorer.
    Hope this helps

    Chris.H
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • How can I start my PC without using a password.

    Original title: startup

    How can I start my PC without using a password.

    Check out Skip the Windows login screen

  • How to sort a random number without using the command by

    Hello

    How must be sorted, 5 random number without the use of order by in PLSQL
    for example.
    amount of ID
    1 2
    2 9
    3 3
    4 5
    5 7

    Edited by: sake1 1-dec-2010 08:16

    I used Altavista and found an example, how is it?

    DECLARE
    
      /* there is no built array in oracle, you must declare
      your own */
      TYPE Numarray IS TABLE OF NUMBER INDEX BY BINARY_INTEGER;
    
      /* the array of numbers - using assoc array because I can start
      with zero like traditional arrays */
      Nums Numarray;
    
      n NUMBER := 0;
    
      Temp NUMBER;
    
    BEGIN
    
      /* load up the array, put 20 random values in the array,
      in array indicies 0 to 19 */
      FOR i IN 0 .. 19
    
       LOOP
        Nums(i) :=  Round(Dbms_Random.Value(1, 1000));
      END LOOP;
    
      /* get the array size */
      n :=  Nums.Count();
    
      /* display the unsorted values - loop through the whole array and
      print out the values */
      Dbms_Output.Put_Line('unsorted:');
      FOR i IN Nums.First .. Nums.Last LOOP
        Dbms_Output.Put_Line(Nums(i));
      END LOOP;
    
      /* bubble sort - using two loops, compare each value with the one
      after it
      if the one after the current one is smaller , then
    
      switch their locations in the array, this is just like standard
      bubble sorts
      in other languages. The only real diff is the syntax.
      */
    
      FOR i IN 0 .. n - 1 LOOP
        FOR j IN 0 .. n - (i + 1) - 1 LOOP
    
          IF (Nums(j) > Nums(j + 1)) THEN
            Temp := Nums(j);
            Nums(j) :=  Nums(j + 1);
            Nums(j + 1) :=  Temp;
          END IF;
    
        END LOOP;
      END LOOP;
    
      /* display the values sorted */
      Dbms_Output.Put_Line('sorted');
      FOR i IN Nums.First .. Nums.Last LOOP
        Dbms_Output.Put_Line(Chr(9) || Nums(i));
      END LOOP;
    END;
    /*
    unsorted:
    155
    909
    795
    977
    942
    214
    105
    269
    283
    820
    108
    594
    784
    921
    856
    736
    802
    457
    951
    411
    sorted
         105
         108
         155
         214
         269
         283
         411
         457
         594
         736
         784
         795
         802
         820
         856
         909
         921
         942
         951
         977
    
    */
    

    In the code the first comment is wrong in fact, I think, this one:
    "There is no table built in oracle, you must declare your own."
    I remember there are some types of collection of the system, if I not mix with something, I remember there was a sort of like they were undocumented, so we can say legally that the comment in the code has always been right.

  • How can I get through forms without using my mouse?

    On a form web (as a survey), I used to be able to tab on the 'submit' button, press ENTER, and submit the page. Who stopped working some time over 2 months, probably with an update of Firefox.

    I need to have people to do a series of short surveys, a typed RESPONSE per page. (They must be structured in this way for a moment that we do). Previously, people could type in their response, to 'other' tab and press return, which would load the next page. This seems to have stopped working, and I can't find a way to access the next page without using the mouse. Back and forth between typing and clicking on are super annoying and slow people down, by our much less precise time measurements. How can I return this feature?

    Seems to work for me. I did this quick form with Google Drive: https://docs.google.com/forms/d/1b493Op_imKXg8Q_GNMmRquuvCutZzyQ0RuQbgKRPD6A/viewform?usp=send_form
    Can you give an example of this form does not work?

  • How can I recover deleted files without using any software?

    How can I recover deleted no matter what folder, image, Word & excel files without using any software inculd Recycle Bin?

    Monday, June 11, 2012 11:03:01 + 0000, dipakparate wrote:

    How can I recover deleted no matter what folder, image, Word & excel files without using any software inculd Recycle Bin?

    You cannot retrieve files deleted with the help of software. And even using
    software, you may or may not be able to recover.

    What you have against the use of software? The first thing to try is to
    being trash. If she isn't here, read on.

    "Deleting" a file does not actually delete it marks just the space
    also available to be used. There are third-party programs that can
    sometimes recover deleted files. The problem is that the space used by
    the file is likely to be replaced very quickly, and it makes
    the unrecoverable file.

    So your chances of successfully recover this file are decent if you
    Try it again immediately after the deletion of it and go quickly
    downhill from there. If you have used the computer since then (for
    example to write this question and read this answer), your chances may
    be very poor now.

    But if the file is large enough, it's still worth a try. Stop
    using the computer in question immediately, if you have not done
    already. Download an undelete program (and here's one:)
    http://www3.TELUS.NET/mikebike/restoration.html but there are several
    others to choose from; Do a search) on a friend's computer (do not
    it on yours because that would overwrite the files you want
    Undelete) and bring it to you on a CD or thumb drive to try.

    If that fails, your only recourse is to bring or send the disc
    a company of professional file recovery. This kind of service is very
    expensive and may or may not work in your case.

    Ken Blake, Microsoft MVP

  • How can install a blackberry app without using "javaloader" of JDE. ???

    Hello

    We develop a blackberry using JDE application.

    Now, we try to run this application on real BlackBerry.

    We already know that we can use .cod file and download this .cod to a utility called «javaloader»

    located in bin of the JDE.

    But what happens when the user doesn't have a JDE install on their system.

    So how the user can download this application without using «javaloader»

    Thank you.

    Director of office of dowload.

    http://NA.BlackBerry.com/eng/support/software/desktop.jsp

    Connect your device to BB and PC via a USB port.

    Select the responsible Application of Option.

    Select your. ALX (can be created in your JDE-> project-> generate ALX file)

    Complete the Installation.

  • How to set the title panel without using the Manifest.xml

    Hello guys,.

    I would like to know how to the the title of the Panel without using the manifest file.

    A C++ plugin is responsible for the creation of a menu entry. .

    He is also responsible of loading-unloading the extension basic HTML code.

    So in my extension manifest file, the following line has been deleted:

    < menu > my Panel Extension 1 < / Menu >

    After doing this, my extension Panel has more no title.

    What I would do, it is programmatically set, she don't know how to do!

    Any help would be appreciated.

    THX,

    Thomas.

    I found the solution to my problem!

    To find out how, follow this link: https://forums.adobe.com/thread/1731552?sr=inbox

    Thomas.

  • How do Lightroom 4 5 Lightroom without using the creative cloud?

    I have Lightroom 4 and I am interested to upgrade to 5 of Lightroom, but I don't want to use the creative cloud because I can't afford long-term monthly payments. So, how to pass without using the creative cloud? Is it possible to do this through Adobe, or should I buy it elsewhere? Thank you!

    You access this page: products

    and buy the upgrade to LR 5

  • How to connect an Oracle database without using input TNS

    Hello

    I need to connect my pc Oracle database server without using the TNS entry. How to do this?

    Kind regards

    007

    [easy connection: CONNECT to username/password@[/]host[:port][service_name]

  • How to run the oracle form without using a web browser

    I am a new developer in Oracle Form builder.
    Could someone tell me how can I use oracle without using a web browser?

    Bravo,

    N ° Web, since Forms 9i versions, are Web Client and needs an application server to run the forms runtime.

    François

  • How to open data.bin file without using exe?

    I had downloaded a game on the internet its really big in size, I downloaded 2 GB of files and when decompressing, it would be gb(that's_what_the_installer_say).i 8-5 files there are 4 data1.bin, data2.bin and so on until data4.bin and one installer with it, but when I install with installer there is unpack to the slowly so I want to decompress without using the installer some alternative program to make it work. But when I try to open it with ultra iso or winrar it shows the error invalid or unknown format. What should do? Sorry for my bad English.

    A .bin file is a binary data file, you cannot unpack without the program who can read binary data.  You must continue to use the correct Installer.

  • How to query a resource Type definition?

    Hello

    Using framework HA to protect applications third, is posible define the types of resources with the command:

    crsctl add type my_resource_type - basetype cluster_resource 'ATTRIBUTE' attr... »

    But how can I query the definition of such resources or others created?

    I can't find the command.

    Thank you

    Arturo

    crsctl status type ora.network.type f

    This will display the configuration of the ora.network resource type

  • Change the value of the array element without using the keyboard

    I have a control array on my front, say 1 d, 10 items.

    In addition, the front panel should be used with a touch screen, so I have a Subvi keyboard that should be called when I choose one of the elements of the array.  Therefore, no keyboard entry is allowed.

    My question is, how can I determine which element that the user hit/clicked?... .and how to change this value?

    -Mike

    Gents nevermind, found a way to emphasise that if this is the best way, but I got it.

    In my structure of the event, I have an event looking for the mouse event down in regards to the control array.  This event triggers my screen touch keyboard Subvi to fire, and the closure of the Subvi I pass its value to the ArrElem.Value property to assign the table a hit/clicked item.  Works.

    -Mike

Maybe you are looking for

  • When I view my Photos, they have a place and a date. How can I print them with that on them?

    When I view my Photos, they have a place and a date. How can I print them with that on them?

  • Satellite P100-437 - the update of the BIOS under Linux?

    Hello How can I update my BIOS when I only installed Linux? Your BIOS updates require windows. Thanks for the reply

  • IRIG-B with NI 9467

    Hello I have a question about using a NI 9467 (timestamp GPS and Module synchronization). Based on his description of the http://sine.ni.com/nips/cds/view/p/lang/ru/nid/210834, I can conclude that there is a single entry allowing to connect a GPS ant

  • 2.4 ghz wifi band no longer works

    I have a WRT1900ACS and in recent weeks I've noticed that the wifi 2.4 ghz work so no devices can connect to this band at all even after only a restart, but it will start working again after some time has passed, while the 5 ghz range is unafffected

  • Question about the strength of password

    (do not ask questions about the recovery of the password, so please do not report this thread) OK, I heard that the virus can change the password on a computer. But if you have a password very complicated (for example, one with a lot of numbers and o