The use of tables

Using
Oracle Database 10g Enterprise Edition Release 10.1.0.4.0 - production
PL/SQL Release 10.1.0.4.0 - Production
"CORE 10.1.0.4.0 Production."
AMT for 32-bit Windows: Version 10.1.0.4.0 - Production
NLSRTL Version 10.1.0.4.0 - Production

I'm trying to retrieve records from a database (a single table in this case) using three tables as keys. The table is unique to these three elements. The lines I want to come among a long list of more than 1000 points. I don't have the ability to create temporary tables on this server. So, I have three long lists and the first item in each list, when used in the WHERE clause in a SELECT statement returns an element. And the second points on these three lists will retrieve the next item.
I can't just use IN clauses to find these items because they must be combined in the same order as they are on the three lists.

I'm looking for something like this, but I'm running into syntax errors and other errors of logic.
DECLARE

     TYPE Item1_List IS TABLE OF VARCHAR(5);
     TYPE Item2_List IS TABLE OF VARCHAR(3);
     TYPE Item3_List IS TABLE OF VARCHAR(1);
     myItem1 Item1_List;
     myItem2 Item2_List;
     myItem3 Item3_List;

BEGIN
--these three lists are much longer
     myItem1 := Item1_List('11011',
     '11011',
     '86842');

     myItem2 := Item2_List('001',
     '002',
     '001');

     myItem3 := Item3_List(NULL,
     'A',
     NULL,
     NULL);

DECLARE
FOR i IN myItem1.FIRST .. myItem1.LAST
LOOP
     CURSOR c_cur IS
     SELECT 
     Item1,
     Item2,
     Item3,
     Item4
     FROM myTable
     WHERE
     Item1=myItem1(i) AND
     Item2=myItem2(i) AND
     Item3=myItem3(i);
END LOOP;
END;
/
Here I use samples to help, but so far I was not able to make it work:
http://download.Oracle.com/docs/CD/B10501_01/AppDev.920/a96624/05_colls.htm

Some ideas that I have is, perhaps, I should not be using a slider, that instead, I should retrieve these data in another table? The only thing is, I don't know how to make a table to several column :( Other than that, I'm at a loss, and I really hope someone can help :)

Skip

set your cursor might work

DECLARE
   TYPE Item1_List IS TABLE OF VARCHAR (5);

   TYPE Item2_List IS TABLE OF VARCHAR (3);

   TYPE Item3_List IS TABLE OF VARCHAR (1);

   myItem1   Item1_List;
   myItem2   Item2_List;
   myItem3   Item3_List;

   CURSOR c_cur (pItem1 VARCHAR, pItem2 VARCHAR, pItem3 VARCHAR)
   IS
      SELECT Item1,
             Item2,
             Item3,
             Item4
        FROM myTable
       WHERE Item1 = pItem1 AND Item2 = pItem2 AND Item3 = pItem3;

   v_c_cur   c_cur%ROWTYPE;
BEGIN
   --these three lists are much longer
   myItem1 := Item1_List ('11011', '11011', '86842');

   myItem2 := Item2_List ('001', '002', '001');

   myItem3 :=
      Item3_List (NULL,
                  'A',
                  NULL,
                  NULL);

   FOR i IN myItem1.FIRST .. myItem1.LAST
   LOOP
      OPEN c_cur (myItem1 (i), myItem2 (i), myItem3 (i));

      FETCH c_cur INTO v_c_cur;

      LOOP
         IF c_cur%FOUND
         THEN
            NULL;                                          -- your coding here
         ELSIF c_cur%NOTFOUND
         THEN
            EXIT;
         END IF;
      END LOOP;

      IF c_cur%ISOPEN
      THEN
         CLOSE c_cur;
      END IF;
   END LOOP;
END;

Tags: Database

Similar Questions

  • The use of tables of database for authentication in the ADF

    Hello

    I need to use my user table in the database for authentication in ADF (adf 11.1.2).

    I have 3 categories: agent admin and user is unique, each has its own page, logging, the application checks the type of user and directs its jsf task or the page of the jsf page flow.

    I have a user with the type attribute table

    HOW CAN I MAKE THIS PRAYER.

    Hello

    See links below.

    Whatever Fusion Middleware: Tables database user to implement authentication in the ADF

    Java / Oracle SOA blog: the use of tables of database as in WebLogic authentication provider

  • The use of tables with void / vi

    Hello!

    I have a question about the correct method for the use of a Subvi to update an array of integers. How to pass the array to the Subvi, without creating a second table to the output (or what is returned)?

    It is for the calculation of the histogram data. Basically, I have a set of input values are evaluated to determine which bin location (array index) to increment the counter on. I then want to use the same Subvi to update table (let's call it "BinsIn", for the sake of discussion) and return to the main VI. Think in terms of textual programming I want to pass the array of reference, so I'm not wasting resources.

    I read a few posts that deal with using Ctl Refnum, but I don't know if that's what I want to do...

    Any help would be appreciated.

    Thank you

    Shaun

    Don't think in textual languages.  There is no difference in passing by reference and by value.  If the compiler determines that the input array can be reused as the output array, and then she'll do.  You can give him some advice that he should do by writing your code to perform operations "on the spot" (search for this term on this forum) and avoiding the functions requiring a copy the table as delete table.  Best thing to do is probably to write your code to make it work, then download it here so that other contributors can comment and help to make it more effective.

  • Need quick help! The use of tables

    I just started using flash a few weeks ago, and for one of my school projects I am creating a pokedex which will display information, when the user clicks on some buttons. for example 'If you click the attack button, then 4 attacks will appear. I currently use frame skipping to my application; but my teacher suggested I use tables to make them all appear on a single image, but I don't know how to do this. Can anyone help?

    Thanks in advance.

    Tables are variables that contain several elements. A common use for tables is to make collections of items so that items can be related to each other by their relative position in each table. For example:

    var letters: Array = new Array ("A", "B", "C", "D");

    Table of figures: var = new Array (1,2,3,4).

    Now, you can find an element in a table by searching for here:

    var thisOne:int = letters.indexOf ('B');

    trace (thisOne);

    var thatOne:Number = numbers [letters.indexOf ('B')];

    trace (thatOne);

    The first trace shows that the letter B is in position 1 of the table letters. The trace of the second shows that the item in the table of figures in position 1 is number 2.

    Who help me? You can learn more about the use of arrays in Flash here: ActionScript 3 fundamentals: paintings | Adobe Developer Connection

  • The use of tables in an application of different schemas

    Hello!

    I create an application that uses all of the tables of a schema.

    Now, I need to import data to another schema.

    How do I do that?
    In the workspace, I added the schema.


    Kind regards

    Ivan

    You have to "bind" the 2nd pattern to your workspace so that this 2nd pattern appears in the drop-down lists.

    Do you it in the administration portal.

    Manage the workspace-> manage the workspace for pattern assignments.

    Oh... and make sure you have given the correct GRANT to the schema of your analysis.

    MK

  • The use of tables to add an item?

    Hi all

    This is my first time on this forum posting.  I get script recently and come across a problem that I can't solve.

    I tried to search but could not find anything, so my apologies if this has already been discussed.

    I want to add an AVitem (in this case a JPG image), as a new layer inside a model in particular.

    According to the script, I use the add() method.

    I did it successfully with this code:

    var app.project = proj;

    proj. Item (2) .layers. Add (proj. Item (7));

    But it's all hardcoded by item number, which is not as flexible as I wish it were.

    I want to add all my images in a table and all my comps in a table, so I can iterate through them,

    Adding image [0] to comp [0], [1] on the image for comp [1] and so on...

    I've managed to adding images and compositions of their respective tables

    (proven by alerting the elements of the array)

    Is it possible to use the method add() with the elements of the array?

    When I try, it comes as a 'object undefined '.

    Any advice would be much appreciated!

    Thank you!

    .. Kevin

    Assuming that the items were stored in the tables correctly, it should be as simple as:

    for (var x = 0; x)< image.length;="" x++)="">

    COMP [x] .layers. Add (image [x]);

    }

  • The use of tables in classes

    Hello, I used an array in a class

    private var freeIDs:Array = new Array();

    And then created an object of this class and everything works. But when I create a second object of the same class, the tables of each object seem to be in conflict, even if they are intended to be specific to each object. I'm this misunderstanding or is this a real problem?

    Basically, I have 2 (or 3) objects of that class and that they call has the same function in the objects at the same time, the function changes freeIDs. It seems when freeIDs is altered in an object, he transforms into the other, that is involuntary. Individually the items work but when there are two or more, it does not work and weird buggy behavior. Is this normal?

    Thank you

    Laughing out loud

    but it's not supposed, '... they want a the same function in objects..'.   the functions should be unique to each instance of the class unless you use a static function.

    is there static functions/variables in your class?

    If this isn't the case, what do you do that makes you think change a single Bay changes into a different picture?

  • problems with IE7 in the use of tables and onLoad

    Thank you in advance for any help. I have a table that is used to store the names of. Files to load into another SWF. SWF video. When I call the "onLoad" method, it works in all browsers except IE7? See the example below:

    prod_a = new Array;
    prod_a [0] = 12; number of products in the table. Currently, this feature is not used...
    prod_a [1] = "product1.swf";
    prod_a [2] = "product2.swf";
    prod_a [3] = "product3.swf";
    prod_a [4] = "product4.swf";
    prod_a [5] = "product5.swf";

    onLoad = Function)
    {
    Description();
    moveScroller();
    loader_mc.loadMovie(prod_a[1]);
    }

    When the file opens, it loads the '2' slot flash file in the table in the "loader_mc" EXCEPT IT DO WORKS NOT IN IE 7? any ideas or help would be great! IE7 handles the different "onLoad"? I made a mistake?

    Thank you Sly one, but that's not the problem I currentl having a Java work around for this. I tried a few different solutions to the problem "click to activate". I found that none of them made a difference.

    I resorted to a solution of 'disorder' but effective. -items I've been hainvg problems with were dynamically loading the text and images. I had the problem by placing the images and the text which was to load 'onLoad', in the boxes as _mc objects. in this way the images were already there and didn't need to be loaded.

    The only two problems with this is
    (A) Firefox and Safari users (including other) screen "Refresh" the image loading. and
    (B) the size of the file was more than 35 KB.

    Thanks for the help everyone, the final is good enough for Government work...
    -DIG

  • The use of tables for example the names of

    How to use the tables for example names?

    If I, for example 'button [0]' as Instance name Flash tells me that I don't use character valid.

    :

  • Discover the use of tables.

    Hello

    I was invited to list all tables that a third-party application use when it executes a process. How would I know that?

    Thanks in advance.

    Hello..

    1 trace the session when the user of the application connects to the database with the application.

    2. get the sid of the user of the application and use the below command

    SQL > select owner, object, access type $ v where sid = xxx and the type = "TABLE";

    Anand

  • the use of tables of two schemas in the same application

    I have the table 1 of scheme A and table 2 of Figure B. In my worksapce I has the permissions to access the two schemas. In aplication wizzard, I have a listbox put what schema I work with and I can onli 1 patterns. but I want to work with the two tables in my applications, how can I do.

    Notice: I have recently started using APEX. In my work I use Oracle Forms, and now I'm trying to use APEX.

    -Select the schema of analysis in the application.
    -Grant insert, update, select and delete on a table the other schemas to the schema of the analysis.
    -Create a private synonym (create a synonym for other_schema.other_table other_table) in the scheme of the analysis.
    -Work with the two tables in the schema of analysis as if they resided in this scheme.

    Dave

  • Copy/paste in a row with the use of tables

    Hello

    IM wondering how I can copy a few lines of a small table (in another document Pages), to a larger table (in another document of Pages).

    The issue Im facing is that when I copy, for example, two lines with 16 columns in a table that contains 30, it resumes data over and over again until it reaches the last column.

    The thing is, the data must be in order, so everything that is on the second line on the table, should be on the first line on the larger table. It cannot be in random order - if that makes sense.

    Thanks in advance.

    Hi Lorenzo,.

    To copy the table, you can select whole lines. Click on the line and copy numbers.

    When you paste into the larger table, do not select whole lines.

    Click in a cell where you want the dough to start

    Kind regards

    Ian.

  • Use of tables and style sheet

    Hi all

    I am strungling using tables in RoboHelp HTML 7, to generate webhelp.
    What I'm trying to accomplish is the use of tables in HR, and have put in the form defined in a style sheet. The html code generated by RH should be nice and clean. If possible, I don't want to go into the HTML code, I prefer the use of the design editor.

    I have the following text into a new file in RoboHelp table Gallery:

    Quote:

    < table >
    < caption > CAPTIONTITLE < / legend >
    < style COL = "" width: 5%; ">"
    < style COL = "" width: 40%; ">"
    < thead >
    < tr > < th > < /th > < th > < /th > < /tr >
    < / thead >
    < tbody >
    < tr > < td > < table > < td > < table > < /tr >
    < tr > < td > < table > < td > < table > < /tr >
    < tr > < td > < table > < td > < table > < /tr >
    < tr > < td > < table > < td > < table > < /tr >
    < / tbody >
    < /table >
  • 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...

  • What is the meaning of the OPA session tables in Siebel for OPA? That is to say why they were created when they should be used? and what was the first thought behind the creation of tables of session?

    Hi all

    I wanted to know best practices regarding the use of the tables of session OPA? that is, what was the initial logic of creating tables of session? where we should use them and why? also can you please argue for and against about two approaches mentioned below

    Method 1: Save and reterieve OPA session data tables using session ID and case ID?

    Approach 2: Save data in Siebel database tables and just use reterieve case Id Siebel data and save the back.

    Thanks for your replies.

    Session tables are there to allow easy storage of the results of an interview of the OPA. It can be used to extract data from an interview, but probably more useful as an archive of past interviews. Is it possible to load a previous interview in the determinations of the Web from this table.

    1. This can be very useful to resume a partially completed interview.

    2. it can be used as verification of de facto mechanism to see what has been entered in an interview.

    In general I prefer to approach 2 where there are intercepted the incoming data to an interview in a before handler registration and then save the data you need from the interview in the location that you must save it.

Maybe you are looking for