How to look up values of a Type in another?

Hi all!

I got a dillema and don't know how to look up values in another type.

I had

DECLARE  
v_id NUMBER := null;

  CURSOR c1
  IS
  SELECT * 
  FROM temp_data; -- 1M rows

  CURSOR c2
  IS
  SELECT id, name, name2, name3, name4, type
  FROM real_data;--1M rows

  TYPE temp_data_table IS TABLE OF temp_data%ROWTYPE;
  TYPE real_data_record IS RECORD (
      id            NUMBER    := NULL, 
      name          VARCHAR2(2000)  := NULL,
      p_name        VARCHAR2(2000)  := NULL,
      pp_name       VARCHAR2(2000)  := NULL,
      ppp_name      VARCHAR2(2000)  := NULL,
      address_type  VARCHAR2(2000)  := NULL
      );
  TYPE real_data_table IS TABLE OF real_data_recordINDEX BY BINARY_INTEGER;
  real_data_t real_data_table ;
  temp_data_t temp_data_table ;

BEGIN 

  OPEN c1;
  FETCH c1 BULK COLLECT INTO temp_data_t ;
  
  OPEN c2;
  FETCH c2 BULK COLLECT INTO real_data_t ;

  FOR i IN temp_data_t .FIRST .. temp_data_t .LAST 
  LOOP
     -- TODO how to search value by predicates:  temp_data_t(i).name , temp_data_t(i).surname in real_data_t 
/*
Something like SELECT id INTO v_id FROM real_data_t rdt WHERE rdt name = temp_data_t(i).name AND rdt.p_name = temp_data_t(i).surname -- ......
*/
  END LOOP


END;

Are its same posible?

Or it will be a corectly how?

Thanks for the tips

Answers helpful guaranteed!

The corect way is to use very fast execution of MERGE WITH UPDATE and reduces table scans.

As:

MERGE INTO employees e
  USING hr_records h
  ON (e.id = h.emp_id)
  WHEN MATCHED THEN
  UPDATE SET e.address = h.address
  WHEN NOT MATCHED THEN
  INSERT (id, address)
  VALUES (h.emp_id, h.address);

Thanks for the tips!

Tags: Database

Similar Questions

  • How to retrieve a value of page element in another page?

    Hello

    How to retrieve a value of page element in another page?

    say P55_COURSES_TO_EVALUATE is my name of the page element, and it is a selection list. Based on the value selected in the next page I see the details of the selected value shd and for that I need P55_COURSES_TO_EVALUATE value in the following page. How to do it? When I try to retrieve the values it simply returns nothing.
    Pointers would be really useful.

    Thanks in advance.

    Hello

    Could you please how you try to use it?

    If you set the value to the P55_COURSES_TO_EVALUATE element and submit the page, the value is stored in session state.
    Then you can use this element in any page as

    :P55_COURSES_TO_EVALUATE
    

    You cannot access page value in javascript/jQuery to other pages like

    $v('P55_COURSES_TO_EVALUATE')
    document.getElementbyID('P55_COURSES_TO_EVALUATE')
    $(#P55_COURSES_TO_EVALUATE)
    

    Because the item is not on the other pages. In javascript from other pages, you can use

    var a = '&P55_COURSES_TO_EVALUATE.';
    

    Kind regards
    Jari

  • How to fix the value of table type defined on page of the ofa LOV

    Hello world
    There's a valueset created in the xx_ap_valueset to say front end which is of type table and created on a table xx_ap_table somewhere with cluase and stopped by the clause.

    Is there a way that we can reach this value a page of the OPS LOV? or is it just that I need to create a vo and reproduce the select statement used in the valueset.


    Help, please!

    Thank you
    Sunny

    Sunny,

    You can not attach the Valueset to the Lov directly. You must create a VO for this.

    Kind regards
    GYAN

  • How to insert the value of the type in a value of type varchar date

    Oracle forms 6i

    Hai All

    There are two tables T1, T2

    T1 has these code varchar fields, the time varchar, date

    T2 has these intimate date fields, outtime date intrinsically date, date of introut

    I tried to change the time of Ie respondent T1 to T2

    Update T2 intimate value = to_date(bartime|| bardate, «hh24mi maman-dd-yyyy»)...

    It run but very well, but I got an error Ora-01861

    Concerning

    Srikkanth.M

    Update t2 set outtime = to_date (r1.bartime | hh24mi R1.bardate,'dd-MOM-yyyy "") that I wrote like this and it runs and I got an error 01861

    One of your error is to set month format his KILLS not MOM

    I guess bardate has the format DD-MON-RRRR then this request won't work

     update t2
      set outtime = to_date(r1.bardate||' '||r1.bartime, 'DD-MON-RRRR HH24MI')
     where......
    

    ---------------------

    Take this into account in TO_DATE you tell Oracle that is my String don't String not really but it's date so for this, it must be said that your string contains this format date

    To_date (Mystring, DateFormat);

    for example

    String is ' 2009/Jan/01 20:00 ' To_date would be like to_date (' 01/Jan/2009 20:00 ',' RRRR/MON/DD HH24 ')

    It may be useful

    If the answers are useful or correct please mark

    Baig,
    http://baigsorcl.blogspot.com

    Published by: bamba on March 12, 2010 16:59

  • How to look up values in tables

    Hello, I am a beginner in labview, so please help me with my problem

    I had two output, voltage and current,

    I also need power, so I have several voltage and current. Then I find the maximum power using the technique to compare, but the problem is, I also find the voltage and current when the power is maximum, called Vmp and Imp, here, I am attaching the curve.

    Thanks for help.

    You must connect the Min Max function index function array index to get the maximum.

    See attchemnt below

  • How to pass a value from table in to another using java-oracle script: apex 5.0

    Hello

    Step 1:

    Two Table (product, product 2)

    Created an IR where all data are from Table Product

    -> a cell in the column is editable.

    Step 2:

    Whenever the user change certain values of cell and click on the button set to day then cell value must also be updated in the table leader2.

    -> entire product line (table) must be inserted into the product 2 (table) with update of the cell value.

    JS:

    var arr_f01 = [];

    () $("input[name='f01']").each

    function() {}

    If ($(this).) Val() > 0)

    {

    arr_f01.push ($(this).) Val());

    }

    });

    (apex). Server.Process

    "Update".

    {f01: arr_f01,}

    {dataType: "text", success: function (pData) {alert ("' data inserted into the Table Product");}}

    } }

    );

    Thank you.

    Hi Dominique,.

    Pranav.Shah wrote:

    Hello

    Step 1:

    Two Table (product, product 2)

    Created an IR where all data are from Table Product

    --> A cell in the column is editable.

    Step 2:

    Whenever the user change certain values of cell and click on the button set to day then cell value must also be updated in the table leader2.

    ---> Whole product line (table) must be inserted into the product 2 (table) with update of the cell value.

    JS:

    var arr_f01 = [];

    () $("input[name='f01']").each

    function() {}

    If ($(this).) Val() > 0)

    {

    arr_f01.push ($(this).) Val());

    }

    });

    (apex). Server.Process

    "Update".

    {f01: arr_f01,}

    {the data type: 'text', success: function (pData) {alert (' ' data inserted into the Table Product ');}}

    } }

    );

    Thank you.

    Follow the steps below.

    Step 1: Give static id to the other columns in your interactive report

    Attributes of the region-> column-> Id static definition

    Step 2: change your Javascript code to read values of other columns

    check the line no 8, in this way, you can read the value of other columns and push that in table

    This is the static id of the column I given EMPNO.

    do the same for the other columns you want to insert.

    var arr_f01 = [];
    var arr_f02 = [];
    var empno;
    $("input[name='f01']").each(
    function() {
    if($(this).val() > 0)
    {
      empno = $(this).closest('tr').children('td[headers="EMPNO"]').text();
      arr_f01.push($(this).val());
      arr_f02.push(empno);
    }
    });
    
    apex.server.process (
      "Update"
    , {  f01: arr_f01, f02: arr_f02
      }
    , { dataType: 'text',success: function(pData){alert('Data Inserted in Product Table');
    } }
    );
    

    Step 3: use tables in your ajax process to insert the record., replace your table name and the columns

    begin
    for i in 1..apex_application.g_f01.count loop
    insert into test(A,B) values (APEX_APPLICATION.G_F02(i),APEX_APPLICATION.G_F01(i));
    commit;
    end loop;
    end;
    

    Hope this helps you,

    Kind regards

    Jitendra

  • How to insert the value from the FORM to another database table?

    Hi all

    I have the following problem.

    I have a form that has a tabular layout for the MATURED_FD_DTLtable. (all about 20 line items)

    CREATE TABLE MATURED_FD_DTL

    (

    ACCT_FD_NO VARCHAR2 (17 BYTE) NOT NULL,

    CUST_CODE NUMBER (9),

    FD_AMT NUMBER (15),

    FD_INT_BAL NUMBER (15),

    TDS NUMBER (15),

    CHQ_NO NUMBER (10),

    CREATED_DATE DATE,

    CREATED_BY VARCHAR2 (15 BYTE),

    PREV_YR_TDS NUMBER (15),

    ADD_FD_AMT NUMBER (15),

    DESCRIPTION VARCHAR2 (100 BYTE),

    P_SAP_CODE NUMBER (10),

    P_TYPE VARCHAR2 (1 BYTE)

    )

    By clicking on 'SAVE' button, all values will be automatically is stored in the MATURED_FD_DTLdatabase table.

    But I want to insert these values in another table called TEMP.

    I want to insert values of form only, no table select.

    How can I do this?

    Help me.

    Is Oracle Designer 6i.

    Answer:

    BEGIN

    Commit_form;

    PREMIER_ENREGISTREMENT;

    LOOP

    insert into TEMP_MATURED_FD_DTL

    SELECT * FROM MATURED_FD_DTL WHERE ACCT_FD_NO =: acct_fd_NO;

    WHEN THE OUTPUT: SYSTEM. LAST_RECORD = "TRUE";

    NEXT_RECORD;

    END LOOP;

    PREMIER_ENREGISTREMENT;

    COMMIT;

    MESSAGE ("RECORD UPDATED AS PAID '");

    MESSAGE (' ', no_acknowledge);

    END;

  • How to change the value of an element with another element?

    Hello guys,.

    I now have two or three elements in my form page, according to an order of the day, I want to change (from disable to activate or vice versa), the values of all the other elements in this form...

    I thnk for this javascript is needed... but I'm new Bee so if anyone can help me with these...

    How do I? is - that someone has good example or any link...

    Please help me with this question... enjoyed

    thxs


    Kind regards
    GK

    Hello GA,.

    Try this:
    OnChange = "$f_DisableOnValue (this, 'Y', 'P1_DETAILS_YN');"

    BTW: You are missing a hook closing in your function. You must use FireFox and with the FireBug extension and you would have noticed it...

    Greetings,
    Roel
    http://roelhartman.blogspot.com/
    You can reward this response in marking it as useful or Correct ;-)

  • How to pass the value of the variable record type in the procedure

    Hai All

    My Question is

    I have a table named Emp and the structure

    ID Varchar2 (25)

    Name varchar2 (25)

    Number of salary


    And now, I created a folder named Rec_Emp

    Like this

    Type Rec_emp is made
    (Rec_Id varchar2 (25),)
    rec_name varchar2 (25).
    Number of Rec_salary);
    rec_emp emp_record;


    I created a SQL type

    Now how to pass the value type in the procedure


    Thanks and greetings
    SrikkanthM

    You are looking for something like this

    create table my_emp (id integer, name varchar2(100), sal number)
    /
    create type my_emp_obj as object(id integer, name varchar2(100), sal number)
    /
    create or replace procedure insert_into_my_emp(pEmp_Obj in my_emp_obj)
    as
    begin
      insert into my_emp (id, name, sal) values(pEmp_obj.id, pEmp_Obj.name, pEmp_obj.sal);
    end;
    /
    begin
      insert_into_my_emp(my_emp_obj(1,'karthick',1000));
    end;
    /
    select * from my_emp
    /
    
  • How to display the values of this query? The type is XDB. XDB$ STRING_LIST_T

    Hi all

    If I run this query using a tool like developer PL/SQL (SQL window), the values are displayed as a Collection. Just click and see the results of the al.

    Select
    dbms_resconfig.getRepositoryResConfigPaths)
    Of
    Double;


    I want to know how to display these values using any tool of sqlplus (with dbms_output or something like that).

    How can I do? With the help of the table? Create a type?

    TKS

    user12083350 wrote:

    I want to know how to display these values using any tool of sqlplus (with dbms_output or something like that).

    SQL> select * from table(dbms_resconfig.getRepositoryResConfigPaths())
      2  /
    
    COLUMN_VALUE
    --------------------------------------------------------------------------------
    /sys/xs/userrc.xml
    /sys/xs/rolesetrc.xml
    /sys/xs/drolerc.xml
    /sys/xs/rolerc.xml
    /sys/xs/frolerc.xml
    /sys/xs/xdserc.xml
    /sys/xs/scrc.xml
    
    7 rows selected.
    
    SQL> 
    

    And in PL/SQL:

    SQL> declare
      2      v_list xdb$string_list_t := dbms_resconfig.getRepositoryResConfigPaths();
      3  begin
      4      for i in 1..v_list.count loop
      5        dbms_output.put_line(v_list(i));
      6      end loop;
      7  end;
      8  /
    /sys/xs/userrc.xml
    /sys/xs/rolesetrc.xml
    /sys/xs/drolerc.xml
    /sys/xs/rolerc.xml
    /sys/xs/frolerc.xml
    /sys/xs/xdserc.xml
    /sys/xs/scrc.xml
    
    PL/SQL procedure successfully completed.
    
    SQL> 
    

    SY.

    Published by: Solomon Yakobson, April 24, 2010 15:04

  • How to capture the value of type column report

    It would be a great help that you might suggest the following

    (i) Java script that I wrote on the standard status column (in a tabular report) fails.
    This happens because of the standard status column, if I use the text field then called Javascript function and showing correct results.

    Now, here, I want to know how to capture the value of the column standard report, since javascript fails due to
    the column values of standard report unrecognized.

    Example:

    Columns of the report as a table:
    ```````````````````
    Standard report column: salary
    TextField report column: new treatment
    Report column standards: difference

    I've written the javascript on column New_salary function which returns the value of the salary column to calculate the difference.

    For this column of report types, the javascript function does not work, that is to say, it does not show the difference., since it is not read
    the value of the column Salary (which is the Standard type of report column)
    Once I have change the Salary column to text (display as saved state) javascript field works fine.

    All entries on how to capture the standard value of the column, so that I can access the value of the javascript function.

    Thanks in advance
    Vijay

    Hi Vijay - I had problems with the forum as well (and my workspace OTN so)!

    You have two questions, I think.

    First of all, that the old wage is not an input element, you can not get to it by referring to an ENTRY tag. you will need to change that to something like:

    var s1 = d[k-1].firstChild.nodeValue;
    

    This means that there is nothing else in the cell apart from the text - as in < td > < table > 123. If there is something else there that stops you getting the value using the above, you can go through these nested tags referring to objects further firstChild-

    var s1 = d[k-1].firstChild.firstChild.nodeValue;
    

    As I don't see your page, you need to check yourself to see firstChild how much you need. This example assumes that you had something like: < td > < b > 123 < /b > < table >

    Second, the values of s and s1 are strings. You must convert these numbers to be able to perform calculations. You have two javascript functions to do this: ('string') parseFloat and parseInt ('string'). One contains decimals, the other is not - but know that one is not very accurate (it can change "123.456' in ' 123.455999999995' or something similar - not very good! '").

    So, your calculation should be:

    var diff = parseInt(s) - parseInt(s1);
    

    Andy

  • cfformitem type = &amp; quot; script &amp; quot; : how to set the value of the hidden field?

    I have a simple test form that contains a cftree and some fields of seizure/hidden. Whenever a tree node is selected, I want to change the values of the fields of entry/hidden to some node is selected. Pretty simple, but I can not understand how to change the values of the hidden fields.

    Load the form, select "ItemA" and click on submit. Do not change the values of the hidden form fields. They are always "not defined". What is the correct syntax to change the value of the hidden field?


    The correct syntax is

    myForm.theID = 'theID = "+ valueString;

    Ken

  • How to reset the null to a type value?

    Hello

    Do I need advice to reset the value of a type or if I have to reset the null value for a type?

    I use the same variable for a query of SUPPRESSION of difference. If it is OK?

    Please advice-

    Thank you in advance.
    PROCEDURE pr_type_example
       IS
    
          TYPE my_type_1 IS TABLE OF table1.col_1%TYPE;
    
          v_type_one                 my_type_1;
    
    begin
    
    SELECT table1_id
          BULK COLLECT INTO v_type_one
            FROM table1
           WHERE dt_name = 'ABC';
    
          FORALL i IN my_type_1.FIRST .. my_type_1.LAST
             DELETE FROM table2
                   WHERE table2_id = my_type_1 (i);
    
    
    SELECT table1_id
          BULK COLLECT INTO v_type_one
            FROM table1
           WHERE dt_name = 'XYZ';
    
          FORALL i IN my_type_1.FIRST .. my_type_1.LAST
             DELETE FROM table3
                   WHERE table3_id = my_type_1 (i);
    
    ...
    ..
    
    end pr_type_example;

    COLLECTION in BULK automatically deletes data collection before you retrieve the data in the variable.

  • How to connect the value of the input string to numeric values

    Hello

    I'm trying to figure out how to connect the value of unique user input string to numeric values. Basically I want the user to enter the name of a gas that I have a list for (I think I put the list of gases in a table >). Then I want to match numeric values 2 'a' and 'b', according to which gas, name of the user has set. These 'a' and 'b' values will be automatically matched with the name of the gas in a list that I put. For example, hydrogen gas has the value 3 for "a" and 4 for "b. when the user puts the ' hydrogen' name in a string constant, automatically 'a' and 'b' must be issued.» I have connect a and b to a formula

    Thanks for any help

    Hello

    It is perhaps not exactly what you are looking for, but perhaps you could use the enumerated data type and the array of clusters of points (a, b).

    Look at the VI I enclose.

  • How to get the value of the collection


    Oracle 10 g version

    Hi gurus

    Thank you someone guide me how get my data collection. See below for more details.

    Examples of data

    Set serveroutput on
    DECLARE
    Numbers_t TYPE TABLE IS OF INTEGER
    INDEX BY PLS_INTEGER;
    l_numbers numbers_t;
    Start
    FOR indx IN 1... 10
    loop
    l_numbers (DBMS_RANDOM. (VALUE (1, 10)): = indx;
    dbms_output.put_line ('Count =' | l_numbers);
    END loop;

    END;

    I know that in the collection of the values of number_t are store in the place at random, my question is that how to see these values?

    Did you look at?

    SQL> declare
      2    type numbers_t is table of integer
      3    index by pls_integer;
      4    l_numbers numbers_t;
      5    counter integer;
      6  begin
      7    for indx in 1 .. 10
      8    loop
      9      l_numbers (dbms_random.value (1, 100)) := indx;
     10    end loop;
     11
     12    counter := l_numbers.first;
     13    while counter is not null
     14    loop
     15      dbms_output.put_line('Index is ' || counter || ' and value is ' || l_numbers(counter));
     16      counter := l_numbers.next(counter);
     17    end loop;
     18  end;
     19  /
    Index is 10 and value is 4
    Index is 18 and value is 3
    Index is 42 and value is 6
    Index is 52 and value is 8
    Index is 57 and value is 10
    Index is 68 and value is 2
    Index is 78 and value is 9
    Index is 88 and value is 7
    Index is 90 and value is 5
    
    PL/SQL procedure successfully completed.
    

Maybe you are looking for