Updating a column

I have a column that I am updating in a table using two udpate scripts because I am converting several tables to one table and the column and some data has one key I need to use to update and other data has another key. However, when I run one it clears out the column updated by the other and vice versa. Can someone tell me what I am doing wrong? It doesn not matter which update runs first or second. The udpates are:
UPDATE SERIAL_COMPNT_ALLOW_COPY t1
SET serialized_compnt_id =
     (SELECT
     serialized_compnt_id
          FROM SERIALIZED_COMPNT t2
          WHERE t2.cmpny_part_nbr = t1.cmpny_part_nbr
AND t2.serial_nbr = t1.serial_nbr
          AND t1.cmpny_part_nbr NOT LIKE 'ENG%'
          AND t2.cmpny_part_nbr NOT LIKE 'ENG%'
COMMIT;
and
UPDATE SERIAL_COMPNT_ALLOW_COPY t1
SET serialized_compnt_id =
     (SELECT
     serialized_compnt_id
          FROM SERIALIZED_COMPNT t2
          WHERE t2.cmpny_part_nbr = t1.cmpny_part_nbr
AND t2.serial_nbr = DECODE(SUBSTR (t1.serial_nbr,1,1),'0',SUBSTR(t1.serial_nbr,2,15), t1.serial_nbr)
          AND t1.cmpny_part_nbr LIKE 'ENG%'
          AND t2.industrial_item_nbr = '000'
COMMIT;
Thank you.

You probably need to add WHERE EXISTS clauses to your updates. Like this...
UPDATE SERIAL_COMPNT_ALLOW_COPY t1
SET    serialized_compnt_id =
             (SELECT serialized_compnt_id
              FROM   SERIALIZED_COMPNT t2
              WHERE  t2.cmpny_part_nbr = t1.cmpny_part_nbr
              AND    t2.serial_nbr = t1.serial_nbr
              AND    t1.cmpny_part_nbr NOT LIKE 'ENG%'
              AND    t2.cmpny_part_nbr NOT LIKE 'ENG%'
WHERE EXISTS (SELECT serialized_compnt_id
              FROM   SERIALIZED_COMPNT t2
              WHERE  t2.cmpny_part_nbr = t1.cmpny_part_nbr
              AND    t2.serial_nbr = t1.serial_nbr
              AND    t1.cmpny_part_nbr NOT LIKE 'ENG%'
              AND    t2.cmpny_part_nbr NOT LIKE 'ENG%'
;

Similar Messages

  • Getting errors when updating a column on a table having a primary key

    Hi,
    I have an application on Oracle APEX that raises the following error after an attempt (through the application) to update a column with no specific constraint on it:
    ORA-06550: line 1, column 17: PL/SQL: ORA-00936: missing expression ORA-06550: line 1, column 9: PL/SQL: SQL Statement ignoredUnable to fetch row.
    The involved table has a primary key conatraint and the corresponding column can be populated by a sequence (but there is no trigger to manipulate the sequence).
    The sequence is mentioned in the involved page definition for populating the primary key.
    If I disable the primry key and set to null the corresponding value for the primary of the record to be updated, then it is possible to update that record (thus the above column) through the application.
    Did someone encountered this situation before?
    If yes, what was then your workaround/solution?
    Kind Regards.

    Dear user8058501 ,
    Firstly) Did you check
    Auto Row Fetch (After upgrade to 4.0.1)
    Automated Row Fetch on Table with Synonym causes ORA-00936: missing expr.
    Secondly) If the problem is not resolved, Would you provide a sample on apex.oracle.com with workspace/developer account to be able to help you
    Please, if this solves your question, mark it as Correct. Otherwise as helpful.
    Best Regards
    Mahmoud

  • Update a column for a subset of data

    Hi all,
    I hope you can help me with some suggestions in how to solve the issue i have for the table below
    SQL> select * from table1;
    NAME                         ID CONCAT               SAME_GR
    A                            10 100|200|300
    B                            11 100|200|300
    C                            12 100|200
    D                            10 100|200|300
    SQL> What i need to do is to flag the rows which have the same ID & Concat value by updating the same_gr column with the same value, something like
    SQL> select * from table1;
    NAME                         ID CONCAT               SAME_GR
    A                            10 100|200|300              GR1
    B                            11 100|200|300              GR2
    C                            12 100|200                   GR3
    D                            10 100|200|300             GR1
    SQL> One important note is that the value in SAME_GR column should have the form of GR<sequence>
    I've been trying to use lag/lead functions but i can't succeed in updating the column with the same value for each group of rows where ID & CONCAT are the same.
    I forgot to mention i'm on 11gR1.
    Any help is very much appreciated.
    Cheers,
    Dani
    Edited by: DanyC on Jun 18, 2010 10:40 AM

    yes, you can.. all you need to do add is sum operation. after dense_Rank column sepecify + 254 and thus it will add up the value with dense rank output.
    sample run...
    PRAZY@11gR2> select ename,dense_rank() over (partition by deptno order by empno) from emp;
    ENAME      DENSE_RANK()OVER(PARTITIONBYDEPTNOORDERBYEMPNO)
    CLARK                                                    1
    KING                                                     2
    MILLER                                                   3
    SMITH                                                    1
    JONES                                                    2
    SCOTT                                                    3
    ADAMS                                                    4
    FORD                                                     5
    ALLEN                                                    1
    WARD                                                     2
    MARTIN                                                   3
    BLAKE                                                    4
    TURNER                                                   5
    JAMES                                                    6
    14 rows selected.
    Elapsed: 00:00:00.13
    PRAZY@11gR2> select ename,dense_rank() over (partition by deptno order by empno)+300 from emp;
    ENAME      DENSE_RANK()OVER(PARTITIONBYDEPTNOORDERBYEMPNO)+300
    CLARK                                                      301
    KING                                                       302
    MILLER                                                     303
    SMITH                                                      301
    JONES                                                      302
    SCOTT                                                      303
    ADAMS                                                      304
    FORD                                                       305
    ALLEN                                                      301
    WARD                                                       302
    MARTIN                                                     303
    BLAKE                                                      304
    TURNER                                                     305
    JAMES                                                      306
    14 rows selected.
    Elapsed: 00:00:00.01Regards,
    Prazy

  • How to update a column with default in a tabular form.

    We have a tabular form that has a submit button that does a multi row update. We would like to update a column with a defaut like APP_USER = updated user when the row is updated. Is this possible and how?

    used lovs and conditions.

  • Trans. Replication failing -- "Cannot update identity column ..." -- unable to use sp_browsereplcmds to view statement

    All, I'm trying fix an issue with transactional replication where replication monitor is showing the push to the subscriber is failing because of the error, "Cannot update identity column."  I've tried to use sp_browsereplcmds to pull up the
    command that's failing based on the xact_seqno but when I try that I get the error:
    Number: 102, State: 1, Procedure: , LineNumber: 0, Server: , Source: .Net SqlClient Data Provider
    Message: Incorrect syntax near '┻'.
    I'd like to fix the issue without having to rebuild replication during a maintenance window.  I know you cannot publish tables with primary keys, but I'm wondering if dropping the identity column on this table might fix the issue.  I'm considering
    that but I would prefer to be able to pull the command that's trying to update the identity column, throw in SET IDENTITY_INSERT ON and remove the commands from the distribution database, but if that doesn't work I'm open to ideas of just dropping the primary
    key on the replicated table.  I think that should be fine.
    Does anyone have any recommendations on how to view the command that's failing?
    Or if dropping the primary key on the subscriber table would create issues with the publisher (since it is also the primary key)?
    Or, know of any other ways in which to address this issue?  Thanks.

    Unfortunately, no.  The error was a bit of a red herring.  In the end the subscriber was missing all of the stored procedures needed to update data in the published tables (i.e., the procedures for performing inserts/updates/deletes were missing
    for every table in the subscriber database).  Additionally, I could not recreate these stored procedures using sp_scriptpublicationcustomprocs
    because another procedure which was required for that proc to work was also missing. In short, there were hundreds of missing stored procedures in the subscriber database on which transactional replication is dependent in order to replicate DML changes and
    function normally and this includes system sprocs which would've been used to recreate the missing DML procs. In short, the subscriber was badly damaged and deemed to be unrecoverable within a reasonable time frame.
    The solution was to tear down and start over, which we did successfully later in the evening. 

  • Error when updating blob column

    Hello,
    im using the SQL-Developer and i have problems with updating blob columns.
    I'm getting the following error:
    UPDATE "MED400_INSTALL"."AMEDN_INSURANCE_TEMPL" SET WHERE ROWID = 'AAM6j5ABGAAAADpAAJ' AND ORA_ROWSCN = '26019698898'
    One error saving changes to table "MED400_INSTALL"."AMEDN_INSURANCE_TEMPL":
    Row 15: ORA-01410: Ungültige ROWID
    I'm updating different tables and different rows.
    This error is not shown in all cases. I can update some rows but not all off them.
    Is this a bug?
    TIA

    I made some further investigations and have some more results.
    - the problem does not occur all the time
    - the problem seems to occur in the following situation
    - User A: updates the blob-field using the sql developer menu and commits (-> success)
    - User B: updates the blob-field using the sql developer menu and tries to commit (-> error)
    - the error stays until User B does a rollback, after the rollback user B can update the blob-field! and user A gets the error.
    Here are some extracts of sql developer log. It shows that the same row can be updated in somes cases, in others cases you get an error. After a rollback the field can be updated successfully The rowid ist the same. ora_rowscn is different:
    UPDATE "AZUBI2"."AMEDN_INSURANCE_TEMPL" SET WHERE ROWID = 'AAc6TTACEAAAAHQAAC' AND ORA_ROWSCN = '26087686991'
    One error saving changes to table "AZUBI2"."AMEDN_INSURANCE_TEMPL":
    Row 1: ORA-01410: Ungültige ROWID
    Rollback Successful
    UPDATE "AZUBI2"."AMEDN_INSURANCE_TEMPL" SET WHERE ROWID = 'AAc6TTACEAAAAHQAAC' AND ORA_ROWSCN = '26087687075'
    Commit Successful
    I could offer a dump where you can possibly reproduce this issue. Where can I send or upload it.
    Best regards,
    zebadmin

  • ADF 11g Partial Triggers Row Column Update By Column in the Same Row

    Hi.
    I have a situation whereby I have a checkbox in a table row, which has an eventchangelistener, which upon activation, trys to update another column in the same row. I can not get this to work through partial triggers, even though I have set up my ids up correctly. The row though can be updated by a command button outside of the table using the same coding techniques, but I need it updated via the checkbox.
    Is there a limitation in updating a column within a row, from another row column's event change listener.
    Thanks.

    Updating the other rows from the checkbox works fine for me. Here is what I did.
    I DnD Emp table with a new column that says if the emp is new hire. If the checkbox is checked, I set Firstname and Lastname for that row as NewHire. I have partial triggers on Firstname and Lastname columns to update whenever checkbox is checked/unchecked and autosubmit on checkbox to true. Hope this helps.
    Try adding column selection property to single and see if it helps.
    Edited by: asatyana on Jan 16, 2012 12:48 AM
    Edited by: asatyana on Jan 16, 2012 12:49 AM

  • Retrieving column value from multiselect managed metadata column and updating metadat column in list.

    I have Library having metadata column when a document is uploaded i need update another list with metadata column of
    library in list.I have an event reciever to do that,Code is given below
    public override void ItemUpdated(SPItemEventProperties properties)
                base.ItemUpdated(properties);
                    SPList saList = properties.Web.Lists["mylist"];
                    SPListItem item = saList.AddItem();
                    item["Department"] = properties.ListItem["Department"].ToString();
                    EventFiringEnabled = false;
                    item.Update();
                    EventFiringEnabled = true;   
    my elements.xml file is as below
    <?xml version="1.0" encoding="utf-8"?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
      <Receivers ListUrl="Documents">
          <Receiver>
            <Name>DocumentItemUpdated</Name>
            <Type> ItemUpdated</Type>
            <Assembly>$SharePoint.Project.AssemblyFullName$</Assembly>
            <Class>MyDocuments.Documents.Documents</Class>
            <SequenceNumber>10000</SequenceNumber>
          </Receiver>
      </Receivers>
    </Elements>
    but i did not see the the List column getting updated.But when i use the code to update a column of single line of text
    it works fine.But when i do it for multi select metadata column in debug mode i could see its giving null value even though Library had column value.
    Any pointers on how to update Multiselect metadata column programatically on itemeadding event in library to a list will
    be helpful.

    You need to use the TaxonomyFieldValueCollection class. The following code is from SP2010 but should still apply in SP2013. It is an example of updating multivalued taxonomy fields.
    public static void SetListItemMultiMetaDataColumn(Int32 id)
    using (SPSite site = new SPSite("http://basesmc2008"))
    using (SPWeb web = site.OpenWeb())
    TermSet termSet = null;
    TaxonomySession txs = new TaxonomySession(site);
    SPList list = web.Lists["Shared Documents"] as SPList;
    SPListItem item = list.GetItemById(id);
    TaxonomyField field = item.Fields["multimanage"] as TaxonomyField;
    if (field != null)
    termSet = txs.DefaultSiteCollectionTermStore.GetTermSet(field.TermSetId);
    Term term = termSet.GetTerms("sts", false).FirstOrDefault();
    if (field.AllowMultipleValues)
    TaxonomyFieldValueCollection currentCollection = item[field.Id] as TaxonomyFieldValueCollection;
    TaxonomyFieldValue tfv = new TaxonomyFieldValue(field);
    tfv.TermGuid = term.Id.ToString();
    tfv.Label = term.GetPath();
    tfv.WssId = TaxonomyField.GetWssIdsOfTerm(site, txs.DefaultSiteCollectionTermStore.Id, termSet.Id, term.Id, false, 1).First();
    currentCollection.Add(tfv);
    field.SetFieldValue(item, currentCollection);
    item.Update();
    Blog |SharePoint Field Notes Dev Tool |
    SPFastDeploy

  • Update SAME column name in two tables from ONE query

    Dear All Seniors
    Please tell me is it possible to update a same column name in two tables.
    I have two tables in same schema
    (1)table name
    pem.igp_parent
    column name
    igp_no.
    igp_type
    (2)table name
    pem.igp_child
    column name
    igp_no.
    igp_type
    i want to update igp_no column in one query please tell me how it would be possible.
    thanks
    yassen

    You want to update the data from what to what? Where is the new data coming from?
    If you are trying to put the same data in two different tables, that strongly implies that you have a normalization problem that needs to be addressed.
    Why do you want a single query rather than updating each table in turn? Can you join the two target tables to produce a key-preserved view?
    Justin

  • Updating a column from other table

    Hi all,
    I have a simple update query problem. I have four tables
    activist(activist_id,first_name,last_name,c_state),
    membership(activist_id,g_n_id),
    group_network(g_n_id,g_n_type_id),
    school_grop_det(g_n_id,state). For some records in activist table the c_state column is null, i want to update that column with state column of school_group_det table.
    Here is the query for the states which are null
    select distinct a.activist_id,a.first_name,a.last_name,
    a.c_state,sd.state from activist a,membership m,
    group_network g,school_group_det sd where
    a.activist_id=m.activist_id and g.g_n_id=m.g_n_id and
    g.g_n_id=sd.g_N_id and a.c_state is null and g.g_n_type_id='1001'
    order by a.activist_id
    I got the activist_id,first_name,last_name,c_state from activist and state from school_group_det. now i as i told you want to update the c_state with state column of school_group_Det table.
    Pleae any one help me
    Thanks
    Srinivas

    For ur query the reply whay u have got is correct one. For further quries similar to one u had u can download a tool named TOAD (Tools for Oracle Application Developer) from quest site (www.quest.com). Install it a proceed.
    Do let me know how and what u feek about TOAD.

  • Update A Column In A Database Table.

    I am unable to update a column in a database table.
    For example; I have ten records in an EMP table without having any EMPNO. I want to UPDATE (insert) 10 different EMPNO in a table. How can I do it? All I know is that there are ten records in the table; this means that I cannot use a WHERE clause with different criteria for each row.
    Thanks.

    Try something like this
    SQL> select * from emp_1
      2  /
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
          7369 SMITH      CLERK           7902 17-DEC-80        800                    20
          7499 ALLEN      SALESMAN        7698 20-FEB-81       1600        300         30
          7521 WARD       SALESMAN        7698 22-FEB-81       1250        500         30
          7566 JONES      MANAGER         7839 02-APR-81       2975                    20
          7654 MARTIN     SALESMAN        7698 28-SEP-81       1250       1400         30
          7698 BLAKE      MANAGER         7839 01-MAY-81       2850                    30
          7782 CLARK      MANAGER         7839 09-JUN-81       2450                    10
          7788 SCOTT      ANALYST         7566 19-APR-87       3000                    20
          7839 KING       PRESIDENT            17-NOV-81       5000                    10
          7844 TURNER     SALESMAN        7698 08-SEP-81       1500          0         30
          7876 ADAMS      CLERK           7788 23-MAY-87       1100                    20
          7900 JAMES      CLERK           7698 03-DEC-81        950                    30
          7902 FORD       ANALYST         7566 03-DEC-81       3000                    20
          7934 MILLER     CLERK           7782 23-JAN-82       1300                    10
    14 rows selected.
    SQL> insert into emp_1(empno, ename, job, mgr, hiredate, sal, comm, deptno)
      2  select null, ename, job, mgr, hiredate, sal, comm, deptno
      3    from emp_1
      4   where rownum <= 10
      5  /
    10 rows created.
    SQL> select * from emp_1
      2  /
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
          7369 SMITH      CLERK           7902 17-DEC-80        800                    20
          7499 ALLEN      SALESMAN        7698 20-FEB-81       1600        300         30
          7521 WARD       SALESMAN        7698 22-FEB-81       1250        500         30
          7566 JONES      MANAGER         7839 02-APR-81       2975                    20
          7654 MARTIN     SALESMAN        7698 28-SEP-81       1250       1400         30
          7698 BLAKE      MANAGER         7839 01-MAY-81       2850                    30
          7782 CLARK      MANAGER         7839 09-JUN-81       2450                    10
          7788 SCOTT      ANALYST         7566 19-APR-87       3000                    20
          7839 KING       PRESIDENT            17-NOV-81       5000                    10
          7844 TURNER     SALESMAN        7698 08-SEP-81       1500          0         30
          7876 ADAMS      CLERK           7788 23-MAY-87       1100                    20
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
          7900 JAMES      CLERK           7698 03-DEC-81        950                    30
          7902 FORD       ANALYST         7566 03-DEC-81       3000                    20
          7934 MILLER     CLERK           7782 23-JAN-82       1300                    10
               SMITH      CLERK           7902 17-DEC-80        800                    20
               ALLEN      SALESMAN        7698 20-FEB-81       1600        300         30
               WARD       SALESMAN        7698 22-FEB-81       1250        500         30
               JONES      MANAGER         7839 02-APR-81       2975                    20
               MARTIN     SALESMAN        7698 28-SEP-81       1250       1400         30
               BLAKE      MANAGER         7839 01-MAY-81       2850                    30
               CLARK      MANAGER         7839 09-JUN-81       2450                    10
               SCOTT      ANALYST         7566 19-APR-87       3000                    20
               KING       PRESIDENT            17-NOV-81       5000                    10
               TURNER     SALESMAN        7698 08-SEP-81       1500          0         30
    24 rows selected.
    SQL> select max(empno) from emp_1
      2  /
    MAX(EMPNO)
          7934
    SQL> create sequence emp_seq start with 7935
      2  /
    Sequence created.
    SQL> update emp_1 set empno = emp_seq.nextval where empno is null
      2  /
    10 rows updated.
    SQL> select * from emp_1
      2  /
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
          7369 SMITH      CLERK           7902 17-DEC-80        800                    20
          7499 ALLEN      SALESMAN        7698 20-FEB-81       1600        300         30
          7521 WARD       SALESMAN        7698 22-FEB-81       1250        500         30
          7566 JONES      MANAGER         7839 02-APR-81       2975                    20
          7654 MARTIN     SALESMAN        7698 28-SEP-81       1250       1400         30
          7698 BLAKE      MANAGER         7839 01-MAY-81       2850                    30
          7782 CLARK      MANAGER         7839 09-JUN-81       2450                    10
          7788 SCOTT      ANALYST         7566 19-APR-87       3000                    20
          7839 KING       PRESIDENT            17-NOV-81       5000                    10
          7844 TURNER     SALESMAN        7698 08-SEP-81       1500          0         30
          7876 ADAMS      CLERK           7788 23-MAY-87       1100                    20
          7900 JAMES      CLERK           7698 03-DEC-81        950                    30
          7902 FORD       ANALYST         7566 03-DEC-81       3000                    20
          7934 MILLER     CLERK           7782 23-JAN-82       1300                    10
          7935 SMITH      CLERK           7902 17-DEC-80        800                    20
          7936 ALLEN      SALESMAN        7698 20-FEB-81       1600        300         30
          7937 WARD       SALESMAN        7698 22-FEB-81       1250        500         30
          7938 JONES      MANAGER         7839 02-APR-81       2975                    20
          7939 MARTIN     SALESMAN        7698 28-SEP-81       1250       1400         30
          7940 BLAKE      MANAGER         7839 01-MAY-81       2850                    30
          7941 CLARK      MANAGER         7839 09-JUN-81       2450                    10
          7942 SCOTT      ANALYST         7566 19-APR-87       3000                    20
          7943 KING       PRESIDENT            17-NOV-81       5000                    10
          7944 TURNER     SALESMAN        7698 08-SEP-81       1500          0         30
    24 rows selected.

  • Update blob column

    dear all
    I am new to oracle database...
    and i create one BLOB column to insert the images..
    i can insert and retrieve the image data...
    but i cant update this column...
    can any one guide me to do this.
    i tried to empty the column and update but still fails..
    update tablename set columnname=empty_blob()
    i tried the above and its clear the data ...but again i cant update this ...
    i am using oracle 10g express edition.
    any suggestion
    thank you

    i tried to empty the column and update but still fails..How does it fail? Please describe the behaviour in more detail, including any error messages and related information.
    Cheers, APC
    blog: http://radiofreetooting.blogspot.com

  • Update Multiple Columns when concerned about redo/undo log sizes.

    Hi ,
    I have update statements that updates multiple columns at once if any of them is changed. What I see that even though the value of column is not changed it still increases the redo size.
    Below is a sample code similar to the ones in my code. Basically I check whether there is a difference in any of the columns to be updated and update all of them.
    Is there a way to improve redo log size without splitting the update statement for every column that I will be updating. Redo/Undo log size is a concern for us..
      For i In 1.rec.Count Loop
        Update employees e
           Set e.first_name = rec(i).first_name, e.last_name = rec(i).last_name
         Where e.first_name != rec(i).first_name
            Or e.last_name != rec(i).last_name;
      End Loop;My database is 10g.

    Muhammed Soyer wrote:
    Redo/Undo log size is a concern for us..You are worried about the wrong thing.
    If you are concerned about the amount of undo and redo, you should be less concerned about the small diffrence between updating 1 or 3 columns and remove the loop that is contributing to a massive increase in both undo and redo.
    Re: global temporary table row order
    Name                                  Run1        Run2        Diff
    STAT...undo change vector size     240,500   6,802,736   6,562,236
    STAT...redo size                 1,566,136  24,504,020  22,937,884Run2 shows what adding a loop to a regular SQL statement will do to undo and redo. It made the redo used 15 times greater and the undo almost 30 times greater.

  • Updating a column of a table

    Hi all
    I have a problem in updating one column in the target table(say table A) from a column in the source table (say table B).
    All the columns in table A has been populated. Just one column should be populated. My source is a SQL object that contains a complex sql query that returns three columns date_from, date_to and ID.
    In the table A, I have the same date_from and date_to and need to get the ID from the SQL object and set it to the corresponding ID in the table A.
    I tried many ways to update the table, but it I couldn't ;(
    I should read from a table and update it based on a look-up function mapped to the column I need to update.
    I want to map the ID colmn from table A to a look-up ext function that can get the column from the table B. However I don't know how to use the Data Services objects to just update 1 column. If you could give me a consequence of the DS objects to be update a table based on a look-up , I would be so grateful.
    Thanks.

    Your dataflow should look like this :
    1) Source = the SQL transform with date_from, date_to and ID as columns.
    2) Next add a query (copy all columns from schema in to schema out) and set date_from and date_to as keys. Also make sure column names exactly match the column names in your target table, if not rename them in this query.
    3) Add a Map_Operation transform that maps all "normal" operation codes to "update"
    4) Finally add your target table and in the properties/options set "use input keys" to yes (or checked).
    This will generate UPDATE statements for all columns used in the query with a WHERE clause based on the keys defined in the query (date_from, date_to).
    Ben.

  • Update two columns at a time

    HI can we update two columns at a time by regular update by mentioning two where clauses with respect to the columns

    just need to put a comma between the fields to update them at the same time
    update emp e1
    set e1.ename=upper(e1.ename), e1.sal=(select avg(e2.sal) from emp e2 where e2.deptno=10 group by e2.deptno)
    where e1.deptno=10;cheers ^^.
    PS: at least in the example you have written.
    PS2: sorry didnt put Edited by: Anaita on 31-ene-2011 1:58                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to programatically select a row in TableBean and update its column?

    Hi,
    Can anyone help me on How to programmatically select a row in a TableBean and update its column?
    Thanks,
    Jon

    Hi,
    My requirement is I need to update a column in a particular row of the table using fire action...
    I have a datefield bean serve as birhdate and base on this I need to update the age column depending on the given dates..
    Here's my code under the Process form request for your reference...
    if (actionInMainPersonScreen.equals("changeDate"))
    String checkId = pageContext.getParameter("paramDatePersonId");
    OAFormValueBean depPerId = (OAFormValueBean)depTable.findIndexedChildRecursive("ChildPersonID");
    OAMessageTextInputBean depFName = (OAMessageTextInputBean)depTable.findIndexedChildRecursive("FirstName");
    OAMessageDateFieldBean dateBirth = (OAMessageDateFieldBean)depTable.findIndexedChildRecursive("BDay");
    OAMessageStyledTextBean age = (OAMessageStyledTextBean)depTable.findIndexedChildRecursive("Age");
    Date changeBDate = new java.util.Date();
    Date dateToday = new java.util.Date();
    SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW);
    changeBDate = (Date)dateBirth.getValue(pageContext);
    Calendar cal = Calendar.getInstance();
    ResultSet empAge = null;
    String newAge = null;
    OADBTransaction trans = personam.getOADBTransaction();
    System.out.println("BirthDate: " + changeBDate + " Date Today: " + sdf.format(dateToday));
    String expQuery = "SELECT Trunc((sysdate - To_Date('" + pageContext.getParameter("paramDateBirth") + "'))/365) compAge, Sysdate from dual";
    System.out.println("SQL: " + expQuery);
    PreparedStatement expPreparedStatement = trans.createPreparedStatement(expQuery ,1);
    try
    empAge = expPreparedStatement.executeQuery();
    } catch (SQLException e) {}
    try
    while (empAge.next())
    newAge = empAge.getString("compAge");
    age.setText(pageContext, newAge);
    empAge.close();
    } catch (SQLException e) {}
    regards,
    Jon

Maybe you are looking for

  • Audio not working properly on exporting keynote to Quicktime

    Hello everybody, I've created a Keynote presentation, with voiceover. It runs perfectly when launched in keynote, standalone, but as I try to export it to quicktime, the audio from an embedded video clip (just one out of 3 clips embedded in the whole

  • Smart groups not working

    Whenever I try to set up a course as a smart group, not only do I not see any options (see http://tinyurl.com/34rnar6 ) but I get the warning "We could not complete your iTunes store request. The iTunes store is temporarily unavailable. Please try ag

  • How to read the RD Connect Broker DataBase!!!!

    The msdn say there is a RD Connect Broker Data Base , it store the session information,but i dont know where is it and how to read it ! Thank you !!!!

  • Create animation from some layers..how ?

    Hi, Pshop CS2 I can see make frames from layers, but with a many layered psd file of which I only have 5 frames I want to see how they animate, how do I tell the animate palette to make frames from just the selected layers ? Surely this has to be an

  • Problem with PO Work Flow

    Hi Gurus,                I am working on PO work flow. when I create a PO in workflow builder start event is getting into disable mode. Why its happening like that I could not understand. Can anybody please help me to find why the start event (Releas