How to insert many records

Hi All,
I am newbie, I have one question. suppose there is One table containing hundreds of records and now i have
added DATE column in that table and Now I have to insert the sysdate in that column for all rows.
Then how can i do it by executing a single query at a time

While adding column to a table, you can give default value to be set for all previous records with ALTER TABLE command
alter table employee add cur_date date default sysdate;But if table has been already altered, then you need to UPDATE the old records with default value
UPDATE mytable
set datecol = sysdate
where datcol is null

Similar Messages

  • How to insert multiple records in a single query

    Dear all,
    Can you please tell
    how to insert multiple records in a single query ??

    INSERT INTO table_name (column_1, column_2) VALUES ('value_A', 'value_B')OR
    INSERT INTO table_name
    (column_1, column_2)
    SELECT 'value_A', 'value_B' FROM DUAL
    UNION ALL
    SELECT 'value_C', 'value_D' FROM DUAL
    ;Edited by: Benton on Nov 9, 2010 1:59 PM

  • How to insert a record in ROOSPRMSC table? (accidentally deleted)

    Calling an InfoPackage in BW causes short dump, while fixing the short dump issue, accidentally
    deleted the "ROOSPRMSC" table entries.
    Could you tell me how to insert a record in "ROOSPRMSC" table???

    Hi Senthil,
    Regards,
    Phani Raj Kallur
    Message was edited by: Phani Raj Kallur

  • How to insert null record (some col) in table using loop

    Hi,
    How to insert null record (for some columns) in table using loop.
    sample data of x_tab
    order_id order_name
    231 xxx
    123
    345
    111 vvvv
    Thanks,
    Lakshman
    Edited by: kolipaka on Jul 5, 2012 1:37 PM

    You have a table
       CREATE TABLE tab (
          col1  NUMBER,
          col2  NUMBER,
          col3  NUMBER,
          col4  NUMBER
          col5  NUMBER)Now you insert:
       INSERT INTO tab (col2, col4) VALUES (5, 7);col1, col3 and col5 are NULL by default (there is no DEFAULT clause for these columns so they are NULL).

  • How to Insert a record in a database table in debugging mode in production

    Hi,
    How to Insert a record in a database table in debugging mode in production ?
    Waiting for kind response.
    Best Regards,
    Padhy
    Moderator Message : Duplicate post locked.
    Moderator message : Warning. Don't create multiple threads for same question.
    Edited by: Vinod Kumar on May 12, 2011 11:02 AM
    Edited by: Vinod Kumar on May 12, 2011 11:04 AM

    Hi Senthil,
    Regards,
    Phani Raj Kallur
    Message was edited by: Phani Raj Kallur

  • How to insert multiple records?

    I have dynamically checkboxes, which get the data from database. I have used a FOR loop to store each value of the checkbox to session variables, i.e.
    session.setAttribute("Slangs"+a,request.getParameter("langsID"+a)); (p/s: a is a counter, I also set a hidden variable to store the number of record in DB)
    Now, I wanna insert these records to the table called CusLangs which has CusID(PK) and Langs(PK). I wanna construct a insert.jsp, so that those checkboxes that I selected can be written into table CusLangs.
    Anyone know how to do that?
    Thanks.
    From
    jeff

    You have a checkboxes with the same name in your html/jsp.When you post to a servlet/jsp, use request.getParameterValues("checkboxname ) to get String [], ie.
    <html>
    <input type="checkbox" name="sampleCheck" value="1">
    <input type="checkbox" name="sampleCheck" value="2">
    </html>
    Servlet/ JSP
    String check[] = request.getParameterValues("sampleCheck");
    query = "Insert into CusLangs (CusID) values (?') ";
    stmt = connection.prepareStatement(query);
    for(int i=0, i < check.length, i++) {
    stmt.setString(1, check[0]);
    int x = stmt.executeUpdate();
    Hope this will help.

  • Urgent help : how when insert new record navigation off

    hi master
    Sir
    when i insert new record by mistake press down key and curser move to next record and my need is
    When I insert new record or change any record that time my form navigation musht be off and no move to next record how I restrict to navigation please give me idea which event and what code I use
    Thanking you
    aamir

    If u want the cursor not to move ahead from a particular field when the records are inserted or updated on that field then u can just write null to the
    key-next-item trigger of that particular item.
    ie IN key-next-item
    null;
    Hope this is what you wanted.

  • How to insert  new records in Master and detail Forms.

    Hi,
    I am having trouble inserting values in both master and detail view at the same time. The scenarios is I have a Dept Table (View Object-VO1) and Employee Table(View Object -VO2) both linked with a foreign key, as per Default HR schema in Oracle DB XE.
    Now I want to insert new record in both Dept(VO1) and EMP(VO2) table via a New page say ( Page2 ). There is a button on Page1 with button INSERT .I can only drag-drop "CreateInsert" operation on that button for VO1 or VO2. So only text box for Dept records are enable to insert data but not Emp records. Is there a way I can insert data in both the tables at the sametime??
    Thanks,
    MB

    Hi MuradRabbani,
    You can programmatically call both createInsert Operations,
    Add to your pageDef both CreateInsert Operations.
    Create a button tha will call insert method from Master (VO1) and then call insert method for Detail (VO2)
    Here is an Example code of calling the operations:
    DCBindingContainer dcb = ADFUtils.getDCBindingContainer(); //you need ADFUtils.java and JSFUtils.java classes. You can find them in the sample applications in your JDeveloper.
    OperationBinding oper = dcb.getOperationBinding("CreateInsertVO1");
    oper.execute();
    -----------------NOTE: at this point you should have set values that compine the ViewLink on the master in order the detail will know where to link the new record there are many ways to do it.
    As an approach try to overrdi the create Method on the in the ViewRowImpl of your Master vo (VO1)
    e.g.
    @Override
    protected void create(AttributeList attributeList) {
    //before
    attributeList.setAttribute("NameOfAttribute", valueHere);
    super.create(attributeList);
    After that you should call the operation for your detail VO2
    e.g.
    DCBindingContainer dcb = ADFUtils.getDCBindingContainer();
    OperationBinding oper = dcb.getOperationBinding("CreateInsertVO2");
    oper.execute();
    The detail record will now have the values from your master automatically.
    Regards,
    Dimitris.

  • How to insert the records using sql query

    hi,
    i insert the record uisng sql query and DOTNET programme successfully and increase the doc num .ubut when i try to  add record using SAP B1 the old Doc no show.It means its not consider the docnums which are not inserted by sql query.
    how can i solve this problem?
    Regards,
    M.Thippa Reddy

    You are not support use Insert / Update / Delete on SAP Databases directly.
    SAP will not support any database, which is inconsistent, due to SQL-Queries, which modify datasets or the datastructure of the SAP Business One Database. This includes any update-, delete- or drop-statements executed via SQL-Server Tools or via the the query interface of SAP Business One
    Check SAP Note: 896891 Support Scope for SAP Business One - DB Integrity
    [https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/smb_searchnotes/display.htm?note_langu=E&note_numm=896891]

  • How to insert multiple records into a table?

    hi all 
    i have a table that name is : TiketsItem
    now i  want to 100 records insert my table
    for example : TicketsHeaderRef=52000
    Active=False
    TicketsItemId=45000 to 45100
    how to insert TicketsItemId  45000 to 45100 in my table
    thanks all
    Name of Allah, Most Gracious, Most Merciful and He created the human

    So, you just want to insert the serialized data into the table, without useDate or WKRef? I'm assuming these values will be updated later?
    Try something like this:
    DECLARE @TicketsHeader TABLE (TicketsItemID BIGINT, ticketsHeaderRef BIGINT, active BIT, useDate DATETIME, WKRef SMALLINT)
    DECLARE @startInt BIGINT = 45000
    WHILE @startInt <= 45100
    BEGIN
    INSERT INTO @TicketsHeader (TicketsItemID, ticketsHeaderRef, active)
    VALUES (52000, @startInt, 0)
    SET @startInt = @startInt + 1
    END
    SELECT *
    FROM @TicketsHeader
    thanks 
    i edited your codes:
    DECLARE @TicketsItem TABLE (TicketsItemID BIGINT, ticketsHeaderRef BIGINT, active BIT, useDate DATETIME, WKRef SMALLINT)
    DECLARE @startInt BIGINT = 45000
    WHILE @startInt <= 45100
    BEGIN
    INSERT INTO @TicketsItem (TicketsItemID, ticketsHeaderRef, active)
    VALUES (@startInt,52000 , 0)
    SET @startInt = @startInt + 1
    END
    when i execute:
    SELECT *  FROM TiketsItem
    i do not see any records inserted in TiketsItem
    how to solve it?
    Name of Allah, Most Gracious, Most Merciful and He created the human

  • How to insert new record into altered table

    I am using JDBC with MySQL. I altered existing table and want to insert new record using java class. But it is not possible.How to do?

    How is it "not possible"?
    Either modify the Class for the new fields, or give the new fields default values (if applicable). If the type of an existing column has changed, then only the first option is available.
    Where's the problem?

  • How to insert same record multiple times in a loop..

    Dear All,
    I need to insert a record multiple time how it can be accomplish...
    eg:
    ref no name dept
    123     abc 1     
    122 def 2
    121 feg 1
    120 hhh 2
    while inserting into another table:
    all dept no 1 with should inserted 3 times for each record above
    final out put should be :
    table abc
    ref no name dept
    123     abc 1
    123     abc 1
    123     abc 1     
    122 def 2
    121 feg 1
    121 feg 1
    121 feg 1
    120 hhh 2
    Thank You

    user3029023 wrote:
    Dear All,
    I need to insert a record multiple time how it can be accomplish...
    eg:
    ref no name dept
    123     abc 1     
    122 def 2
    121 feg 1
    120 hhh 2
    while inserting into another table:
    all dept no 1 with should inserted 3 times for each record above
    final out put should be :
    table abc
    ref no name dept
    123     abc 1
    123     abc 1
    123     abc 1     
    122 def 2
    121 feg 1
    121 feg 1
    121 feg 1
    120 hhh 2
    Thank YouTry this .
    SQL> ed
    Wrote file afiedt.buf
      1  with t as
      2  (select '123' AS ref_no,'abc' AS name,'1' as Dept
      3  from dual
      4  union all
      5  select '122','def','2' from dual
      6  union all
      7  select '333','feg','1' from dual
      8  union all
      9  select '120','hhh','2' from dual
    10  )
    11  select ref_no,name,Dept from t,(select level x from dual connect by  level <4)
    12* order by 1
    SQL> /
    REF NAM D
    120 hhh 2
    120 hhh 2
    120 hhh 2
    122 def 2
    122 def 2
    122 def 2
    123 abc 1
    123 abc 1
    123 abc 1
    333 feg 1
    333 feg 1
    333 feg 1
    12 rows selected.And insert the same onto your desired table.
    Hope this Helps..
    Regards,
    Achyut

  • How to insert multile records at a time in same db table

    Hi All,
    I want to insert more than one record in db-tabe.As ADF-Form /ADF-Creation form will insert only one record at time is there any way to insert multiple records using ADF-Table
    Thanks in Advance
    Regards
    RHY

    See the following section in the ADF Developer's Guide for Forms/4GL Developers for some insights on this:
    (*) 10.4.3 When to Use CreateInsert Instead of Create
    You can find the guide on the ADF Learning Center here:
    http://www.oracle.com/technology/products/adf/learnadf.html

  • [php+mysql] how to insert 3 records at once and print out all 3 records?

    Hi all,
    I have to create a serie of pages that allow the user to:
    1- Insert 3 records in a mysql db at once
    2- click NEXT
    3- viewverify//print the data that he has entered (all 3
    records)
    4- click PRINT
    5- click FINISH
    then, restart from 1
    What is the best way to do this?
    TIA for any suggestion.
    tony

    The best way is usually to use a stored procedure. Do you
    know if the version of MySQL you are using supports sprocs?

  • How to insert 20 records  only in one table

    hi to all,
    i want insert 20 records only in a table,but suppose i want to enter 21th record it will not inserted .
    suppose delete one record then insert, it will insert.
    but always count(*) is not greater than 20.
    is there any solution for that,
    pls help me

    Yes there is a solution for that using a materialied view:
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
    PL/SQL Release 10.2.0.1.0 - Production
    CORE    10.2.0.1.0      Production
    TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    SQL> drop table t purge;
    Table dropped.
    SQL> drop materialized view t_mv;
    Materialized view dropped.
    SQL> create table t (
      2  x integer,
      3  y varchar2(30)
      4  );
    Table created.
    SQL> CREATE MATERIALIZED VIEW LOG on t
      2  WITH ROWID (x, y)
      3  including new values;
    Materialized view log created.
    SQL> CREATE MATERIALIZED VIEW t_mv
      2  REFRESH FAST ON COMMIT AS
      3  SELECT count(*) cnt
      4  FROM t;
    Materialized view created.
    SQL> alter table t_mv ADD CONSTRAINT chk check(cnt<=20);
    Table altered.
    SQL> insert into t select object_id, object_name from all_objects where rownum <
    21;
    20 rows created.
    SQL> commit;
    Commit complete.
    SQL> insert into t values(21,'KO');
    1 row created.
    SQL> commit;
    commit
    ERROR at line 1:
    ORA-12008: error in materialized view refresh path
    ORA-02290: check constraint (TEST.CHK) violated
    SQL>
    SQL> select count(*) from t;
      COUNT(*)
            20
    SQL>Not sure that trigger based solution works due to multi versioning read consistency.

Maybe you are looking for

  • Unable to access Network Preferences

    When going into network preferences I am recieving a message: "You cannot open Network Preferences pane because it is not availible to you at this time." Because of it I cannot access a lot of components in the system preferences. I made sure The wif

  • Office Document open in browser

    Hi, I am trying to open an office document directly in the browser, but IE (V8) always open the modal dialog to open or save. I have tried differents ways and read almost every threads about this topic, some of the solutions that I tried are: - Modif

  • Latest advice on creating .flv advice from Final Cut Express?

    IN our newsroom, we have a recently purchased MacBook Pro running Final Cut Express 4.0.1 for the creation of videos for our website - problem is the the website can only take .flv files and they can be no larger than about 20 MBs. I have looked at m

  • I cant turn volume up or down

    im having problem with touch volume control and wireless control

  • Version Change in User Exit , Customer Exit, Screen Exit

    Hi All, If Version change then whether the user exit, customer exit & screen exit will remain same? or what needs to be done for that?. Regards, Abhijit