How to concatinate values of two columns and update into another column

There is a table : TEST contains three columns - Column1 , Column2 , Column 3
Column1 contains values - (1,2,4)
Column2 contains values : (a,b,c)
Column 3 is empty .
Target : Values in column 3 should be (1a,2b,4c)
Need to achieve this through procedure .

Paul if i want to concatenate two strings or alpha numeric characters from 2 fields and display in the third field,Will this code be able to do that?

Similar Messages

  • Access data from from two lists based on lookup columns and insert into another

    Hi,
    I am new in SharePoint and is stuck in some problem.
    I want to insert data in to a list by fetching data from 2 lists.
    The scenario is :
    List A Columns : EmployeeName, EmployeeID, EmployeeSalary 
    List B Columns : DepartmentName, EmployeeID, ManagerID
    EmployeeID is lookup column 
    I want to fetch data from these 2 lists and insert data into another list:
    List C Columns: EmployeeName, EmployeeSalary, DepartmentName 
    Can someone please explain me all the possible approaches to do the above task

    If ListA and ListB are the lists that you created, it would be better to generate the lists data into one list not seperate lists, as they both represents the property information of one employee.
    If they are existing lists, you may have following considerations:
    1. if you are a programmer, it would be easier to have a lookup column at ListA, to generate the EmployeeName, EmplyeeSalary, then using ItemAdded event, to generate the DepartmentName column based on EmployeeID column.
    2. have a lookup column look at ListA, use workflow, set when item is created, start the workflow automatically, then in the workflow, find ListB related item based on EmployeeID column, to set the DepartmentName column, SharePoint designer workflow
    set Item Value activity can do this work, you can research to find more information about how to do this.
    Thanks,
    Qiao Wei <br/> My blog:http://blog.goobol.com

  • Retrieve Title field values from multiple lists and add into another list

    Hi , Iam trying to retrieve Title field value from multiple lists. and add them into another list. using Javascript. Can any one help me in doing this. Below is the code.. function save() { clientContext = new SP.ClientContext.get_current(); oWebsite = clientContext.get_web(); oList = clientContext.get_web().get_lists().getByTitle('MainList'); clientContext.load(oList); clientContext.executeQueryAsync(OnSucceeded, onQueryFailed); } function GetListItemValue(listName, fieldName) { var list = oWebsite.get_lists().getByTitle(listName); var eventValue = document.getElementById(fieldName).value; eventValue = eventValue.replace(",", ""); var camlQuery = new SP.CamlQuery(); var filterdata = '<view><query><where><eq><fieldref name="Title/"><value type="Text">' + myreqValue.trim() + '</value></fieldref></eq></where></query></view>'; camlQuery.set_viewXml(filterdata); listItems = list.getItems(camlQuery); clientContext.load(list); clientContext.load(listItems, 'Include(Id)'); clientContext.executeQueryAsync(Succeeded,Failed); } function OnSucceeded() { itemCreateInfo = new SP.ListItemCreationInformation(); oListItem = oList.addItem(itemCreateInfo); oListItem.set_item('Title', 'My New Title'); var deptItemLookupField = new SP.FieldLookupValue(); //Problem in below line...I was unable to get ID var getId = GetListItemValue("Listname1", "txtboxname1"); alert("ID" + getId); if (getId != undefined) { deptItemLookupField.set_lookupId(getId); } var getId12 = GetListItemValue("Listname12", "txtboxname12"); alert("ID" + getId12); if (getId12 != undefined) { deptItemLookupField.set_lookupId(getId12); } oListItem.update(); clientContext.executeQueryAsync(itemadded, itemFailed); } function itemadded() { alert('Item added successfully'); } function itemFailed(sender, args) { alert('Item added itemFailed' + args.get_message() + '\n' + args.get_stackTrace()); }
    Raj

    Hi,
    For this requirement, you will need to retrieve all the lists objects you want firstly, then execute the requests one by one to get the value of the Title column using CAML or
    LINQ.
    How to: Retrieve Lists Using JavaScript
    http://msdn.microsoft.com/en-us/library/office/hh185009(v=office.14).aspx
    About
    retrieve list items:
    http://msdn.microsoft.com/en-us/library/office/hh185007(v=office.14).aspx
    You can use
    Promise in your script to make your requests sequentially:
    http://www.shillier.com/archive/2013/03/04/using-promises-with-the-javascript-client-object-model-in-sharepoint-2013.aspx
    http://www.learningsharepoint.com/2013/08/13/using-deferred-and-promise-to-handle-async-calls-in-sharepoint-client-object-model/
    Best regards
    Patrick Liang
    TechNet Community Support

  • PHP create array/variable for two dropdowns and insert into one column

    Hello,
    I have been trying for days to get this to work. Any help would be very appreciated.
    The dropdown code:
    <?php //Dropdowns for hours and minutes
    $hour = array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
    $min = array (.00, .25, .50 ,.75);
    echo '<span class="red">Hours :</span><select name="hour">';
    foreach ($hour as $value1) {
    echo "<option value=\"$value1\">$value1</option>\n";
    echo '</select>';
    echo '<span class="red">Quarter Hours :</span><select name="min"';
    foreach ($min as $value2) {
    echo "<option value=\"$value2\">$value2</option>\n";
    echo '</select>';
    //Dropdowns for hours and minutes
    //Create variable to send to the time field using a hidden field
    function input_time($value1, $value2) {
    $time = count($value1 + $value2);
    return $input_time;
    ?>
    <input name="time" type="hidden" value="<?php echo "$input_time";?>" />
    The Schema:
    CREATE TABLE `ND_time_sheet` (
      `time_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
      `day` varchar(10) NOT NULL DEFAULT '',
      `date` varchar(8) NOT NULL DEFAULT '',
      `project_id` varchar(8) DEFAULT NULL,
      `non_bill` tinytext,
      `staff_id` varchar(5) NOT NULL DEFAULT '',
      `time` decimal(3,2) unsigned zerofill DEFAULT NULL,
      `type` varchar(30) NOT NULL DEFAULT '',
      PRIMARY KEY (`time_id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1
    Thanks!

    9677670421 wrote:
    hi... i am trying to do the same but i am having the 2D array of data when first time if i clicked in table it should show the the first row values and if i again clicked same value should show in the second row and so on... but insted in my code if clicked (using insert into array ) at a time it is showing two rows of the data pl help me ..........
    This seems to be a different problem, so you should have started a new thread instead.
    Can you show us your code, tell us what you are clicking, tell us what you get and what you expect to get instead. Thanks.
    LabVIEW Champion . Do more with less code and in less time .

  • Taking info from Column and Pasting to another Column without losing content?

    Hi Numbers Masters,
    I am working on an e-commerce store CSV spreadsheet.
    For instance:
    I have column "A" which is a description of a product and column "B" which is a SKU Number. I want the SKU number column info to be added to Column "A" without deleting the description content in Column "A". There is different values for each SKU number in column B and different content for info in Column "A".
    If I copy and paste I lose the info in Column "A" and am just left with info from Column "B".
    THANK YOU

    In Excel I would do this
    Save a copy of the file.
    Concatenate the text by creating a formula in a third column that "adds" the contents of A and B.
    Then inspect the column
    I expect Numbers works similarly.
    Use the & function to add strings (Descriptions or SKU)
    Something like this
    A1 & B1
    A1 & " " & B1
    gives you a space
    A1 & " -" & B1
    gives you a dash
    Description
    SKU
    Combine
    Scissors
    1234
    Scissors 1234
    Clipboard
    78766
    Clipboard 78766
    Masking tape
    9832
    Masking tape 9832
    Scissors
    1234
    Scissors:1234
    Clipboard
    78766
    Clipboard:78766
    Masking tape
    9832
    Masking tape:9832

  • Split one column  value and insert into multiple columns

    hi
    am new to plsql .
    i want to split a characters from one column and insert into multiple columns
    i tried used substr function the symbol ',' vary his place dynamically ,so i can't apply substr function.
    for eg:  before split
    col1 :
    col2 :
    col3 :
    col4 :
    colu5: adsdf,fgrty,erfth,oiunth,okujt
    after split
    col1 :adsd
    col2 :fgrty
    col3 :erfth
    col4 :oiunth
    col5 : adsdf,fgrty,erfth,oiunth,okujt
    can anyone help me
    thanks
    Edited by: 800324 on Dec 23, 2010 8:28 AM
    Edited by: 800324 on Dec 23, 2010 8:36 AM

    How about:
    SQL> create table t
      2  (col1 varchar2(30)
      3  ,col2 varchar2(30)
      4  ,col3 varchar2(30)
      5  ,col4 varchar2(30)
      6  ,col5 varchar2(30)
      7  );
    Table created.
    SQL> insert into t (col5) values ('adsdf,fgrty,erfth,oiunth,okujt');
    1 row created.
    SQL> insert into t (col5) values ('x,y');
    1 row created.
    SQL> insert into t (col5) values ('a,b,c,d');
    1 row created.
    SQL> select * from t;
    COL1                           COL2                           COL3                           COL4                           COL5
                                                                                                                                adsdf,fgrty,erfth,oiunth,okujt
                                                                                                                                x,y
                                                                                                                                a,b,c,d
    3 rows selected.
    SQL>
    SQL> merge into t a
      2  using ( with t1 as ( select col5||',' col5
      3                       from   t
      4                     )
      5          select substr(col5, 1, instr(col5, ',', 1, 1)-1) col1
      6          ,      substr(col5, instr(col5, ',', 1, 1)+1, instr(col5, ',', 1, 2)- instr(col5, ',', 1, 1)-1) col2
      7          ,      substr(col5, instr(col5, ',', 1, 2)+1, instr(col5, ',', 1, 3)- instr(col5, ',', 1, 2)-1) col3
      8          ,      substr(col5, instr(col5, ',', 1, 3)+1, instr(col5, ',', 1, 4)- instr(col5, ',', 1, 3)-1) col4
      9          ,      rtrim(col5, ',') col5
    10          from   t1
    11        ) b
    12  on ( a.col5 = b.col5 )
    13  when matched then update set a.col1 = b.col1
    14                             , a.col2 = b.col2
    15                             , a.col3 = b.col3
    16                             , a.col4 = b.col4
    17  when not matched then insert (a.col1) values (null);
    3 rows merged.
    SQL> select * from t;
    COL1                           COL2                           COL3                           COL4                           COL5
    adsdf                          fgrty                          erfth                          oiunth                         adsdf,fgrty,erfth,oiunth,okujt
    x                              y                                                                                            x,y
    a                              b                              c                              d                              a,b,c,d
    3 rows selected.
    SQL> Assuming you're on 9i...

  • Adding the value of two columns and place to 3rd column in jtable

    hi all,
    i have table with 3 columns with rows
    say for example --loan, interest, total
    i want add loan+interest and place into total column.
    how can i do this?
    thanks in advance
    daya

    Use a TableModelListener:
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=566133

  • How to set cookie value in one page and retrieve in another page using setA

    How to set cookie value in one page and retrieve in another page using setActionListener?
    I have tried with following code srcpage.jspx->destpage.jspx
    srcpage.jspx
    <af:table value="#{bindings.DepartmentsView1.collectionModel}"
    var="emp" rows="#{bindings.EMPView1.rangeSize}"
    first="#{bindings.EMPView1.rangeStart}"
    emptyText="#{bindings.DepartmentsView1.viewable ? 'No rows yet.' : 'Access Denied.'}">
    <af:column sortProperty="EmployeeName" sortable="false"
    headerText="Cookie Testing">
    <af:commandLink text="#{emp.EmployeeName}" action="success">
    <af:setActionListener from="#{emp.EmployeeName}"
    to="#{cookie}"/>
    </af:commandLink>
    </af:column>
    </af:table>
    espage.jspx
    <af:outputText value="Test Cookie Value: #{cookie}"/>
    ,Here Test Cookie Value prints the following instead of its original String value
    {JSESSIONID=javax.servlet.http.Cookie@7da288, oracle.uix=javax.servlet.http.Cookie@399f62}
    I have passed employee name "Robert" to cookie in srcpage.jspx,but it prints "JSESSIONID....." instead of "Robert" in destpage.jspx
    Thanks in advance
    Kalee

    Hi,
    "cookie" is a reserved name. If you want to write to a session scope attribute called "cookie" then you have to call #{sessionScope.cookie}. If you want to use EL to set and read from cookies then you will have to use
    #{cookie.cookieName}
    Note that #{cookie} writes to and returns a map
    check this: http://www.informit.com/articles/article.aspx?p=30946&seqNum=7
    Frank

  • How to copy one column BLOB value into another column of another database.

    How to copy one column BLOB value into another column of another database.
    BLOB value contains word document.
    I thought of copy the BLOB value into a text file and then update the new column value by the same text in textfile. Will this work?
    Is there any other better way to do this?

    You're welcome
    BLOB fields contains binary data. I don't think you can do this
    Also if I view the BLOB as text. Can I copy it and insert into the new database.
    I think your options are as I said. Datapump or CTAS
    Best Regards

  • How to pass value between two forms.

    Hi all,
    how to pass value between two forms(using :parameter),...
    Thanks
    Rajesh

    To use parameters, create a parameterlist with the named parameters
    DECLARE
      pl_id PARAMLIST;
      pl_name VARCHAR2(10) := 'tempdata';
    BEGIN
      pl_id := Get_Parameter_List(pl_name);
      IF not Id_Null(pl_id) THEN
        DESTROY_PARAMETER_LIST(pl_id);
      END IF;
      pl_id := Create_Parameter_List(pl_name);
      ADD_PARAMETER (pl_id,'MYPARAMETER',TEXT_PARAMETER,:BLOCK.VALUE);      
      CALL_FORM('MYNEWFORM', NO_HIDE, DO_REPLACE, NO_QUERY_ONLY, pl_id);
    END;In the new form you can then just access the parameters via :PARAMETER.MYPARAMETER;
    An alternative is the usage of globals:
    :GLOBAL.MYPARAM:=:BLOCK.VALUE;
    -- call the emp-form
    CALL_FORM('MYNEWFORM', NO_HIDE, DO_REPLACE);and in the new form use:
    DEFAULT_VALUE(NULL, 'GLOBAL.MYPARAM');
    IF :GLOBAL.MYPARAM IS NOT NULL THEN
    ...The advantage of gloabls is that they can also return values back to the calling form, which is not possible using parameters

  • How to know  columns and table name  whose column size are modified

    Hi guys
    I want to know which all columns in the tables are modify
    i.e. list of columns and table name whose column size are modified
    Step1 :
    CREATE TABLE employees
    ( employee_number number(5) ,
    employee_name varchar2(50) ,
    department_id number(10)
    CREATE TABLE Supplier
    ( Supplier_number number(5) ,
    Supplier_name varchar2(50) ,
    CREATE TABLE customers
    ( customer_id number(10) not null,
    customer_name varchar2(50),
    address varchar2(50),
    city varchar2(50),
    state varchar2(25),
    zip_code varchar2(10),
    Step2 :
    Alter table employees
    MODIFY employee_number number(10)
    ALTER TABLE supplier
    MODIFY supplier_name varchar2(100)
    step3
    query to dispaly
    columnname table name
    employee_number employees
    supplier_name supplier
    How to know columns and table name whose column size are modified
    could you please provide query
    Thanks in Advance

    09:35:50 SQL> desc dba_objects
    Name                            Null?    Type
    OWNER                                  VARCHAR2(30)
    OBJECT_NAME                             VARCHAR2(128)
    SUBOBJECT_NAME                         VARCHAR2(30)
    OBJECT_ID                             NUMBER
    DATA_OBJECT_ID                         NUMBER
    OBJECT_TYPE                             VARCHAR2(19)
    CREATED                             DATE
    LAST_DDL_TIME                             DATE
    TIMESTAMP                             VARCHAR2(19)
    STATUS                              VARCHAR2(7)
    TEMPORARY                             VARCHAR2(1)
    GENERATED                             VARCHAR2(1)
    SECONDARY                             VARCHAR2(1)
    NAMESPACE                             NUMBER
    EDITION_NAME                             VARCHAR2(30)LAST_DDL_TIME can be utilized

  • How to assign Values to nested table and pass as parameter to procedure?

    How to assign Values to nested table and pass as parameter to procedure?
    Below is the Object and its type
    create or replace type test_object1 as object
    val1 varchar2(50),
    val2 varchar2(50),
         val3 varchar2(50)
    create or replace type test_type1 is table of test_object1;
    create or replace type test_object2 as object
    val1 varchar2(50),
    val2 varchar2(50),
         val3 varchar2(50)
    create or replace type test_type2 is table of test_object2;
    GRANT ALL ON test_object1 TO PUBLIC;
    GRANT ALL ON test_type1 TO PUBLIC;
    GRANT ALL ON test_object2 TO PUBLIC;
    GRANT ALL ON test_type2 TO PUBLIC;
    here is the table made of object type:
    create table test_object_tpe
    sl_num NUMBER,
    description VARCHAR2(100),
    main_val1 test_type1,
    main_val2 test_type2
    NESTED TABLE main_val1 STORE AS tot1
    NESTED TABLE main_val2 STORE AS tot2;
    here is the procedure which inserts values into nested table:
    PROCEDURE INSERT_TEST_DATA(sl_num IN NUMBER,
    description IN VARCHAR2,
    p_main_val1 IN test_type1,
    p_main_val2 IN test_type2
    IS
    BEGIN
    FOR rec in p_main_val1.first..p_main_val1.last
    LOOP
    INSERT INTO xxdl.test_object_tpe
    sl_num,
    description,
    main_val1,
    main_val2
    VALUES
    sl_num
    ,description
    ,test_type1 (test_object1(
    p_main_val1(rec).val1,
                                       p_main_val1(rec).val2,
    p_main_val1(rec).val3
    ,test_type2 (test_object2( p_main_val2(rec).val1,
                        p_main_val2(rec).val2,
                        p_main_val2(rec).val3
    END LOOP;
    commit;
    END INSERT_TEST_DATA;
    here is the anonymoys block which assigns values to the object type and pass values into the procedure:
    set serveroutput on;
    declare
    p_sl_num NUMBER := 1001;
    p_description VARCHAR2(50) := 'Testing Val1';
    inval1 test_type1 := test_type1();
    inval2 test_type2 := test_type2();
    begin
    inval1(1).val1 := 'testx1';
    inval1(1).val2 := 'testx2';
    inval1(1).val3 := 'testx3';
    inval2(1).val1 := 'testy1';
    inval2(1).val2 := 'testy2';
    inval2(1).val3 := 'testy3';
    CSI_PKG.INSERT_TEST_DATA(sl_num => p_sl_num,
    description => p_description,
    p_main_val1 => inval1,
    p_main_val2 => inval2
    end;
    Can anybody correct me.
    Thanks,
    Lavan

    Thanks for posting the DDL and sample code but whenever you post provide your 4 digit Oracle version (result of SELECT * FROM V$VERSION).
    >
    How to assign Values to nested table and pass as parameter to procedure?
    >
    Well you are doing almost everything wrong that could be done wrong.
    Here is code that works to insert data into your table (the procedure isn't even needed).
    declare
    p_sl_num NUMBER := 1001;
    p_description VARCHAR2(50) := 'Testing Val1';
    inval1 test_type1 := test_type1();
    inval2 test_type2 := test_type2();
    begin
    inval1.extend();
    inval1(1) := test_object1('testx1', 'testx2', 'testx3');
    inval2.extend();
    inval2(1) := test_object2('testy1', 'testy2', 'testy3');
    INSERT INTO test_object_tpe
    sl_num,
    description,
    main_val1,
    main_val2
    VALUES
    (p_sl_num, p_description, inval1, inval2);
    commit;
    end;
    /See Example 5-15 Referencing a Nested Table Element in Chap 5 Using PL/SQL Collections and Records in the PL/SQL doc
    http://docs.oracle.com/cd/B28359_01/appdev.111/b28370/collections.htm#CJABEBEA
    1. You don't even need the procedure since all it does is a simple INSERT into the table which you can do directly (see my code above)
    inval1(1).val1 := 'testx1';There is no element one (1) of 'inval1' since you haven't created any elements yet. You need to EXTEND the collection to add an element
    inval1.extend();And then there is an empty element but 'inval1' is a container for objects of type 'test_object1' not for scalars like 'val1', 'val2', and 'val3'.
    So you can't do
    inval1(1).val1 := 'testx1';You have to create an instance of 'test_object1'
    inval1(1) := test_object1('testx1', 'testx2', 'testx3');And so on for the other collection
    You don't need the procedure (as my sample code shows) but once you populate the variables properly it will work.

  • How to parse a delimited string and insert into different columns?

    Hi Experts,
    I need to parse a delimited string ':level1_value:level2_value:level3_value:...' to 'level1_value', 'level2_value', etc., and insert them into different columns of one table as one row:
    Table_Level (Level1, Level2, Level3, ...)
    I know I can use substr and instr to get level value one by one and insert into Table, but I'm wondering if there's better ways to do it?
    Thanks!

    user9954260 wrote:
    However, there is one tiny problem - the delimiter from the source system is a '|' When I replace your test query with | as delimiter instead of the : it fails. Interestingly, if I use ; it works. See below:
    with t as (
    select 'str1|str2|str3||str5|str6' x from dual union all
    select '|str2|str3|str4|str5|str6' from dual union all
    select 'str1|str2|str3|str4|str5|' from dual union all
    select 'str1|str2|||str5|str6' from dual)
    select x,
    regexp_replace(x,'^([^|]*).*$','\1') y1,
    regexp_replace(x,'^[^|]*|([^|]*).*$','\1') y2,
    regexp_replace(x,'^([^|]*|){2}([^|]*).*$','\2') y3,
    regexp_replace(x,'^([^|]*|){3}([^|]*).*$','\2') y4,
    regexp_replace(x,'^([^|]*|){4}([^|]*).*$','\2') y5,
    regexp_replace(x,'^([^|]*|){5}([^|]*).*$','\2') y6
    from t;
    The "bar" or "pipe" symbol is a special character, also called a metacharacter.
    If you want to use it as a literal in a regular expression, you will need to escape it with a backslash character (\).
    Here's the solution -
    test@ORA11G>
    test@ORA11G> --
    test@ORA11G> with t as (
      2    select 'str1|str2|str3||str5|str6' x from dual union all
      3    select '|str2|str3|str4|str5|str6' from dual union all
      4    select 'str1|str2|str3|str4|str5|' from dual union all
      5    select 'str1|str2|||str5|str6' from dual)
      6  --
      7  select x,
      8         regexp_replace(x,'^([^|]*).*$','\1') y1,
      9         regexp_replace(x,'^[^|]*\|([^|]*).*$','\1') y2,
    10         regexp_replace(x,'^([^|]*\|){2}([^|]*).*$','\2') y3,
    11         regexp_replace(x,'^([^|]*\|){3}([^|]*).*$','\2') y4,
    12         regexp_replace(x,'^([^|]*\|){4}([^|]*).*$','\2') y5,
    13         regexp_replace(x,'^([^|]*\|){5}([^|]*).*$','\2') y6
    14  from t;
    X                         Y1      Y2      Y3      Y4      Y5      Y6
    str1|str2|str3||str5|str6 str1    str2    str3            str5    str6
    |str2|str3|str4|str5|str6         str2    str3    str4    str5    str6
    str1|str2|str3|str4|str5| str1    str2    str3    str4    str5
    str1|str2|||str5|str6     str1    str2                    str5    str6
    4 rows selected.
    test@ORA11G>
    test@ORA11G>isotope
    PS - it works for semi-colon character ";" because it is not a metacharacter. So its literal value is considered by the regex engine for matching.
    Edited by: isotope on Feb 26, 2010 11:09 AM

  • SQL*Loader - How to combine Flat File 3 columns and put into one single column

    Receive a flat file delimited by comma. Want to combine Flat File last 3 columns and put into one single column(Table).
    e.g.
    Flat File
    100,239,30,20,30
    While inserting into table want to combine last 3 columns and insert into invoice number column.
    302030

    It is not possible to combine the last 3 columns as those columns are seperated by commas and in the SQL Loader control file you must ve specified COMMA as an delimiter. So u better have all the columns in the table plus add one more column which holds the concatenation of the 3 columns.
    Vijay

  • Compare 45 columns and update one table col

    I am using Oracle 9i database.I need to compare each record between two tables
    and update the one of table column (what records are updated)
    CURSOR cur1 is select t1., t2. from t1, t2 where t1.primarykey = t2.primarykey
    FOR rec1 IN cur1
    LOOP
    IF rec1.t1_col_1<>rec1.t2_col_1
    then
    update t1
    set col_t1.rem="MOdified",t.col_1=rec1.t2_col_1
    where t1.primerykey=rec1.primarykey
    END IF;
    IF rec1.t1_col_2<>rec1.t2_col_2
    then
    update t1
    set col_t1.rem="MOdified",t.col_2=rec1.t2_col_2
    where t1.primerykey=rec1.primarykey
    END IF;
    ..........45 if else conditions
    END LOOP;
    I have 1 million records to compare and 45 columns to compare, how do I increase performance.
    Currently it takes about 5hrs for the cursor to go through this if -else comparison.
    Thanks and Regards
    Swayamprakash.Chiluveru

    Hi Swayamprakash,
    Few basics first.
    1. DML SQL's perform better than PL/SQL. Sounds great but Oracle then need to hop between SQL and PL/SQL engine for every record in the cursor causing THRASHING. This is an old concept, reference of which can be found in Operating Systems.
    With Bulk Collect option, this could be minimized to a large extent, but causes a large amount of Undo being generated. This is another pitfall of using Bulk Collect. Morever, when you expect more percentage of records to be updated, it is advisable that the indices (if any) must be disabled. They can be rebuild afterwards causing very minimal amount of Undo. Performance gain is expected here.
    Now a query that you need to clarify:
    1. One million records to be updated on a diurnal basis - An OLTP database might need this functionality which is better handled by a screen driven interface rather than a SQL/Procedure running in background.
    An OLAP database must simply ignore such requirements for they are meant to be history archives.
    Suggestion:
    Merge - Seems to be the only optimal solution at the moment for the exact requirements are unclear. Already, somone has suggested this.
    Oracle Developers, DBA's must setp out from technicalities and turn towards functionality.
    Kind regards,
    Abhijit

Maybe you are looking for