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

Similar Messages

  • How to insert new record in the database table using the Jdeveloper

    Hi Masters
    I am new Bee in j2EE developing side and i ahve oracle jdeveloper 9i version is 9.0.4
    And now I wann to know that how can i create the web application that will enter the Data in the HTML FORM and save that data into the Table emp plz tell me step by step
    thx in advance

    the steps to follow -
    download JDeveloper 10.1.2 from OTN (9.0.4 is very old and has some features that won't be in the next releases).
    Then follow the ADF Workshop from the JDeveloper home page on OTN.
    (If you have to use 9.0.4 then look for the archives of JDeveloper on OTN)
    for example:
    http://www.oracle.com/technology/products/jdev/viewlets/viewlet-archive0903.html

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

  • Inserting multiple records in to database table using webdynpro abap

    Hi all,
    I have created a username inputfield,a button and a table
    with one coloumn.
    If i enter  names in the input field then the values should be
    displayed in that table.
    Even i have got the answer i am not able to insert
    the values in to database(ztable) table.
    i.e. only one value(1st) was inserted the second value was
    not inserted ....
    so kindly send me the coding to insert multiple records
    into the database table......
    by,
    ranjith

    hi Ranjith,
    If you want to insert multiple records from the webdynpro view table to database table then try the following code.
    DATA lo_nd_tablenode TYPE REF TO if_wd_context_node.
      DATA lo_el_tablenode TYPE REF TO if_wd_context_element.
      DATA ls_tablenode TYPE wd_this->element_tablenode.
      DATA it_tablenode LIKE STANDARD TABLE OF ls_tablenode.
      navigate from <CONTEXT> to <tablenode> via lead selection
      lo_nd_tablenode = wd_context->get_child_node( name = wd_this->wdctx_tablenode ).
      get element via lead selection
      lo_el_tablenode = lo_nd_tablenode->get_element(  ).
      get all declared attributes
      lo_nd_tablenode->get_static_attributes_table(
      IMPORTING
        table = it_tablenode ).
    MODIFY databasetablename FROM TABLE  it_tablenode.
    here it_tablenode is the internal table which holds the value from webdynpro view..
    Regards,
    Shamila.

  • How to insert a record to the z-table.

    Hi Experts,
    I have created one z-tabe with fields
    refnum, and
    status.
    if the refnum is >200 ; Status field should get the value as "TRUE" else "FALSE".
    could any one help me on this.
    regards,
    Sunil

    hi,
    try this.
    data : itab type standard table of (name of ur ztable) with header line.
    select * from (ztable) into table itab.
    loop at itab.
    if itab-refnum > 200.
    itab-status = 'true'.
    else.
    itab-status = 'false'.
    endif.
    modify table itab[] from itab index sy-tabix.
    endloop.
    update (ztable) from table itab.
    hope this gives some idea.

  • How to insert a record in to oracle table from Java which has a oracle LONG Field?

    The problem is only 80 char's inserted in to the LONG FIELD which happend to me when i run the same insert statement from SQL plus.
    Here is the code....
    java.io.File inputFile = new java.io.File("input.txt");
    int inputFileLen = (int) inputFile.length();
    java.io.InputStream ipStream = new java.io.FileInputStream(inputFile);
    System.out.println(inputFileLen);
    PreparedStatement myStmt = conn.prepareStatement("insert into LONG_EXAMPLE (notes,name)values(?,?)");
    myStmt.setAsciiStream(1, ipStream, inputFileLen);
    myStmt.setString(2,"Steve");
    int res = myStmt.executeUpdate();
    myStmt.close();
    Note : Here the size of the input.txt 250 bytes , 1KB.
    Thanks in advance......:-)
    Cheers,
    Vetri !

    Hien
    I had a similar requirement to you and put the code on a push button. In my case the reports are being run interactively to the screen and then printed, and I have no way to know whether the report had actually been printed, so we rely on the user pressing the button. Of course there is a danger that the user forgets to press the button, but in our situation that would not be disasterous. Whatever method is used, I don't think there is any way to be sure that it has actually come out of the printer.

  • INSERTING A RECORD IN THE Z-TABLE USING PBI IN SCREE PROGRAM.

    Hi Experts!,
                     I have created a z table with some fields and also I have created the screen for the input. I want to store the the record when I click on  Submit button and clear the screen while I click on reset buttons which is present in the screen.
    Could any one help with codes!!!
    points will be rewarde for useful one's.
    Thanks in advance,
    Sunil

    Hi Khanna,
                Thankx for solving my issue, but I need some more help from you, In the same porogram, I need to generate a system generated new number for every record which is stored in the table. The following is the prg:
    INCLUDE MZFIRSTPAGETOP                          .    " global Data
    TABLES: ZCHP_CUST_INFO.
    *DATA: OKCODE LIKE SY-UCOMM.
    DATA:   CNAME LIKE ZCHP_CUST_INFO-CREATED_BY,
            REQTYP LIKE ZCHP_CUST_INFO-REQUEST_TYPE,
            DESC LIKE ZCHP_CUST_INFO-SHORT_TEXT,
            PRIO_TYPE LIKE ZCHP_CUST_INFO-PRIORITY_TYPE,
            EFFECTIVE_DATE like ZCHP_CUST_INFO-REQUIRED_STR_DAT,
            COMM_TYP like ZCHP_CUST_INFO-MODE_OF_COMM,
            COMM like ZCHP_CUST_INFO-ADDRESS,
            REF_NUM LIKE ZCHP_CUST_INFO-REQ_NUM.
    *&      Module  STATUS_0100  OUTPUT
          text
    MODULE STATUS_0100 OUTPUT.
      SET PF-STATUS 'FOR1000'.
      SET TITLEBAR '1000'.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    INCLUDE MZFIRSTPAGEO01                          .  " PBO-Modules     *
    INCLUDE MZFIRSTPAGEI01                          .  " PAI-Modules     *
    INCLUDE MZFIRSTPAGEF01                          .  " FORM-Routines   *
    *&      Module  USER_COMMAND_1000  INPUT
          text
    MODULE USER_COMMAND_1000 INPUT.
    CASE SY-UCOMM.
      WHEN 'SUBMIT'.
            ZCHP_CUST_INFO-CREATED_BY = CNAME.
            ZCHP_CUST_INFO-REQUEST_TYPE = REQTYP.
            ZCHP_CUST_INFO-PRIORITY_TYPE = PRIO_TYPE.
            ZCHP_CUST_INFO-SHORT_TEXT = DESC.
            ZCHP_CUST_INFO-CREATED_ON = EFFECTIVE_DATE.
            ZCHP_CUST_INFO-MODE_OF_COMM = COMM_TYP.
            ZCHP_CUST_INFO-ADDRESS = COMM.
    INSERT ZCHP_CUST_INFO.
    COMMIT WORK.
    *GENERATING A REF_NUMBER.
    CALL FUNCTION 'NUMBER_GET_NEXT'
    EXPORTING
    nr_range_nr = '01'
    object = 'ZCHP_CUST_INFO'
    QUANTITY = '1'
    SUBOBJECT = ' '
    TOYEAR = '0000'
    IGNORE_BUFFER = ' '
    IMPORTING
    number = ZCHP_CUST_INFO-REQ_NUM " specify ur wa field
    QUANTITY =
    RETURNCODE =
    EXCEPTIONS
    interval_not_found = 1
    number_range_not_intern = 2
    object_not_found = 3
    quantity_is_0 = 4
    quantity_is_not_1 = 5
    interval_overflow = 6
    buffer_overflow = 7
    OTHERS = 8.
    INSERT ZCHP_CUST_INFO.
    COMMIT WORK.
    WHEN 'RESET'.
           CLEAR: CNAME,REQTYP,PRIO_TYPE,
    DESC,EFFECTIVE_DATE,COMM_TYP,COMM.
      WHEN 'CANCEL'.
            LEAVE PROGRAM.
    ENDCASE.
    ENDMODULE.                 " USER_COMMAND_1000  INPUT
    Thanks and regards,
    Sunil

  • Insert same record on two different tables (no master detail)

    Hi all,
    I'd like to know how to insert 1 record into two different
    tables.
    the first table is corni_dati the second is cornidati_prev
    anytime someone inserts a new record both tables should be
    filled.
    if ((isset($HTTP_POST_VARS["MM_insert"])) &&
    ($HTTP_POST_VARS["MM_insert"] == "form1")) {
    $insertSQL = sprintf("INSERT INTO corni_dati (corni_id,
    disciplina,
    codice_modulo, insegnanti, classi, obiettivi, prerequisiti,
    ud1, ud2,
    ud3, ud4, ud5, ud6, metodologia, collegamenti, verifiche,
    verifiche_note, durata, periodo_inizio, periodo_fine, note,
    indirizzo,
    modnum, modulo_titolo, `data`, compilato, descrizione) VALUES
    (%s, %s,
    %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s,
    %s, %s, %s,
    %s, %s, %s, %s, %s, %s, %s)",
    GetSQLValueString($HTTP_POST_VARS['corni_id'],
    "int"),
    GetSQLValueString($HTTP_POST_VARS['disciplina'],
    "text"),
    GetSQLValueString($HTTP_POST_VARS['codice_modulo'], "text"),
    GetSQLValueString($HTTP_POST_VARS['insegnanti'],
    "text"),
    GetSQLValueString($HTTP_POST_VARS['classi'],
    "text"),
    GetSQLValueString($HTTP_POST_VARS['obiettivi'],
    "text"),
    GetSQLValueString($HTTP_POST_VARS['prerequisiti'], "text"),
    GetSQLValueString($HTTP_POST_VARS['ud1'],
    "text"),
    GetSQLValueString($HTTP_POST_VARS['ud2'],
    "text"),
    GetSQLValueString($HTTP_POST_VARS['ud3'],
    "text"),
    GetSQLValueString($HTTP_POST_VARS['ud4'],
    "text"),
    GetSQLValueString($HTTP_POST_VARS['ud5'],
    "text"),
    GetSQLValueString($HTTP_POST_VARS['ud6'],
    "text"),
    GetSQLValueString($HTTP_POST_VARS['metodologia'], "text"),
    GetSQLValueString($HTTP_POST_VARS['collegamenti'], "text"),
    GetSQLValueString($HTTP_POST_VARS['verifiche'],
    "text"),
    GetSQLValueString($HTTP_POST_VARS['verifiche_note'], "text"),
    GetSQLValueString($HTTP_POST_VARS['durata'],
    "int"),
    GetSQLValueString($HTTP_POST_VARS['periodo_inizio'], "text"),
    GetSQLValueString($HTTP_POST_VARS['periodo_fine'], "text"),
    GetSQLValueString($HTTP_POST_VARS['note'],
    "text"),
    GetSQLValueString($HTTP_POST_VARS['indirizzo'],
    "text"),
    GetSQLValueString($HTTP_POST_VARS['modnum'],
    "text"),
    GetSQLValueString($HTTP_POST_VARS['modulo_titolo'], "text"),
    GetSQLValueString($HTTP_POST_VARS['data'],
    "date"),
    GetSQLValueString($HTTP_POST_VARS['compilato'],
    "text"),
    GetSQLValueString($HTTP_POST_VARS['descrizione'], "text"));
    mysql_select_db($database_itiscorni, $itiscorni);
    $Result1 = mysql_query($insertSQL, $itiscorni) or
    die(mysql_error());
    $insertGoTo = "creacodice_doc.php";
    if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
    $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
    $insertGoTo .= $HTTP_SERVER_VARS['QUERY_STRING'];
    header(sprintf("Location: %s", $insertGoTo));

    If you are doing this then you really should have a look at
    your database
    design. Read up on the first 3 normal forms.
    Pat.
    "darrel" <[email protected]> wrote in message
    news:ee77jg$302$[email protected]..
    >
    >
    > --
    >> Hi all,
    >> I'd like to know how to insert 1 record into two
    different tables.
    >
    > In your SQL query, just use two inserts:
    >
    > INSERT into TABLE1...; INSERT into TABLE2...
    >
    > Darrel
    >

  • 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 process each records in the derived table which i created using cte table using sql server

    I want to process each row from the CTE table I created, how can I traverse from first row to second row and so on....
    how to process each records in the derived table which i created using  cte table using sql server

    Ideally you would be doing a set based processing rather than traversing row by row as thats more efficient. To answer it specific to your scenario we may need more info. Can you explain with some sample data your exact requirement?
    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • How to insert line or row in a table?

    Hi OAF experts,
    can anyone show me how to insert row or line in a table bean by setting the table.setAutoInsertion(false) ?
    Thank you.
    Jon

    As per Dev Guide:---
    The other change you can make is to suppress the default Add Another Row button behavior of adding a
    single row to the view instance associated with the table, so that you can handle the event with your own code.
    The following code example illustrates how to accomplish this:
    processRequest
    // Enabled add row and turn off the default "Add Another Row" table event
    // The add row event has to be auto-handled by developer in processFormRequest
    tableBean.setInsertable(true);
    tableBean.setAutoInsertion(false);
    processFormRequest
    if ((tableBean.getName()Equals(pageContext.getParameter(SOURCE_PARAM))) &&
    (ADD_ROWS_EVENT.equals(pageContext.getParameter(EVENT_PARAM))))
    OAApplicationModule am = pageContext.getApplicationModule(tableBean);
    am.invokeMethod("handleInsertRow", null);
    // The ***AMImpl.java in which method "handlInsertRow" has been defined
    public void handleInsertRow()
    OAViewObject vo = findViewObject("voName");
    vo.invokeMethod("handleInsertRow");
    // The ***VOImpl.java which is associated with the table; and in which the
    // handleInsertRow is defined
    public void handleInsertRow()
    Row row = createRow();
    // Set any default attributes
    row.setAttribute(...);
    // Insert the row into the VO
    insertRow(row);
    Thanks
    --Anil                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to check the records in Master Data Table?

    Hi,
       I am trying to load the Master Data Table using the Flat File.Now how to check the records in Master Data Table?
    I done the following way:
    Info Provider->Info Object->Right Click->Display Data or Maintain Master Data
    But it's not showing the records.It's asking like CID from......To......
                                                                        CID(SID)from.............To.......
                                                                         here CID means customer id(characteristic).
    and showing some settings.
    Please guide me.
    Thanks & Regards

    Hi Sri,
    Go to T- code RSD1 and type your info object name and open the P- table in the infoobject then select execute symbol to see the updated  data in to master data info object.
    regards
    sap

  • Insert a record in Qualified Lookup Table

    Hello everyone,
    I need code to insert a record in Qualified Lookup Table where the non-qualifier is a record of type Country. Other fields are qualifiers.
    I tried using QualifiedLookupValue.createQualifiedLink(). However, this only helps to insert in the qualifier values, how can I insert the non-qualifier (Country) value?
    Any idea?
    Many thanks in advance,
    Baez

    Hi guys,
    Maybe the answer comes late but i'm recently working on this and the API works for me to create and update qualifier values.
    Suppose recordMain is the main record, fldQFT is the qualified lookup field in main table, fldQualifier is the qualifier field in QFT table.
    To add qualifier value you can use:
    QualifiedLookupValue qualifiedLookupValue = new QualifiedLookupValue();
    int index = qualifiedLookupValue.createQualifiedLink(recordMain.getId());
    qualifiedLookupValue.setQualifierFieldValue(index, fldQualifier, MdmValue);
    recordMain.setFieldValue(fldQFT, qualifiedLookupValue);
    To update qualifier value, use:
    QualifiedLookupValue qualifiedLookupValue = (QualifiedLookupValue) recordMain.getFieldValue(fldQFT);
    qualifiedLookupValue.setQualifierFieldValue(index, fldQualifier, MdmValue);
    recordMain.setFieldValue(fldQFT, qualifiedLookupValue);
    Regards,
    James

Maybe you are looking for

  • How to use the rownum to get only 5 records?

    Hello Folks, I have this queury which pulls in the CLient,EventStatus along with the Events for each user. I just want to condense the data so that each user has not more than 5 events. select c.client_code "Client Code",        c.client_name "Client

  • IPhoto 7.1 has fixed the iPhoto 6 "revert to original" bug

    Over a year ago I posted on an iPhoto bug, possibly related to use of importing Libraries. http://discussions.apple.com/thread.jspa?messageID=3031479 was the original thread, but it's long been archived. Basically, iPhoto would show the 'revert to or

  • Lightroom catalog corrupted

    On my Mac I had to force quit the computer with Lightroom running. The currently used catalog was corrupted on restart and can not be used. I spent 4 hours adjusting 2000 images on this catalog. I know i have to re-import all the images into a new ca

  • Why doesnt the sound play when i mirror my laptop to my apple tv play?

    why doesnt the sound play off my speakers when i mirror my laptop to my apple tv?

  • Service Pack Vs Support Pack

    Hi All, Is there a difference between Service Pack and Support Pack ? Thanks, Prashanth