UPDATE multiple columns with conditional SET parameters

I have a procedure that updates multiple columns of a table using the procedure's parameter. Is it possible to have one update statement with conditional SET parameter?
CREATE TABLE TEMP
(POL_NUM NUMBER,
OED DATE,
TERM NUMBER,
TRANS_CD CHAR(2));
INSERT INTO TEMP VALUES (1, '1 AUG 2009', 12, 'NB');
INSERT INTO TEMP VALUES (2, '4 AUG 2009', 12, 'XL');
INSERT INTO TEMP VALUES (3, '2 AUG 2009', 12, 'RN');
COMMIT;
CREATE OR REPLACE PROCEDURE TMP_PROC (
  pPOL_NUM NUMBER,
  pOED IN DATE,
  pTERM IN NUMBER,
  pTRANS_CD CHAR2)
AS
BEGIN
  IF pOED IS NOT NULL THEN
    UPDATE TEMP SET OED = pOED WHERE POL_NUM = pPOL_NUM;
  END IF;
  IF pTERM IS NOT NULL THEN
    UPDATE TEMP SET TERM = pTERM WHERE POL_NUM = pPOL_NUM;
  END IF;
  IF pTRAN_CD IS NOT NULL THEN
    UPDATE TEMP SET TRANS_CD = pTRANS_CD WHERE POL_NUM = pPOL_NUM;
  END IF;
  COMMIT;
EXCEPTION
  WHEN OTHERS THEN
     NULL;
END;Is it possible to replace multiple IFs from the code to have only one UPDATE statement with condition that update the column only if the passed parameter is not null? In real scenario I have more than 3 columns and I don't want to write many IF blocks.
Please help Gurus!!
Edited by: Kuul13 on Sep 18, 2009 1:26 PM

Hi,
You certainly don't want to issue separate UPDATE statements for every column; that will be really inefficent.
SQL has several ways to implement IF-THEN-ELSE logic. CASE is the most versatile, but NVL will do everything you need for this job. You can use one of those to set a column to itself (and therefore not really update that column) when appropriate.
For example:
CREATE OR REPLACE PROCEDURE TMP_PROC (
  pPOL_NUM   IN       NUMBER,
  pOED          IN   DATE,
  pTERM          IN   NUMBER,
  pTRANS_CD  IN       CHAR
AS
BEGIN
     UPDATE  temp
     SET     oed      = NVL (poed,       oed)
     ,     term      = NVL (pterm,       term)
     ,     trans_cd = NVL (ptrans_cd, trans_cd)
     WHERE     pol_num      = ppol_num;
  COMMIT;     -- Maybe
END    tmp_proc;"EXCEPTION WHEN OTHERS THEN NULL" is almost always a bad idea. If there's an error, don't you want to know about it? Shouldn't you at least log a message in a warnings table or something?
Think careflully about whether or not you want to COMMIT every time you call this procedure.
Just as it's inefficient to issue a separate UPDATE statement for every column, it's also inefficient to issue a separate UPDATE statement for every row. If efficiency is important, it should be possible to UPDATE several rows in a single UPDATE statement, using NVL (or CASE, or COALESCE, or NULLIF, or NVL2, or ...).
This was a very well-written question! Thanks for providing the CREATE TABLE and INSERT statements, and such a clear explanation.

Similar Messages

  • Update multiple columns with single update statement..

    HI all,
    i am reading the columns value from different table but i want to update it with signle update statement..
    such as how to update multiple columns (50 columns) of table with single update statement .. is there any sql statement available i know it how to do with pl/sql..

    As I understood, may be this. Here i am updating ename,sal, comm columns all at once.
    SQL> select * from emp where empno=7369;
         EMPNO ENAME      JOB              MGR HIREDATE                   SAL       COMM     DEPTNO
          7369 SMITH      CLERK           7902 17/12/1980 12:00:00        800                    20
    SQL> UPDATE emp
      2     SET ename = lower (ename),
      3         sal = sal + 1000,
      4         comm = 100
      5   WHERE empno = 7369;
    1 row updated.
    SQL> select * from emp where empno=7369;
         EMPNO ENAME      JOB              MGR HIREDATE                   SAL       COMM     DEPTNO
          7369 smith      CLERK           7902 17/12/1980 12:00:00       1800        100         20
    SQL> UPDATE emp
      2     SET ename = (SELECT 'ABCD' FROM DUAL),
      3         sal = (SELECT 1000 FROM DUAL),
      4         comm = (SELECT 100 FROM DUAL)
      5   WHERE empno = 7369;
    1 row updated.

  • Updating library column with Term Set Term description

    Hi Community,
    We are busy with a Document Management project using drop off libraries to file documents (docs) based on classification by a single level Term Set (example: "1000" (name) & "Client XYZ" (description)). Then auto
    create folders each time there is a new classifcation,i.e. term, used (example "1000 - Client XYZ").
     The challenge we have is that auto folder creation is not allowed on term sets, thus we want to strip out the term name (1000) and the corresponding description (Client XYZ) to 2 seperate text fields and then concatenate them to become
    an unique text field ("1000 - Client XYZ".) that can be used for the autocreation of folders in the library.
    Does any one now how this can be acheived or maybe even suggest a better approach?
    Kind Regards
    Philip

    I dont think with OOTB setting it can be done, however the logic which are explaining of concatenation could be done in custom code, what you need to do is as soon as a  document comes to drop off library on the item added event you can perform this
    operation to create a folder
    Mark ANSWER if this reply resolves your query, If helpful then VOTE HELPFUL
    INSQLSERVER.COM
    Mohammad Nizamuddin

  • Update Multiple Column with Single Command with Join between Two tables.

    This is our command where we are trying to update a table's two columns by pulling values from another table after joining. This query takes too much time to execute. Any suggestions ?
    UPDATE raw_alc_rmfscombinednew
    SET (BSC, CELL_NAME) =
    SELECT distinct raw_alc_R110combinednew.BSC, raw_alc_R110combinednew.CELL_NAME
    FROM raw_alc_R110Combinednew
    WHERE
    raw_alc_R110Combinednew.OMC_ID = raw_alc_rmfscombinednew.OMC_ID
    AND raw_alc_R110Combinednew.CELL_CI = raw_alc_rmfscombinednew.CI
    AND RAW_ALC_R110COMBINEDNEW.START_TIME = RAW_ALC_RMFSCOMBINEDNEW.START_TIME
    Results of Last execution:
    Elapsed Time (sec) 4,476.56
    CPU Time (sec) 4,471.88
    Wait Time (sec) 4.68
    Executions that Fetched all Rows (%) 100.00
    Average Persistent Mem (KB) 32.43
    Average Runtime Mem (KB) 31.59
    --------------------------------------------------------------

    Your update requires a full execution of the subquery for each row in the destination table (raw_alc_rmfscombinednew). Try rewriting as a MERGE. Tons faster.
    MERGE INTO raw_alc_rmfscombinednew  D
          USING ( SELECT distinct
                         BSC,
                         CELL_NAME
                         START_TIME
                    FROM raw_alc_R110Combinednew )  S
             ON (    S.OMC_ID     = D.OMC_ID
                 AND S.CELL_CI    = D.CI
                 AND S.START_TIME = D.START_TIME )
        WHEN MATCHED THEN
          UPDATE
             SET D.BSC        = S.BSC,
                 D.CELL_NAME  = S.CELL_NAME

  • How to prevent duplication on a column with condition

    Hello everyone,
    I need some advice here. At work, we have an Oracle APEX app that allow user to add new records with the automatic increment decision number based on year and group name.
    Says if they add the first record , group name AA, for year 2012, they get decision number AA 1 2013 as their displayed record casein the report page.
    The second record of AA in 2013 will be AA 2 2013.
    If they add about 20 records , it will be AA 20 2013.
    The first record for 2014 will be AA 1 2014.
    However, recently , we get a user complaint about two records from the same group name have the same decision number.
    When I looked into the history table, and find that the time gap between 2 record is just about 0.1 seconds.
    Besides, we have lookup table that allows admin user to update the Start Sequence number with the restraint that it has to be larger than the max number of the current group name of the current year.
    This Start sequence number and group name is stored together in a table.
    And in some other special case,user can add a duplicate decision number for related record. (this is a new function)
    The current procedure logic to add new record on the application are
    _Get max(decision_number) from record table with chosen Group Name and current year.
    _insert into the record table the new entered record with decision number + 1
    _ update sequence number to the just added decision number.
    So rather than utitlising APEX built-in automatic table modification process, I write a procedure that combine all the three process.
    I run some for loop to continuously execute this procedure, and it seems it can autotically generate new unique decision number with time gap about 0.1 second.
    However, when I increase the number of entry to 200, and let two users run 100 each.
    If the time gap is about 0.01 second, Duplicate decision numbers appear.
    What can I do to prevent the duplication ?
    I cannot just apply a unique constraint here even for all three columns with condition, as it can have duplicate value in some special condition. I don't know much about using lock and its impact.
    This is the content of my procedure
    create or replace
    PROCEDURE        add_new_case(
      --ID just use the trigger
      p_case_title IN varchar2,
      p_year IN varchar2,
      p_group_name IN VARCHAR2,
      --decisionnumber here
      p_case_file_number IN VARCHAR2,
      --active
      p_user IN VARCHAR2
    AS
      default_value NUMBER;
        caseCount NUMBER;
      seqNumber NUMBER;
      previousDecisionNumber NUMBER;
    BEGIN
      --execute immediate q'[alter session set nls_date_format='dd/mm/yyyy']';
      SELECT count(*)
            INTO caseCount
            FROM CASE_RECORD
            WHERE GROUP_ABBR = p_group_name
            AND to_number(to_char(create_date, 'yyyy')) = to_number(to_char(date_utils.get_current_date, 'yyyy'));
            SELECT max(decision_number)
            INTO previousDecisionNumber
            FROM CASE_RECORD
            WHERE GROUP_ABBR = p_group_name
            AND to_number(to_char(create_date, 'yyyy')) = to_number(to_char(date_utils.get_current_date, 'yyyy'));
            IF p_group_name IS NULL
            THEN seqNumber := 0;
            ELSE   
            SELECT seq_number INTO seqNumber FROM GROUP_LOOKUP WHERE ABBREVATION = p_group_name;
            END IF;
        IF caseCount > 0 THEN
               default_value := greatest(seqNumber, previousdecisionnumber)+1;
        ELSE
               default_value := 1;
        END IF; 
      INSERT INTO CASE_RECORD(case_title, decision_year, GROUP_ABBR, decision_number, case_file_number, active_yn, created_by, create_date)
      VALUES(p_case_title, p_year, p_group_name, default_value, p_case_file_number, 'Y', p_user, sysdate );
      --Need to update sequence here also
      UPDATE GROUP_LOOKUP
      SET SEQ_NUMBER = default_value
      WHERE ABBREVATION = p_group_name;
      COMMIT;
    EXCEPTION
    WHEN OTHERS THEN
        logger.error(p_message_text => SQLERRM
                    ,p_message_code => SQLCODE
                    ,p_stack_trace  => dbms_utility.format_error_backtrace
        RAISE;
    END;
    Many thanks in advance,
    Ann

    Why not using a sequence for populating the decision_number column ?
    Sequence values are guaranteed to be unique so there's no need to lock anything.
    You'll inevitably have gaps and no different groups will have the same decision_number in common.
    Having to deal with consecutive numbers fixations you can proceed as
    with
    case_record as
    (select 2012 decision_year,'AA' group_abbr,1 decision_number from dual union all
    select 2012,'BB',2 from dual union all
    select 2012,'AA',21 from dual union all
    select 2012,'AA',22 from dual union all
    select 2012,'BB',25 from dual union all
    select 2013,'CC',33 from dual union all
    select 2013,'CC',34 from dual union all
    select 2013,'CC',36 from dual union all
    select 2013,'BB',37 from dual union all
    select 2013,'AA',38 from dual union all
    select 2013,'AA',39 from dual union all
    select 2013,'BB',41 from dual union all
    select 2013,'AA',42 from dual union all
    select 2013,'AA',43 from dual union all
    select 2013,'BB',45 from dual
    select decision_year,
           group_abbr,
           row_number() over (partition by decision_year,group_abbr order by decision_number) decision_number,
           decision_number sequence_number -- not shown (noone needs to know you're using a sequence)
      from case_record
    order by decision_year,group_abbr,decision_number
    DECISION_YEAR
    GROUP_ABBR
    DECISION_NUMBER
    SEQUENCE_NUMBER
    2012
    AA
    1
    1
    2012
    AA
    2
    21
    2012
    AA
    3
    22
    2012
    BB
    1
    2
    2012
    BB
    2
    25
    2013
    AA
    1
    38
    2013
    AA
    2
    39
    2013
    AA
    3
    42
    2013
    AA
    4
    43
    2013
    BB
    1
    37
    2013
    BB
    2
    41
    2013
    BB
    3
    45
    2013
    CC
    1
    33
    2013
    CC
    2
    34
    2013
    CC
    3
    36
    for retrieval (assuming decision_year,group_abbr,decision_number as being the key):
    select decision_year,group_abbr,decision_number -- the rest of columns
      from (select decision_year,
                   group_abbr,
    -- the rest of columns
                   row_number() over (partition by decision_year,group_abbr order by decision_number) decision_number
              from case_record
             where decision_year = :decision_year
               and group_abbr = :group_abbr
    where decision_number = :decision_number
    DECISION_YEAR
    GROUP_ABBR
    DECISION_NUMBER
    2013
    AA
    4
    if that's acceptable
    Regards
    Etbin

  • 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.

  • 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.

  • How to update multiple columns from different tables using cursor.

    Hi,
    i have two tables test1 and test2. i want to udpate the column(DEPT_DSCR) of both the tables TEST1 and TEST2 using select for update and current of...using cursor.
    I have a code written as follows :
    DECLARE
    v_mydept1 TEST1.DEPT_CD%TYPE;
    v_mydept2 TEST2.DEPT_CD%TYPE;
    CURSOR C1 IS SELECT TEST1.DEPT_CD,TEST2.DEPT_CD FROM TEST1,TEST2 WHERE TEST1.DEPT_CD = TEST2.DEPT_CD AND TEST1.DEPT_CD = 'AA' FOR UPDATE OF TEST1.DEPT_DSCR,TEST2.DEPT_DSCR;
    BEGIN
    OPEN C1;
         LOOP
              FETCH C1 INTO v_mydept1,v_mydept2;
              EXIT WHEN C1%NOTFOUND;
              UPDATE TEST2 SET DEPT_DSCR = 'PLSQL1' WHERE CURRENT OF C1;
              UPDATE TEST2 SET DEPT_DSCR = 'PLSQL2' WHERE CURRENT OF C1;
         END LOOP;
         COMMIT;
    END;
    The above code when run says that it runs successfully. But it does not updates the desired columns[DEPT_DSCR].
    It only works when we want to update single or multiple columns of same table...i.e. by providing these columns after "FOR UPDATE OF"
    I am not sure what is the exact problem when we want to update multiple columns of different tables.
    Can anyone help me on this ?

    oops my mistake.....typo mistake...it should have been as follows --
    UPDATE TEST1 SET DEPT_DSCR = 'PLSQL1' WHERE CURRENT OF C1;
    UPDATE TEST2 SET DEPT_DSCR = 'PLSQL2' WHERE CURRENT OF C1;
    Now here is the upated PL/SQL code where we are trying to update columns of different tables --
    DECLARE
    v_mydept1 TEST1.DEPT_CD%TYPE;
    v_mydept2 TEST2.DEPT_CD%TYPE;
    CURSOR C1 IS SELECT TEST1.DEPT_CD,TEST2.DEPT_CD FROM TEST1,TEST2 WHERE TEST1.DEPT_CD = TEST2.DEPT_CD AND TEST1.DEPT_CD = 'AA' FOR UPDATE OF TEST1.DEPT_DSCR,TEST2.DEPT_DSCR;
    BEGIN
    OPEN C1;
    LOOP
    FETCH C1 INTO v_mydept1,v_mydept2;
    EXIT WHEN C1%NOTFOUND;
    UPDATE TEST1 SET DEPT_DSCR = 'PLSQL1' WHERE CURRENT OF C1;
    UPDATE TEST2 SET DEPT_DSCR = 'PLSQL2' WHERE CURRENT OF C1;
    END LOOP;
    COMMIT;
    END;
    Please let us know why it is not updating by using using CURRENT OF

  • Is it possible to create a Column with Conditional Mandatory with another Column?

    Is it possible to create a Column with Conditional Mandatory with another Column?
    For example
    In a Table we have column A, B, C.
    A is Primary Column.
    B is Optional
    C is Conditional Mandatory.
    A B
    C
    12345 ABC
    OK
    12346 NULL
    NULL
    12347 ABC
    OK
    Only if the B Column has the value then only C column should be mandatory

    I guess you can't create a condtional mandatory column directly. However, you can use check constraint to on the column
    create table YourTable
      A int primary key,
      B char(3),
      C int,
      constraint ch_con check(
                                B
    is not null
    or C is null

  • Primary Key Multiple Column with Date - parameter issue

    All,
    I am having an issue that I cannot find the answer to. I have looked high and low to no avail. Please help.
    The issue at hand is that I have a table that has a multiple column primary key and one of the columns happens to be a date and the other is a string. I have a basic search and I want an update picture in the results table that the users can click on and go to a different page to update that record. The issue is when I fire an action based on the update picture I also want to set parameters based on the record that I selected. So I set the string parameter and that works fine. The issue is with the date. When i set the date parameter it works but it chops off the timestamp. Later when I try to get this parameter 'pageContext.getParameter("dateParameter");' it will bring in a date like 15-Dec-2008 but I need the entire date and timestamp (i.e. 15-Dec-2008 10:20:33) to correctly identify the record.
    Please help!
    Thanks,
    Colby J

    Hi
    since every parameter go in url as a string format so u will never get the date parameter with complete timestamp,the solution would de
    1.) Set a fire action on update picture,give its event name as "update",
    2.) clicking on update picture will fire this event .
    3.) in processFormrequest method of controller
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    if ("update".equals(pageContext.getParameter("event")))
    // this will give the select row where update is clicked
    String rowReference = pageContext.getParameter(OAWebBeanConstants.EVENT_SOURCE_ROW_REFERENCE);
    VORowImpl row = (EmployeeSummaryVORowImpl)am.findRowByRef(rowReference);
    Timestamp sdateVal=(String)row.getAttribute("Date value");
    // this will transfer the values to next page
    pageContext.putTransactionTransientValue("transferdvalue",sdateVal);
    // and in the next page u can get the value like this
    timestamp getDateVal=pageContext.getTransactionTransientValue("transferdvalue"l);
    hope this will resolve your issue,Please let me know if u face any issue
    thanx
    Pratap

  • Merge statement - update multiple columns from a single sub-select

    Is it possible to write in 10gR2, a MERGE statement, with UPDATE for multiple columns from a single sub_select?
    like this:
    MERGE INTO tableA
    using ( select * from temp) tmp
    on( tableA. col1 = tmp.col1)
    when matched then
    update set  ( tableA.col5,
                       tableA.col6,
                       tableA.col7) = ( select sum(col2), sum(col3), sum(col5)
                                                                                 from tableX
                                                                                where tableX.col1 = tableA.col1...)

    Hi,
    The USING clause is not a sub-query, so it can't reference columns from tables that are not in it.
    Include tableA in the USING clause if you really need to refer to it there. (It's not obvious that you do.)
    As always, it helps if you post:
    (1) The version of Oracle (and any other relevant software) you're using
    (2) A little sample data (just enough to show what the problem is) from all the relevant tables
    (3) The results you want from that data (In the case of a DML statement, such as MERGE, this will be the state of the tables when everything is finished.)
    (4) Your best attempt so far (formatted)
    (5) The full error message (if any), including line number
    Executable SQL statements (like "CREATE TABLE AS ..." or "INSERT ..." statements) are best for (2).
    If you can present your problem using commonly available tables (for example, tables in scott schema, or views in the data dictionary), then you can omit (2).
    Formatted tabular output is okay for (3).

  • Updating Multiple Rows With A Sequence

    I'm trying to update multiple rows of data in one column based on if its date is greater than a certain date. Starting with the lowest date from those dates I'll give it a 2000 and every ascending date from that point will be another number in sequence (2001, 2002, 2003, etc.).
    Apologization Edit:
    11g XE
    Edited by: spysmily1 on Jun 4, 2012 5:50 PM
    Edited by: spysmily1 on Jun 4, 2012 5:51 PM

    I would use a counter and start at a specific number. Then I would try to keep updating with this number and incrementing each time. The part I can't quite grasp is how to use this number with the lowest record and apply this sequence to each date that ascends from there. What I was going to try to come up with is something like:
    DECLARE
    counter := 2000;
    BEGIN
    loop
    update table_name
    set column_name = counter
    where date > specified date;
    counter := counter + 1;
    end loop;
    This is my first thought but I couldn't see a way to just update the first one that is greater than the specified date and then keep cycling through the dates until the last date(most recent). I know I would need a loop but what can I set that loop to so it would know when to stop. I could use a variable I know is less than the total amount that need to be altered.
    Edited by: spysmily1 on Jun 4, 2012 6:21 PM

  • Updating multiple columns

    I have an UPDATE statement with some complex CASE statements in the inner SELECT query which makes it impossible to set values like column_name1 = value1, column_name2=value2 . So i am getting ORA-00927: missing equal sign error.
    The UPDATE looks like
    SQL> UPDATE EMPCLONE
      2  SET EMPNO,ENAME,JOB=(SELECT EMPNO,ENAME,JOB FROM EMP);
    SET EMPNO,ENAME,JOB=(SELECT EMPNO,ENAME,JOB FROM EMP)
    ERROR at line 2:
    ORA-00927: missing equal signAny workarounds?

    >
    The UPDATE looks like
    SQL> UPDATE EMPCLONE
    2  SET EMPNO,ENAME,JOB=(SELECT EMPNO,ENAME,JOB FROM
    EMP);
    ET EMPNO,ENAME,JOB=(SELECT EMPNO,ENAME,JOB FROM EMP)
    line 2:
    ORA-00927: missing equal signAny workarounds?Enclose the column list after SET in brackets:
    test@ORA10G>
    test@ORA10G> drop table t;
    Table dropped.
    test@ORA10G>
    test@ORA10G> create table t (x number, y number, z date);
    Table created.
    test@ORA10G>
    test@ORA10G> insert into t (x,y,z) values (1,10,sysdate);
    1 row created.
    test@ORA10G> commit;
    Commit complete.
    test@ORA10G> select * from t;
             X          Y Z
             1         10 14-MAR-08
    test@ORA10G>
    test@ORA10G> update t set x,y,z = (select 2,20,sysdate from dual);
    update t set x,y,z = (select 2,20,sysdate from dual)
    ERROR at line 1:
    ORA-00927: missing equal sign
    test@ORA10G> update t set (x,y,z) = (select 2,20,sysdate from dual);
    1 row updated.
    test@ORA10G> commit;
    Commit complete.
    test@ORA10G> select * from t;
             X          Y Z
             2         20 14-MAR-08
    test@ORA10G>pratz

  • Updating multiple rows with different values

    Hi!
    I have a problem. I need to update more then 1000 rows with different values. How can I do it?
    For exsample i have table:
    id; color, date,
    1 red
    2 green
    3 white
    I need to update date field.
    Update table
    set date='01.02.03'
    where id=1
    Update table
    set date='01.03.03'
    where id=2
    Maybe there is way how to update multiple rows at one query?
    Sorry for my bad english.
    Thanks!

    Hi,
    You can try this
    UPDATE TABLE SET DATE = CASE
                        WHEN ID = 1 THEN TO_DATE('01-02-03','DD-MM-RR')
                        WHEN ID = 2 THEN TO_DATE('01-03-03','DD-MM-RR')
                        ENDcheers
    VT

  • Multiple Column with no information

    I have a Crystal Report 10 report made that uses multiple columns for the data in each group. The printing direction is set to be "Across then Down".
    Suppose a group has 10 rows. When I preview and export from Crystal Developer 10, the two columns show up with 5 rows each. When this report is deployed and created on Crystal Enterprise 10 (or I also tried this on Business Object InforView 3.1) the two columns still show up, but only the left column holds the data (i.e., it has all 10 rows) and the right column is blank.
    Does anyone know if there is a setting that I am missing somewhere in my report setup?
    Further information:
       Checked options:
           - Details > Common:
                  - Free-Form Placement
                  - Keep Together
                  - Format with Multiple Columns
           - Details > Layout
                  - Printing Direction: Across then Down
    - Group Options has "Repeat Group Header On Each Page" checked
    Edited by: Ryan Beaulieu on Nov 7, 2008 10:07 PM

    I've done some more different scenarios, and the same this is seen if it's created as an Excel sheet, but I also noticed that the results that I am getting on Crystal Enterprise 10/InfoView XI 3.1 are exactly what I am seeing if I am working in Crystal Developer and set the layout to be "Down then Across". It seems like Crystal Enterprise is losing this setting or overriding my setting of "Across then Down" for whatever reason.

Maybe you are looking for

  • Itunes wont download on new pc

    just bought a new pc. tried to download iTunes, it said it was downloaded but it isn't anywhere on my pc. tried it again and the same thing happened. how do u download iTunes?????

  • How to make the prompt to pick the system date automatically at run time?

    Hi, I trying to create a publication for a report that has date prompt, When I try to schedule this publication  the query should automatically select system date for date prompt and and send out the report. Is there a way to do this in CMC? Thanks i

  • Weblogic 12.1.2 - Tibco Client (6.3l) - through MDB - IllegalAccessError

    Migrating to Weblogic 12.1.2 . I am having MDB(EJB 2.1) connecting to Foreign Tibco JMS Server .While connecting ,I am getting below java.lang.IllegalAccessError: tried to access class com.tibco.tibjms.TibjmsxSessionImp from class weblogic.deployment

  • Numbers won't print

    I'm using Numbers for the first time, and I'm having trouble printing. I opened an Excel file which is a calendar layout, and it printed the first couple months okay (each as a separate print job), but now suddenly it won't print. When I choose print

  • Can the newer MBP's benefit and use 6 gb of ram?

    I know Apple lists the MBP's as being 2, 4, and 8 gb's compatible, but still I was curious if anybody tried with 6 gb's? And if so, in what combination did you do so? If I went to 8 gb, is matched that important? Thanks! -Bud