Option to insert into all rows

How would I create an option that gives the user a choice of inserting a value into all rows or just a specific row in a table?

Doris,
I'm assuming you mean "update" rather than "insert", since "inserting a value into all rows" doesn't really make sense to me.
Anyway, there's lots of ways you can present this to the users, but at the backend it will come down to your use of a where clause, e.g.
"update employees set salary = 20000"
will update all rows and set the salary column to 20000, whereas -
"update employees set salary = 20000 where emp_id = 37"
will only update the row for the employee with emp_id = 37.
Hope this helps.

Similar Messages

  • How to use INSERT INTO ALL statement in jdbc prepared statement with beans

    Kindly give me some example that how we can use "INSERT INTO ALL STATEMENT" in jdbc prepared statement inside a jsf bean?
    Actually i want to take employee id's of present employees using single jsf page and using one textbox for each employee id.
    How can i use INSERT INTO ALL statement to achieve this?
    Following is my code snippet.
    AttendanceBean.java:
    public class AttendanceBean {
    private int atteid;
    private String attdname;
    private int attday;
    private int attmonth;
    private int attyear;
    public static Connection getAttConnection() throws Exception {
    String driver = "oracle.jdbc.driver.OracleDriver";
    String url = "jdbc:oracle:thin:@localhost:1521:globldb3";
    String username = "scott";
    String password = "tiger";
    Class.forName(driver);
    Connection conn = DriverManager.getConnection(url, username, password);
    return conn;
    public String addAttendance(){
    Connection conn = null;
    PreparedStatement pstmt = null;
    boolean committed = false;
    try {
    conn = getAttConnection();
    conn.setAutoCommit(false);
    String query = "INSERT ALL INTO attendance VALUES (?,?,?,?,?)";
    pstmt = conn.prepareStatement(query);
    pstmt.setInt(1,this.atteid);
    pstmt.setString(2,this.attdname);
    pstmt.setInt(3,this.attday);
    pstmt.setInt(4,this.attmonth);
    pstmt.setInt(5,this.attyear);
    pstmt.executeUpdate();
    conn.commit();
    conn.setAutoCommit(true);
    committed = true;
    return "home.xhtml";
    } catch (Exception e) {
    e.printStackTrace();
    return "CRM.xhtml";
    } finally {
    try{
    if (!committed) conn.rollback();
    if (pstmt != null) pstmt.close();
    if (conn != null) conn.close();
    }catch(Exception e){
    e.printStackTrace();
    }

    Check this program for some info on Push buttons:
    1-DEMO_DYNPRO_PUSH_BUTTON
    2-DEMO_DYNPRO_MODULE
    3-DEMO_DYNPRO_ON_CONDITION
    Suppose Your screen is 101
    Then in that screen create one push button and assign it a function code.
    Now in the PAI of the 101 screen
    Create Module for user command
    Inside that module checc the sy-ucomm if sy-ucomm eq <Function code of your push button>
    Insert the values in database.
    *& Module USER_COMMAND_0101 INPUT
    process after input for screen 0101 *
    MODULE USER_COMMAND_0101 INPUT.
    CASE OK_CODE.
    WHEN 'SAVE'.
    *Insert the values here
    WHEN 'DISP'.
    ENDCASE.
    CLEAR OK_CODE.
    ENDMODULE. " USER_COMMAND_0101 INPUT
    Regards
    Neha
    Edited by: Neha Shukla on Dec 3, 2008 1:02 AM
    Edited by: Neha Shukla on Dec 3, 2008 1:02 AM
    Edited by: Neha Shukla on Dec 3, 2008 1:06 AM

  • Splitting data in one row and inserting into seperate rows into a new table

    i have a table table1 like the following
    column1     column2          column3
    a     b,cbdm,d     hj
    ba     hello          man
    i have to insert data from this table to table2 in the following format
    Column1          column2          column3
    a          b          hj
    a          cbdm          hj
    a          d          hj
    ba          hello          man
    It is like if data in column2 is seperated by comma i have to insert it into each sperate row
    I have to write a single procedure which will do the above. Please,Please help me
    I am very new to SQL

    I am absolutely agreeing with Billy.
    But I think u will be able to learn a lot if u try to understand the following code
    sql>select * from t1;
         C1 C2 C3
         a  b,cdbm,d  hj 
         ba  hello  man 
         x  aa,d,df  yy 
    sql>select * from t2;
         no rows selected
    sql>insert into t2
          select col1,col2,col3
         from (
         select t1.c1 col1,t1.c2 col4,t1.c3 col3,
         substr(t1.c2,
                  case n when 1 then 1 else instr(t1.c2,',',1,n-1)+1 end,
                       (case instr(t1.c2,',',1,n) when 0 then length(t1.c2)+1 else instr(t1.c2,',',1,n) end) -
                      (case n when 1 then 1 else instr(t1.c2,',',1,n-1)+1 end)) col2,n
           from t1,(select c1,c2,c3,
                              row_number() over(partition by c1,c2,c3 order by c1) n
                      from t1 connect by level <=
                                                   (length(t1.c2)-length(replace(t1.c2,',','')))) t2
           where t1.c1 = t2.c1)
         where not(n != 1 and col4=col2);
    sql>select * from t2;
          C1 C2 C3
          a  b  hj 
          a  cdbm  hj 
          a  d  hj 
          ba  hello  man 
          x  aa  yy 
          x  d  yy 
          x  df  yy                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Insert into all tables on a Database on Test Server select from all tables on a database A from production server

     
    hi Friends ,i need a suggestion from  you on how to
    insert data to all tables on a Database  "A " on Test server
    Select data from all tables on  a Database  "A" on Production Server
    where id=123
    Database A is same with Structures on Test and Production also all Tables  will have  Id column in common.
    The purpose of this insert is ,as we all know Production has the latest data and i need to push to test server on request for particular ID only  ( may be weekly once or  twice a week )
    I  have a linked server setup name "LINQ" 
    Example for one table is below , like wise i need a script which does for 154 tables.
    Insert into ABC( id, name)---insert to test server
    Select Id, name  from  LINQ.ProdSerevrname.databasename.ABC where id = 123
    Please help me ..
    Thanks

    Why not use export import wizard for this if you've read access to production?
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Data Load Wizard not Inserting/Updating all rows

    Hello,
    I am able to run through the whole Data Load Wizard without any problems. It reports that it successfully inserted/updated all the rows, but when I look in the table, I find a few rows that were not updated correctly. Of the entries I've identified that don't get inserted/updated properly, I've noticed they are the same rows that I was having issues with earlier. The issue was a number format error, which I solved by providing an explicit number format.
    Is it possible that the false inserts/updates might still be tied to the number format, or are there other reasons why the data load is failing on only some rows.
    Thanks,
    Brian
    Edited by: 881159 on Mar 14, 2012 5:05 PM

    Hi Brian,
    I am not aware of the situation where you get false results. However, there were some issues with number/date formats that sometime were not properly parsed, and this has been fixed in 4.1.1 patch. would your case be different from the one described in bug 13656397, I will be happy to get more details so that I can take a look at what is going on.
    Regards,
    Patrick

  • Split data and insert into different rows

    I have a string like 'sfdsf,sfdsf,sfsd,qweqeqw,iuoi,"
    I have created a single column table
    I have to extract data from first untill comma(,) occurs and insert into the table like the following
    sfdsdf
    sfdsf
    sfsd
    qweqeqw
    iuoi
    Please help me how to do it

    Or a Single SQL query
    SELECT trim(',' from DECODE(ROWNUM,1,SUBSTR(STR,1,INSTR(STR,',',1)),
                                        LENGTH(STR)-LENGTH(REPLACE(STR,','))+1,SUBSTR(STR,INSTR(STR,',',-1,1)),
                                         SUBSTR(STR,INSTR(STR,',',1,ROWNUM-1), INSTR(STR,',',1,ROWNUM)-INSTR(STR,',',1,ROWNUM-1))
                                   ))  STR1
                     FROM (SELECT 'sfdsf,sfdsf,sfsd,qweqeqw,iuoi' STR FROM DUAL),ALL_TABLES
                     WHERE ROWNUM <= LENGTH(STR)-LENGTH(REPLACE(STR,','))+1
                      ORDER BY ROWNUM

  • INSERT INTO EMP

    Hi all,
    Whats the best way for insert multivalues
    INSERT INTO EMP(ENAME) values (htmldb_aplication.g_f32(i)); where EMPNO populated from trigger
    and (htmldb_aplication.g_f34(i)), (htmldb_aplication.g_f36(i)),(htmldb_aplication.g_f38(i)) ....
    regards,
    Gordan

    uou have a form with 8 columns on it, correct?
    -thats like row with 20 fields (Formular A8) but every field need insert into ONE row from emp table into EMPNO column-thats form
    So you need to allow the user ti insert a number of rows of emp type data, correct?
    -user fill 20 fields from user friendly UI and when finish click CREATE a and all 20 fields (:P1_CODE1....:P1_CODE20) need insert into EMP(ENAME) and all type are VARCHAR2(255) inserting 20 x.
    SO you COULD have a multiple row update (MRU) form with you table design built by apex, correct... No - just INSERT
    Will the user be entering all the columns of data? or only some and some are blank? Yes, Could be some blank
    thenks for link I will trying to solve with collection
    Gordan

  • Looking for an insert statement to insert into a table around 500 rows

    Hi  Gurus,
    Your help is greatly appreciated !!,
    I need to have a query to insert into the mer_spec_feature table with the following , Please sugesst apart from the Utl_file ,input thing
    as the data is differnt in the regions and am lokking if it workes out with a insert and select query .
    1)I have to create a  script for inserting records into  mer_spec_feature where  on appl_id ‘VXRR’
    having feature ID 786 and have to Exclude TIDs which already have the 786 feature added for this appl_id like in the eblwo select query .
    2)There are 509 such TIDs where it doesnt have the 786 feature with appl_id -'VXRR' in the mer_spec_feature table
    3)
    select distinct terminal_id,  appl_id, from  mer_spec_feature
    where appl_id = 'VXRR'
    minus
    select distinct terminal_id, appl_id from mer_spec_feature
    where appl_id = 'VXRR'
    and terminal_feature_id = 786
    desc mer_spec_feature :
    Terminal_id  --varachr2(9)
    appl_id    --varcahr2(10 )
    terminal_feature-id --number(8)
    TERMINAL_FEATURE_ID
    TERMINAL_APPL_ID
    TERMINAL_ID
    299
    405T330a
    1004665
    786
    VXRR
    1004665

    @Frank Kulash !!
    Thanks always for your replys .!!
    i have tried with the above sql , and am having issue with the pk constraint after inserting  232 rows.
    And a Tertminal_id  will have 100 feature_id's for one  appl_id.
    becoz it has pk constraint on  -- TERMINAL_FEATURE_ID, APPL_ID, TERMINAL_ID
    TERMINAL_FEATURE_ID
    APPL_ID
    TERMINAL_ID
    299
    405T330a
    1004665
    786
    VXRR
    1004665
    can you please sugeest any other option.

  • "Failed to validate all rows" when inserting in master detail scenario

    Hi,
    I have problem writing data in a master detail scenario..
    i use the following bean method to write data.
    Data is inserted in the master table successfully but when i try to commit in the details table i get the error "Failed to validate all rows in a transaction."
    public void save(ActionEvent actionEvent)
    //writing into master table
    DCBindingContainer bindings =
    (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    DCIteratorBinding iterBind =
    (DCIteratorBinding)bindings.get("Master1Iterator");
    MasterVOImpl vo_pr = (MasterVOImpl ) iterBind.getViewObject();
    Row r=vo_pr.createRow();
    r.setAttribute("Name", name);
    Number num =(new oracle.jbo.server.SequenceImpl("new_seq",vo_pr.getDBTransaction())).getSequenceNumber();
    r.setAttribute("Id",num);
    vo_pr.insertRow(r);
    vo_pr.getDBTransaction().commit();
    //writing into details table
    DCIteratorBinding scopeiterBind =
    (DCIteratorBinding)bindings.get("Detail2Iterator");
    DetailVOImpl vo_sc = (DetailVOImpl) scopeiterBind.getViewObject();
    Row rs=vo_sc.createRow();
    rs.setAttribute("iddetail",iddetail);
    rs.setAttribute("Name", Name);
    rs.setAttribute("id",num);
    vo_sc.insertRow(rs);
    vo_sc.getDBTransaction().commit();
    Note: the Detail iterator used here is the one under the master in the AM

    In case your model defined a view link from master to detail should try to get the detail iterator from the master and use this to create the new row.
    Row r=vo_pr.createRow();
    r.setAttribute("Name", name);
    Number num =(new oracle.jbo.server.SequenceImpl("new_seq",vo_pr.getDBTransaction())).getSequenceNumber();
    r.setAttribute("Id",num);
    vo_pr.insertRow(r);
    // this method gets the detail iterator for the master row you just created.
    // The name of the method depends on the view link in your model you expose to the master view
    Row rs=vo_pr.getDetail().createRow();
    rs.setAttribute("iddetail",iddetail);
    rs.setAttribute("Name", Name);
    // this value should be added by the framework
    //rs.setAttribute("id",num);
    vo_sc.insertRow(rs);
    vo_pr.getDBTransaction().commit();Timo

  • ORA-01008 - not all variable bounfd when trying to insert into trigger

    Hi,
    Uisng Oraclle 11.2.0.3 and trying insert into table on remote schema.
    Tracked problem down to one column - the parent_num..
    Offending code
    a.mult_parent_num = ( select   nvl(MGrp_num, 0)
                                from     [email protected]
                                --where   MGrp_PARENT_num is not null
                                --and
                                where substr(upper(MGrp_DESCRIPTION), 2) = (select MULT_NAME
                                                                   from por_multiple p
                                                                   where p.mult_link_multiple_code = B.MULT_LINK_MULTIPLE_num)Complete truigger
    create or replace trigger POR_TRG_POP_IKNOW_MULTIPLE
    after INSERT OR UPDATE or delete   on por_MULTIPLE
    for each row
    -- tO ENSURE I-KNOW KEPT UP-TO-DATE WITH HOMIS MULTIPLE
    -- delib not delet form i-know as if has been used by customer cannot delete
    -- due to referential inetgrity constraints in i-know
    declare
    begin
    -- ensure if updating record one of attributes interested in for ho_issues_stg changed
       IF INSERTING OR UPDATING
       THEN
          MERGE INTO [email protected] a
          USING
           select
           :NEW.MULT_ANMW_MULTIPLE_CODE MULT_ANMW_MULTIPLE_CODE,
           :new.MULT_AUTH_REQUIRED MULT_AUTH_REQUIRED,
           :new.MULT_JMW_MULTIPLE_TYPE_CODE MULT_JMW_MULTIPLE_TYPE_CODE,
           :new.MULT_LINK_MULTIPLE_CODE MULT_LINK_MULTIPLE_num,
           :new.MULT_MULTIPLE_CODE MULT_MULTIPLE_NUM,
           :new.MULT_NAME MULT_NAME,
           :new.MULT_PROM_AUTH_REQUIRED MULT_PROM_AUTH_REQUIRED,
           :new.MULT_SELECTED_MULTIPLE MULT_SELECTED_MULTIPLE,
               'Y' MULT_active_flag,
           nvl(:new.MULT_JMW_MULTIPLE_TYPE_CODE, 0) MULT_CHANNEL_NUM--,
          -- :new.MULT_LINK_MULTIPLE_CODE MULT_PARENT_NUM
           from dual
           ) b
        on
           a.mult_multiple_NUM = b.MULT_MULTIPLE_NUM
    when matched THEN update set
           A.MULT_ANMW_MULTIPLE_CODE = B.MULT_ANMW_MULTIPLE_CODE ,
           A.MULT_AUTH_REQUIRED = B.MULT_AUTH_REQUIRED,
           A.MULT_JMW_MULTIPLE_TYPE_CODE = B.MULT_JMW_MULTIPLE_TYPE_CODE ,
           A.MULT_LINK_MULTIPLE_num = B.MULT_LINK_MULTIPLE_num,
           A.MULT_NAME =B.MULT_NAME,
           A.MULT_PROM_AUTH_REQUIRED=B.MULT_PROM_AUTH_REQUIRED,
           A.MULT_SELECTED_MULTIPLe=B.MULT_SELECTED_MULTIPLE,
               A.MULT_ACTIVE_FLAG = B.MULT_ACTIVE_FLAG,
           A.MULT_CHANNEL_NUM= B.MULT_CHANNEL_NUM
           a.mult_parent_num = ( select   nvl(MGrp_num, 0)
                                from     [email protected]
                                --where   MGrp_PARENT_num is not null
                                --and
                                where substr(upper(MGrp_DESCRIPTION), 2) = (select MULT_NAME
                                                                   from por_multiple p
                                                                   where p.mult_link_multiple_code = B.MULT_LINK_MULTIPLE_num)
    when not matched
    then insert
    A.MULT_ANMW_MULTIPLE_CODE,
           A.MULT_AUTH_REQUIRED,
           A.MULT_JMW_MULTIPLE_TYPE_CODE,
           A.MULT_LINK_MULTIPLE_NUM,
           A.MULT_MULTIPLE_NUM,
           A.MULT_NAME,
           a.MULT_PROM_AUTH_REQUIRED,
           a.MULT_SELECTED_MULTIPLE,
           -- NEW FIELDS ON I-KNOW
           a.MULT_ACTIVE_FLAG,
            a.MULT_CHANNEL_NUM,
             a.MULT_PARENT_NUM
    values
           b.MULT_ANMW_MULTIPLE_CODE,
           b.MULT_AUTH_REQUIRED,
           b.MULT_JMW_MULTIPLE_TYPE_CODE,
           b.MULT_LINK_MULTIPLE_NUM,
           b.MULT_MULTIPLE_NUM,
           b.MULT_NAME,
           b.MULT_PROM_AUTH_REQUIRED,
           b.MULT_SELECTED_MULTIPLE,
           -- NEW FIELDS ON I-KNOW
           b.MULT_ACTIVE_FLAG,
            b.MULT_CHANNEL_NUM,
         --   711-- parent to have parent_num group name of link multiple code
           ( select   nvl(MGrp_num, 0)
              from      [email protected]
                     --where   MGrp_PARENT_num is not null
                     --and
                       where   substr(upper(MGrp_DESCRIPTION), 2) = (select MULT_NAME
                                                                   from por_multiple p
                                                                   where p.mult_link_multiple_code = B.MULT_LINK_MULTIPLE_num)
    update   [email protected]
    set
      MULT_PARENT_num =   ( select   nvl(MGrp_num, 0)
              from     bidsaMULTIPLE_GROUPS
                     where   MGrp_PARENT_num is not null
                     and     substr(upper(MGrp_DESCRIPTION), 2) = MULT_NAME
          MULT_CHANNEL_num = nvl(MULT_JMW_MULTIPLE_TYPE_CODE, 0),
          MULT_ACTIVE_FLAG = 'Y'
    where
      MULT_PARENT_num is null;
    else
         update [email protected] p
         set  mult_active_flag = 'N'
         where  p.mult_multiple_num = :old.mult_multiple_code;
    END IF;
    EXCEPTION
         WHEN OTHERS THEN
            RAISE_APPLICATION_ERROR(-20010,'Error when writing to i-know multiple '||SQLERRM||' '||SQLCODE);
    END POR_TRG_POP_IKNOW_MULTIPLE;What am I doing wrong?

    Definitions bleow.
    Performanve fine - source table rarelyy changed - a temporary solution until the source system replaced with desination system.
    Error:
    Error when writing to multiple (sourec table) ORA-01008 - not all variables bound ORA-02063 - preceding line form bisapprd.
    - 1008 error during execution of trigger
    Source table upon which trigger acting
    -- Create table
    create table POR_MULTIPLE
      mult_multiple_code          NUMBER(4) not null,
      mult_name                   VARCHAR2(20) not null,
      mult_selected_multiple      VARCHAR2(1) not null,
      mult_anmw_multiple_code     VARCHAR2(3),
      mult_link_multiple_code     NUMBER(4),
      mult_jmw_multiple_type_code VARCHAR2(3),
      mult_auth_required          VARCHAR2(1),
      mult_prom_auth_required     VARCHAR2(1)
    )Destination tables being inserted into
    create table POR_MULTIPLE
      mult_multiple_num           NUMBER(4) not null,
      mult_name                   VARCHAR2(20) not null,
      mult_selected_multiple      VARCHAR2(1) not null,
      mult_anmw_multiple_code     VARCHAR2(3),
      mult_link_multiple_num      NUMBER(4),
      mult_jmw_multiple_type_code VARCHAR2(3),
      mult_auth_required          VARCHAR2(1),
      mult_prom_auth_required     VARCHAR2(1),
      mult_parent_num             NUMBER(4),
      mult_channel_num            NUMBER(4),
      mult_active_flag            VARCHAR2(1) not null
    create table MULTIPLE_GROUPS
      mgrp_num         NUMBER(4) not null,
      mgrp_description VARCHAR2(40) not null,
      mgrp_parent_num  NUMBER(4)
    )

  • No rows inserted into cube REL_EXPENSE

    Dear all,
    This week I've spent some hours walking through the online training for Oracle Warehouse Builder 10g on Oracle Technet which can be found here:
    http://www.oracle.com/technology/obe/admin/owb10gr2_gs.htm
    Everything went fine until I had to load data into cube REL_EXPENSE. Somehow the mapping that I created (REL_EXPENSE_MAP) does not insert any rows into table REL_EXPENSE.
    The lesson I'm referring to which builds the mapping for the cube is:
    http://www.oracle.com/technology/obe/10gr2_owb/owb10gr2_gs/owb/lesson4/etl-mappings.htm
    Additional information:
    -- The target table (REL_EXPENSE) that is needed for loading the data is created successfully.
    -- The external table which i created during an earlier lesson was created without any problems. If I SELECT the table (EXPENSE_DATE) I see the records from the CSV file in the table.
    -- I've tried to debug the mapping and I could see the rows go through the External Table Operator and through the Expression operator (which converts dates to numbers). The records won't get inserted into the target table by the Cube Operator though.
    Since I'm new to OWB I am not able to solve this problem on my own, so I hope you guys can give me a hint where to look so I can solve the problem.
    Thanks in advance!
    Kind regards,
    Theo

    Insert into ....
    INSERT
       INTO "IIA_DATA"."FAITS_EX_POST"@"DIIAV3@EMP_IIA_DATA"
        "NOMBRE"             ,
        "DIM_EX_POST"        ,
        "DIM_SERVICE_EX_POST",
        "DIM_TEMPS_EX_POST"
      (SELECT to_number( "V_FAITS"."R_VALEUR" ) "NOMBRE"                                       ,
          "DIM_EX_POST"."DIMENSION_KEY" "DIMENSION_KEY"  ,
          "DIM_SERVICE"."DIMENSION_KEY" "DIMENSION_KEY_2",
          "DIM_TEMPS"."DIMENSION_KEY" "DIMENSION_KEY_1"
           FROM "V_FAITS" "V_FAITS"                                   ,
          "V_DIMENSIONS_FAITS" "V_DIMENSIONS_FAITS"                   ,
          "IIA_DATA"."DIM_TEMPS"@"DIIAV3@EMP_IIA_DATA" "DIM_TEMPS"    ,
          "IIA_DATA"."DIM_SERVICE"@"DIIAV3@EMP_IIA_DATA" "DIM_SERVICE",
          "IIA_DATA"."DIM_EX_POST"@"DIIAV3@EMP_IIA_DATA" "DIM_EX_POST"
          WHERE ( "V_FAITS"."I_ID" BETWEEN 1 AND 142 )
        AND ( "V_FAITS"."R_ID"              = "V_DIMENSIONS_FAITS"."R_ID" )
        AND ( "V_FAITS"."MONTH_CAL_CODE_ID" = "DIM_TEMPS"."CALENDAR_MONTH_CAL_MONTH_CODE" )
        AND ( "V_FAITS"."R_VALEUR_AXE"      = "DIM_SERVICE"."SERVICE_ACS" )
        AND ( (to_number("DIM_EX_POST"."COMPTABILISATION_ID_FONC" )) = "V_DIMENSIONS_FAITS"."NE_ID" )
      )Output :
    0 rows inserted

  • Need help in SQL Query: Update a row in a table & insert the same row into another table

    I want to update a row in a table say Table A and the updated row should be inserted into another table say Table B. I need to do it in a single SQL query and i don't want to do it in PL/SQL with triggers. And i tried with MERGE statement but its working with this scenario. (Note: I'm using Oracle Database 10g Enterprise Edition Release 10.2.0.1.0).
    Thanks in Advance.

    Using Sven's code as an example, you could save the updated row in a sql plus variable. (also untested):
    SQL> var v_id number
    update tableA  
    set colB='ABC' 
    where colC='XYZ' 
    returning id into :v_id;
    insert into table A_History (ID, colA, colB, ColC)  
    select id, ColA, ColB, ColC  
    from tableA  
    where id = :v_id;   

  • I am using Photoshop Elements 11.  Do all .jpg formatted file have to be retangular in shape?  I want to create an oval .jpg picture to insert into a book.  Haven't been able to do so.  It would work if I could make the area outside the oval completely tr

    I am using Photoshop Elements 11.  Do all .jpg formatted file have to be retangular in shape?  I want to create an oval .jpg picture to insert into a book.  Haven't been able to do so.  It would work if I could make the area outside the oval completely transparent.  Can anyone help me here?

    JPG does not support transparency, so even if you create an oval with transparent background, the saved JPG will have white background. Instead, save it as a PNG, TIFF, or GIF which preserve the transparency.
    Here is one of many ways to create your oval:
    Create a new file the approximate size of the oval. Add the oval with the Custom Shape Ellipse tool, and simplify the shape layer.
    In the Layers Palette, Ctrl-click the oval to select it and copy the selection to the clipboard (Edit > Copy).
    Then do File > New from Clipboard. This creates the oval with transparent background cropped to the oval size.
    Then save it as one of the file types that support transparency (and also supported by the application where you are sending the picture to).
    Note:  Is is not even necessary to do step 2. That is only if some reason you want the oval to be tightly cropped. It is sufficient to delete the Background layer in step 1 (or turn off its visibility) and save the file. The oval will appear correctly in the book with either version.

  • How do I update/insert into a target table, rows after date X

    Hi all
    I have a mapping from source table A to target table B. Identical table structure.
    Target table A updates rows and inserts rows daily. Every week I want to synchronize this with table B.
    I have CREATION_DATE and LAST_UPDATE_DATE on both tables. I want to pass in a parameter to this mapping of date X which tells the mapping:
    "if CREATION_DATE is past X then do an insert of this row in B, if LAST_UPDATE_DATE is past X then do an update of this row in B"
    Please can you help me work out how to map this correctly as I am new to OWB.
    Many thanks
    Adi

    Hi,
    You can achieve this by -
    1. Create a control table, say Control_Table, with structure
    Map Name, last_load_date. Populate this table with the mappings that synchronizes your Table B.
    2. Alter mapping, that loads Table B to use the above control table to get all the records from Table A, you have to join Table A and Control_Table with the condition -
    Control_Table.Map_Name = < mapping name>
    AND ( TableA.Creation_Date > Control_Table.last_load_date
    OR TableA.Last_Update_Date > Control_Table.last_load_date )
    3. Then use UPDATE/INSERT on the Table B based on the Keys. This should take care of INSERT ( if not present) / UPDATE (if the row already exists).
    4. Schedule the mapping to run on weekly basis.
    5. You have to maintain the Control_Table to keep changing the values for Last_Load_Date to pick the data since the last time Table B is synchronized.
    HTH
    Mahesh

  • How to INSERT INTO a specific row?

    I have a form with a calendar at the top, below it is a list of items each with a check box.
    Here is a wonderful visual of it -
    Calendar
    Checkbox | Col | Col | Col
    Checkbox | Col | Col | Col
    Checkbox | Col | Col | Col
    I want it so you select the date and it gets passed into the database in the same row as the one (definitely one, multiple is better) that has been checked by the user.
    I was trying an INSERT INTO with a WHERE statement but apparently you can't do that. So if I can use a WHERE with INSERT INTO, how can I identify which row to insert the info?
    Currently it is passing the dates but it creates a new row.
    I didn't think posting the code is neccisary for this question but if anyone wants to see it let me know and I will post it.
    THANKS!

    Ah, ok, I will try UPDATE.
    Right now my form looks like this...
    <cfform name="requestform" role="form"action="resources/requestform.cfm" method="post"  width="375" height="350" >
        <label for="startdate">Start Date:</label>
          <label for="enddate">Finish Date:</label>
        <cfcalendar name="selectedDate" 
            selectedDate="#Form.selectdate#"
            startRange="#Form.startdate#"
            endRange="#Form.enddate#" 
            mask="mmm dd, yyyy" 
            dayNames="SU,MO,TU,WE,TH,FR,SA"
            firstDayOfWeek="1"
            monthNames="JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC"
            style="rollOverColor:##FF0000"
            width="200" height="150">
                <cfinput type="dateField" name="startdate" label="Start Date" width="100" value="#Form.startdate#">
                <cfinput type="dateField" name="enddate" label="End Date" width="100" value="#Form.enddate#">
        </div>
    <cfinclude
        template = "resources/query.cfm">
        <span class="label label-default">Equipment List</span>
        <table class="table table-bordered table-striped">
            <tr>
                <td><b>Select</b></td>   
                <td><b>Name</b></td>
                <td><b>Description</b></td>
                <td><b>Status</b></td>
            </tr>
        <cfloop query = "equiplist">
            <cfoutput>
            <tr>
                <td>
                    <cfinput name="status" type="checkbox" value="#serial#">Select:</cfinput>
                    <cfinput name="serial"type="text"style="display:none" value="#serial#">
                </td>   
                <td>#name#</td>
                <td>#descrip#</td>
                <td>#status#</td>
            </tr>
            </cfoutput>
    </cfloop>
    </table>
          <cfinput class="btn btn-default" type="Submit" value="Submit" name="addsubmit"></cfinput>
    </cfform>
    And the action page looks like this...
    <cfquery
            name = "requestform"
            dataSource = "db_cie">
            UPDATE equip
            SET STATUS="Out",
            WHERE serial='#status#'
    </cfquery>
    <cflocation
        url = "../request.cfm">
    But I am getting an error "invalid.user.table.column, table.column, or table specification. But the error message shows the SQL output and it looks correct...UPDATE equip SET STATUS="Out" WHERE serial="325255"... it IS getting the serial number variable passed from the form. ...No update though. Is my action form written wrong?

Maybe you are looking for

  • How do I move an audiobook file from desktop to iTunes

    I have just joined the local library and I am attempting to borrow my first audiobook. I have downloaded an app called BorrowBox as instructed and downloaded the audiobook which has appeared on my desktop. I was hoping to get this on to my ipod  to l

  • PDF form field populate

    Hi, I am currently trying to figure out a way to populate certain field forms from a database I built from Excel using Access. I am a complete newbie at scripting and I know that will be involved. I also know that I would need to bind certain fields

  • My ipad wants me to restore it. Is there any hope for me getting back the data before this happened?

    So I went to turn on the ipad2, and there is an icon telling me to connect it with my MacBook to restore it. It worked fine the night before. Anyway, is there any way to get back what was on it. I am mostlry concerned with photographs. I am ashamed t

  • Camera Raw 7.0 for Photoshop CS5 to be compatible with Lightroom 4?

    When I try to open an image from LR4 in Photoshop CS5 I get a message asking me to download Camera Raw 7.0.  This is not on the Adobe web site.  When will it be available? Message title was edited by: Brett N

  • SRM User Cannot Refresh Field Qty if Changed

    Hi Experts, Sorry for the repost but I have not gotten an answer and still have the problem described below. Can someone please tell me where I should start looking. Since this only affects one user i don't think its a programming issue.  Is there a