Multiple row insert 2

Please i need help on how to enter multiple row into mysql with batch insert
statement and jsp.I do not have much java expereience
<---- THIS AN EXAMPLE OF MY INSERT FORM ---->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<form id="form1" name="form1" method="post" action="some sort of jsp page">
mike : <input type="text" name="staffid" />
john : <input type="text" name="staffid" />
peter :<input type="text" name="staffid" />
james :<input type="text" name="staffid" />
jerry :<input type="text" name="staffid" />
mikel: <input type="text" name="staffid" />
<input name="submit" type="button" />
</form>
</body>
</html>
<--MY DATABASE LOOKS LIKE --->
name | staffid |
I have been looking for a way to enter only the value or all the values that is entered by
the user.

Save the file under savevalues.jsp and the form submit posts the data to the same page which then executes the java code for obtaining connection, batch statement. You have to set the jdbc driver for mysql in the classpath and change the table name and column name
<%@ page import="java.sql.* %>
<%
  if (request.getParameterValues("staffid") != null) {
      try {
       Connection conn = null;
    Statement stmt = null;
    String driver = "org.gjt.mm.mysql.Driver";
    String url = "jdbc:mysql://localhost/octopus";
    String username = "root";
    String password = "root";
    Class.forName(driver);
    Connection conn = DriverManager.getConnection(url, username, password);
     conn = getConnection();
      stmt = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
      conn.setAutoCommit(false);
       String []values = request.getParameterValues("staffid");
       for (int i=0; i< values.length; i++ ) {
      stmt.addBatch("INSERT INTO tablename(name) VALUES(values)");
int[] updateCounts = stmt.executeBatch();
conn.commit();
     } catch (SQLException sqle) {
          System.out.println("Exception here :" + sqle.getMessage());
     } catch(Exception e) {
          System.out.println("Exception here :" + e.getMessage());
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<form id="form1" name="form1" method="post" action="savevalues.jsp">
mike : <input type="text" name="staffid" />
john : <input type="text" name="staffid" />
peter :<input type="text" name="staffid" />
james :<input type="text" name="staffid" />
jerry :<input type="text" name="staffid" />
mikel: <input type="text" name="staffid" />
<input name="submit" type="button" />
</form>
</body>
</html>
{code}

Similar Messages

  • How can I use multiple row insert or update into DB in JSP?

    Hi all,
    pls help for my question.
    "How can I use multiple rows insert or update into DB in JSP?"
    I mean I will insert or update the multiple records like grid component. All the data I enter will go into the DB.
    With thanks,

    That isn't true. Different SQL databases have
    different capabilities and use different syntax, That's true - every database has its own quirks and extensions. No disagreement there. But they all follow ANSI SQL for CRUD operations. Since the OP said they wanted to do INSERTs and UPDATEs in batches, I assumed that ANSI SQL was sufficient.
    I'd argue that it's best to use ANSI SQL as much as possible, especially if you want your JDBC code to be portable between databases.
    and there are also a lot of different ways of talking to
    SQL databases that are possible in JSP, from using
    plain old java.sql.* in scriptlets to using the
    jstlsql taglib. I've done maintenance on both, and
    they are as different as night and day.Right, because you don't maintain JSP and Java classes the same way. No news there. Both java.sql and JSTL sql taglib are both based on SQL and JDBC. Same difference, except that one uses tags and the other doesn't. Both are Java JDBC code in the end.
    Well, sure. As long as you only want to update rows
    with the same value in column 2. I had the impression
    he wanted to update a whole table. If he only meant
    update all rows with the same value in a given column
    with the same value, that's trivial. All updates do
    that. But as far as I know there's know way to update
    more than one row where the values are different.I used this as an example to demonstrate that it's possible to UPDATE more than one row at a time. If I have 1,000 rows, and each one is a separate UPDATE statement that's unique from all the others, I guess I'd have to write 1,000 UPDATE statements. It's possible to have them all either succeed or fail as a single unit of work. I'm pointing out transaction, because they weren't coming up in the discussion.
    Unless you're using MySQL, for instance. I only have
    experience with MySQL and M$ SQL Server, so I don't
    know what PostgreSQL, Oracle, Sybase, DB2 and all the
    rest are capable of, but I know for sure that MySQL
    can insert multiple rows while SQL Server can't (or at
    least I've never seen the syntax for doing it if it
    does).Right, but this syntax seems to be specific to MySQL The moment you use it, you're locked into MySQL. There are other ways to accomplish the same thing with ANSI SQL.
    Don't assume that all SQL databases are the same.
    They're not, and it can really screw you up badly if
    you assume you can deploy a project you've developed
    with one database in an environment where you have to
    use a different one. Even different versions of the
    same database can have huge differences. I recommend
    you get a copy of the O'Reilly book, SQL in a
    Nutshell. It covers the most common DBMSes and does a
    good job of pointing out the differences.Yes, I understand that.
    It's funny that you're telling me not to assume that all SQL databases are the same. You're the one who's proposing that the OP use a MySQL-specific extension.
    I haven't looked at the MySQL docs to find out how the syntax you're suggesting works. What if one value set INSERT succeeds and the next one fails? Does MySQL roll back the successful INSERT? Is the unit of work under the JDBC driver's control with autoCommit?
    The OP is free to follow your suggestion. I'm pointing out that there are transactions for units of work and ANSI SQL ways to accomplish the same thing.

  • Multiple row insert not working as before after applying hotfix apsb13-13

    Coldfusion 9.01
    Windows Server 2003
    Microsoft Access database (yeah, we know)
    Before the hotfix was applied, we could add multiple rows (anywhere from 1-100 or more) and now we're limited to 15 rows at a time after applying the hotfix. We've narrowed it down to the hotfix being the culprit as we had to rebuild the server not to long after this hotfix was applied (~ 1 month) and the multiple row inserts were once again working fine until we got to the point of applying this hot fix again.
    Anyone heard of this happening? Any ideas how to correct?
    Thanks in advance,
    fmHelp
    Below is code  of how we're doing the multiple row insert (it's performed over 3 pages):
    Page 1
    <cfform name="form1" method="post" action="handler.cfm?page=update_2">
    <input type="hidden" name="sProductID" value="<cfoutput>#qProducts.sProductID#</cfoutput>">
    <table width="100%" border="0" cellspacing="3" cellpadding="3">
      <tr>
        <th scope="row" colspan="2" align="center">Update an Inventory Product</th>
      </tr>
      <tr>
        <th width="42%" scope="row">Product ID</th>
        <td width="58%"><cfoutput>#qProducts.sProductID#</cfoutput></td>
      </tr>
      <tr>
        <th width="42%" scope="row">Friendly Name</th>
        <td width="58%"><cfoutput>#qProducts.sFriendly_Name#</cfoutput></td>
      </tr>
      <tr>
        <th width="42%" scope="row">Description</th>
        <td width="58%"><cfoutput>#qProducts.sDescription#</cfoutput></td>
      </tr>
      <tr>
        <th width="42%" scope="row">Vendor</th>
        <td><select name="sVendor">
          <cfoutput><option value="#qProducts.sVendor#">#qProducts.sVendor#</option></cfoutput>
          <option value=""></option>
          <cfoutput query="qVendor">
            <option value="#sVendor#">#sVendor#</option>
          </cfoutput>
        </select></td>
      </tr>
      <tr>
        <th scope="row">Order No.</th>
        <td><cfinput name="sOrder_No" type="text" value="" required="yes" message="Order number is a required field."></td>
      </tr>
      <tr>
        <th scope="row">Lot No.</th>
        <td><input name="sLot" type="text" value=""/></td>
      </tr>
      <tr>
        <th scope="row">Date Expires</th>
        <td><input name="dtExpire" type="text" value=""/></td>
      </tr>
      <tr>
        <th scope="row">Boxes received</th>
        <td><input name="iBoxes" type="text" value="" /></td>
      </tr>
      <tr>
        <th scope="row">Doses/Units</th>
        <td><input name="pcount" type="text" value="" /></td>
      </tr>
      <tr>
        <th scope="row">Note</th>
        <td><cfoutput>#qProducts.sNote#</cfoutput></td>
      </tr>
      <tr>
        <th scope="row"> </th>
        <td> </td>
      </tr>
      <tr>
        <th scope="row" colspan="2" align="center"><input type="submit" value="Submit" /></th>
      </tr>
    </table>
    </cfform>
    </table>
    Page 2
    <form name="form1" method="post" action="handler.cfm?page=update_3">
    <cfoutput><input type="hidden" name="pcount" value="#FORM.pcount#"></cfoutput>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
              <td colspan="6" align="left">Record count (Doses/Units)= <cfoutput>#FORM.pcount#</cfoutput></td>
        </tr>
        <tr>
            <td>Product ID</td>
            <td>Vendor</td>
            <td>Order No.</td>
            <td>Lot No.</td>
            <td>Expiration Date</td>
            <td>Num. of Boxes</td>
        </tr>
        <cfset Peoplecount = 0>
        <cfloop index="Add" from="1" to="#form.pcount#" step="1">
            <tr>
                <cfset Peoplecount = PeopleCount + 1>
                <td><input  <cfoutput> value="#FORM.sProductID#" </cfoutput> name="sProductID_<cfoutput>#Peoplecount#</cfoutput>" type="text" id="sProductID_"></td>
                <td><input <cfoutput>value="#FORM.sVendor#"</cfoutput> name="sVendor_<cfoutput>#Peoplecount#</cfoutput>" type="text" id="sVendor_"></td>
                <td><input  <cfoutput> value="#FORM.sOrder_No#" </cfoutput> name="sOrder_No_<cfoutput>#Peoplecount#</cfoutput>" type="text" id="sOrder_No_"></td>
                <td><input <cfoutput>value="#FORM.sLot#"</cfoutput> name="sLot_<cfoutput>#Peoplecount#</cfoutput>" type="text" id="sLot_"></td>
                <td><input  <cfoutput> value="#DateFormat(FORM.dtExpire, 'MM/DD/YY')#" </cfoutput> name="dtExpire_<cfoutput>#Peoplecount#</cfoutput>" type="text" id="dtExpire_"></td>
                <td><input <cfoutput>value="#FORM.iBoxes#"</cfoutput> name="iBoxes_<cfoutput>#Peoplecount#</cfoutput>" type="text" id="iBoxes_"></td>
            </tr>
        </cfloop>
        <tr>
            <td> </td>
            <td>
                <input type="submit" name="Submit" value="Submit">
                <input name="HowMany" type="hidden" id="HowMany" value="<cfoutput>#Form.pcount#</cfoutput>">
            </td>
        </tr>
    </table>
    </form>
    </table>
    Page 3
    <cfquery name="qGetOnHand" datasource="#variables.DSNCI#">
    SELECT        *
    FROM        Products
    WHERE        sProductID = '#session.sProductID#'
    </cfquery>
    <cfquery datasource="#variables.DSNCI#">
    UPDATE        Products
    SET            iOnHandQty = (#FORM.pcount# + #qGetOnHand.iOnHandQty#)
    WHERE        sProductID = '#session.sProductID#'
    </cfquery>           
    <cfset quantity = #FORM.pcount#>
    <cfset Pcount = 0>
    <!-- Start Loop -->
    <cfloop index="Add" from="1" to="#form.howmany#" step="1">
        <cfset Pcount = Pcount + 1>
        <cfset Product = "Form.sProductID_#Pcount#">
        <cfset Product = Evaluate(Product)>
        <cfset Vendor = "Form.sVendor_#Pcount#">
        <cfset Vendor = Evaluate(Vendor)>
        <cfset Order  = "Form.sOrder_No_#Pcount#">
        <cfset Order = Evaluate(Order)>
        <cfset Lot = "Form.sLot_#Pcount#">
        <cfset Lot = Evaluate(Lot)>
        <cfset Expires = "Form.dtExpire_#Pcount#">
        <cfset Expires = Evaluate(Expires)>
        <cfset Boxes = "Form.iBoxes_#Pcount#">
        <cfset Boxes = Evaluate(Boxes)>
        <cfquery datasource="#variables.DSNCI#" name="InsertData">
            Insert into Received_History (sProductID, sVendor, sOrder_No, sLot, dtExpire, iBoxes, dtReceived)
            values ('#Product#', '#Vendor#', '#Order#', '#Lot#', <cfif Expires IS "">NULL<cfelse>#CreateOdbcDate(Expires)#</cfif>, #Boxes#, #CreateOdbcDate(Now())#)
        </cfquery>
    </cfloop>

    Rasi wrote:show your complete default.pa (also make sure that you dont override pulse settings in ~/.config/pulse) this setting should allow sound for ANY user - i just tried it and it works
    also: of course you restarted pulseaudio?
    I restarted pulseaudio and my computer.
    My default.pa is displayed in the first post.
    My files in /etc/pulse:
    > ls -la /etc/pulse
    total 28
    drwxr-xr-x 1 root root 116 May 16 10:22 .
    drwxr-xr-x 1 root root 3740 May 16 10:47 ..
    -rw-r--r-- 1 root root 1269 Mar 3 21:31 client.conf
    -rw-r--r-- 1 root root 2348 Oct 8 2013 daemon.conf
    -rw-r--r-- 1 root root 5756 May 16 10:24 default.pa
    -rw-r--r-- 1 root root 5718 Oct 8 2013 default.pa.pacnew
    -rw-r--r-- 1 root root 2112 Oct 8 2013 system.pa
    -la
    My files in ~/.config/pulse:
    > ls -la ~/.config/pulse
    total 1048
    drwx------ 1 homeuser homeuser 660 Sep 12 2013 .
    drwx------ 1 homeuser homeuser 1054 Apr 24 14:06 ..
    -rw-r--r-- 1 homeuser homeuser 40960 Oct 17 2013 1a8726d55f9140ae9d95dc512eacea67-card-database.tdb
    -rw-r--r-- 1 homeuser homeuser 43 May 16 10:37 1a8726d55f9140ae9d95dc512eacea67-default-sink
    -rw-r--r-- 1 homeuser homeuser 42 May 16 10:37 1a8726d55f9140ae9d95dc512eacea67-default-source
    -rw-r--r-- 1 homeuser homeuser 12288 May 16 10:49 1a8726d55f9140ae9d95dc512eacea67-device-volumes.tdb
    lrwxrwxrwx 1 homeuser homeuser 23 Sep 12 2013 1a8726d55f9140ae9d95dc512eacea67-runtime -> /tmp/pulse-cDmMRoO9oFBz
    -rw-r--r-- 1 homeuser homeuser 12288 May 15 22:43 1a8726d55f9140ae9d95dc512eacea67-stream-volumes.tdb
    -rw------- 1 homeuser homeuser 256 Jun 15 2013 cookie
    -rw-r--r-- 1 homeuser homeuser 331776 Jun 21 2013 equalizer-presets.tdb
    -rw-r--r-- 1 homeuser homeuser 659456 Sep 20 2013 equalizer-state.tdb
    Thanks for your efforts.

  • SQLite Multiple rows insert

    Hi,
    I know this question has been asked and there was an answer:
    http://stackoverflow.com/questions/1609637/is-it-possible-to-insert-multiple-rows-at-a-tim e-in-an-sqlite-database
    But now things has changed, from version 3.7.11 SQLite does work normally with multiple insert:
    http://stackoverflow.com/questions/1609637/is-it-possible-to-insert-multiple-rows-at-a-tim e-in-an-sqlite-database
    http://www.sqlite.org/lang_insert.html
    Now the problem is that I use SQLite Expert to perform a multiple row insert with normal sql method:
    INSERT INTO table (col1, col2) VALUES
          ('row1col1', 'row1col2'), ('row2col1', 'row2col2'), ...
    And this works. However when I try to use this insert within Flash Builder it gives me an error - syntax error near ",".
    Is there a way I can check or update SQLite within Flex so I could use multiple row insert?
    Thanks in advance for answers:)

    Unlike in php (values(product1),(product2),(product3))
    you cannot insert records like that in a sqlite db.
    What i did is the following
    public function insertMonthRecords():void
    var sqlText:String = &quot;INSERT INTO month( monthname)
    &quot; +
    &quot;VALUES('Januari')&quot;;
    insertStatement = new SQLStatement();
    insertStatement.sqlConnection = conn;
    insertStatement.addEventListener(SQLEvent.RESULT,
    insertResult);
    insertStatement.addEventListener(SQLErrorEvent.ERROR,
    errorHandler);
    insertStatement.text = sqlText;
    insertStatement.execute();
    insertStatement.text = &quot;INSERT INTO month(monthname)
    VALUES('Februari')&quot;;
    insertStatement.execute();
    insertStatement.text = &quot;INSERT INTO month(monthname)
    VALUES('March')&quot;;
    insertStatement.execute();
    insertStatement.text = &quot;INSERT INTO month(monthname)
    VALUES('April')&quot;;
    insertStatement.execute();
    And so on.. To bad i didn't found a solution to execute all
    the inserts at once. Inserting this way takes time :-(
    If you have a better solution, just let me know.
    Greetz, Jacob

  • Multiple rows insert and update form example

    I just want to share with you an example of a multiple rows insert and update form. You can access it HERE (http://tryapexnow.com/apex/f?p=12090:21)
    You will find on the same page the complete description of all elements used to buid it.
    I'm waiting for opinions, suggestions, and questions here in this thread.
    Thanks

    Hello Valentin,
    I got an error message when I clicked on the weblink. Here is the message
    Error ERR-7620 Could not determine workspace for application. Could you please take a look at this.
    Thanks,
    Karol

  • Multiple rows insertion - need help

    Hello all,
    I need to insert multiple rows in a table with a single query and the number of rows is 269470.
    There are 3 columns in the table. One of the columns is determined by another sub query which returns multilple(269470) rows and the other 2 columns remain same for all.
    I came up with the following query but need a loop to make it run multiple time(269470 times).
    insert into EMLUSRRECV
    (user_id, storeent_id, receiveml)
    values
    ((select user_id from users where user_id not in (select distinct user_id from EMLUSRRECV) and CURR = 'USD' and rownum = 1), 11154, 1);
    Thanks in advance.
    Edited by: 924585 on Feb 20, 2013 7:19 PM

    924585 wrote:
    Hello all,
    I need to insert multiple rows in a table with a single query and the number of rows is 269470.
    There are 3 columns in the table. One of the columns is determined by another sub query which returns multilple(269470) rows and the other 2 columns remain same for all.
    I came up with the following query but need a loop to make it run multiple time(269470 times).
    insert into EMLUSRRECV
    (user_id, storeent_id, receiveml)
    values
    ((select user_id from users where user_id not in (select distinct user_id from EMLUSRRECV) and CURR = 'USD' and rownum = 1), 11154, 1);
    Thanks in advance.
    Edited by: 924585 on Feb 20, 2013 7:19 PMwhy not just:
    insert into emlusrrecv
    select user_id, 11154, 1
      from  users
    where user_id not in (select user_id from EMLUSRRECV)
    and CURR = 'USD' and rownum = 1)

  • Multiple row insertion

    Hello Team....
    i have two view one is read only view & other is updatable view.....i want to take the data(Multiple row) from read only view & want to insert in to updatable view.
    How can i do this....?

    Hi Charu,
    Try this:
    1- in the property of the Read only table ( represent read only view ) make this
    - Row Selection -----------> Multiple
    - In Behivior clear SelectionListener
    - In Advanced clear SelectedRowKeys
    - In Advanced Binding make a bind to the table in backing bean
    In Backing Bean:
    RowKeySet rowSet1 = getYourTable().getSelectedRowKeys();
    Iterator rowSetIter = rowSet1.iterator();
    BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
    DCIteratorBinding voIter =
    (DCIteratorBinding)bindings.get("ReadOnlyViewObjectIterator");
    while (rowSetIter.hasNext()) {
    List l = (List)rowSetIter.next();
    Key key = (Key)l.get(0);
    voIter.setCurrentRowWithKey(key.toStringFormat(true));
    Row r = voIter.getCurrentRow();
    ApplicationModule am=voIter.getViewObject().getApplicationModule();
    ViewObject vo = am.findViewObject("UpdatableViewObject");
    Row vr=vo.createRow();
    vr.setAttribute("attributeName1",r.getAttribute("attributeName1");
    vr.setAttribute("attributeName2",r.getAttribute("attributeName2");
    vr.setAttribute("attributeName3",r.getAttribute("attributeName3");
    vo.insertRow(vr);
    I hope this work
    Sameh Nassar

  • Multiple row insert with jsp

    Please i need help on how to enter multiple row into mysql with one insert
    statement and jsp , i have been trying this for weeks without sucess e.g
    <---- THIS AN EXAMPLE OF MY INSERT FORM ---->
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    <body>
    <form id="form1" name="form1" method="post" action="some sort of jsp page">
    mike : <input type="text" name="staffid" />
    john : <input type="text" name="staffid" />
    peter :<input type="text" name="staffid" />
    james :<input type="text" name="staffid" />
    jerry :<input type="text" name="staffid" />
    mikel: <input type="text" name="staffid" />
    <input name="submit" type="button" />
    </form>
    </body>
    </html>
    <--MY DATABASE LOOKS LIKE --->
    name | staffid |
    | |
    | |
    | |
    I have been looking for a way to enter only the value or all the values that is entered by
    the user.

    ODAFEONIHOWO wrote:
    Please i need help on how to enter multiple row into mysql with one insert
    statement and jsp it's not possible - you'll need to do a batch insert
    i have been trying this for weeks without sucess e.g how much experience do you have with Java?

  • Handling error with multiple row insert/update

    Hi,
    I need to insert multiple rows into a table, and I understand that i need to use executeArrayUpdate().
    My problem is this :
    1. How do I know in case some of the rows in the array failed during the INSERT?
    2. When I do know that, how do I find those particular rows?
    Thanks

    ODAFEONIHOWO wrote:
    Please i need help on how to enter multiple row into mysql with one insert
    statement and jsp it's not possible - you'll need to do a batch insert
    i have been trying this for weeks without sucess e.g how much experience do you have with Java?

  • Multiple row insert "How To".

    I need a "How To" to add multiple rows to a table based on various input values.
    On my page I have the following:
    In the report section:
    select htmldb_item.hidden(1,null) circuit_id,
    htmldb_item.text(2,null) datacomm_id,
    htmldb_item.text(3,null) lan_equip_id,
    htmldb_item.text(4,null) circuit,
    htmldb_item.text(6,null) segment,
    htmldb_item.text(7,null) subnet,
    htmldb_item.text(8,null) lan_equip_model_id,
    htmldb_item.text(12,null) jack,
    htmldb_item.text(13,null) jpairs,
    htmldb_item.text(14,null) risers,
    htmldb_item.text(15,null) building,
    htmldb_item.text(16,null) uplink_lan_equip,
    htmldb_item.text(17,null) uplink_group,
    htmldb_item.text(21,null) comments,
    htmldb_item.text(22,null) vlan
    from neteng_circuits
    In the page processing processes section:
    -- insert circuits
    for i in 1..htmldb_application.g_f01.count
    loop
    insert into neteng_circuits
    (datacomm_id,
    lan_equip_id,
    circuit,
    topology,
    segment,
    subnet,
    lan_equip_model_id,
    lan_equip_ip,
    group1,
    port,
    jack,
    jpairs,
    risers,
    building,
    uplink_lan_equip,
    uplink_group,
    uplink_port,
    initials,
    date_modified,
    comments,
    vlan)
    values
    (htmldb_application.g_f02(i),
    htmldb_application.g_f03(i),
    htmldb_application.g_f04(i),
    :P41_TOPOLOGY,
    htmldb_application.g_f06(i),
    htmldb_application.g_f07(i),
    htmldb_application.g_f08(i),
    :P41_LAN_EQUIP_IP,
    :P41_GROUP1,
    :P41_PORT,
    htmldb_application.g_f12(i),
    htmldb_application.g_f13(i),
    htmldb_application.g_f14(i),
    htmldb_application.g_f15(i),
    htmldb_application.g_f16(i),
    htmldb_application.g_f17(i),
    :P41_UPLINK_PORT,
    :P41_INITIALS,
    :P41_DATE_MODIFIED,
    htmldb_application.g_f21(i),
    htmldb_application.g_f22(i));
    end loop;
    In the items section (with appropriate setup):
    5: P41_TOPOLOGY Select List
    9: P41_LAN_EQUIP_IP Text Field
    10: P41_GROUP1 Text Field
    11: P41_PORT Text Field
    18: P41_UPLINK_PORT Text Field
    19: P41_INITIALS Select List
    20: P41_DATE_MODIFIED Date Picker (DD-MON-RR)
    Ultimately the only fields which differ for the 48 new circuits
    which I wish to insert are:
    circuit_id (based on a trigger), jack, jpair (based on a select list),
    and port (values are 1-48, could be 1-16 under some circumstances).
    The uplink fields depend on the uplink_port value and there are similar
    relationships for other fields - I need to get them using select statements
    dynamically behind the scenes.
    Please help me to create this scenario.
    Thank you for all your help. Trudy.

    Does she want to insert 48 rows from the multi-row add delete check box report? If I understand that part correctly, then she needs to create an add button that adds another empty row into the table. Then she needs to populate the row with data; she would have to do this 48 times. From a form or a report I doubt that there is any other way to do it. When you do the update, the database gets updated by your sql insert statement that is in the update process you create. The update gets an event notification by an update button that you have created by clicking the Create a button displayed among the region's items when you created the button. The view also gets rendered with the same sql code. Refer to the example in the links that I gave you;
    your other question seems to revolve around sql.
    add the condition where x > =1 and y <= 48 into your sql conditions with an
    if condition. there are plenty of references for sql through a search on google;
    Let me know how things go.
    I have gotten my update to work with the workaround. The delete works with the following code:
    for i in 1..htmldb_application.g_f01.count
    loop
    delete from patient_info where primary_key_Column = htmldb_application.g_f02(htmldb_application.g_f01(i));
    end loop;
    I also have the sample add and insert(update) working. but I need to get the add the row dynamically to work in my real world data.
    Veena

  • Multiple row insertion into rm_text_lines from "free format select text"?

    We use the Repository Object Navigator (RON) to define views through the "free format select text" ("Select text" and "Where/Validation condition" fields).
    Before the upgrade/migration to 9i (repository and clients), multi-line definitions inserted in these text fields with older Designer clients were saved in multiple rm_text_lines rows and have remained this way after the upgrade/migration.
    With the 9i Designer clients, the multi-line definition (separated by "Enter" key) are now inserted as only one row.
    Is there any (easy) way in Designer 9i client to "force" the insertion of multiple rows into rm_text_lines when an "Enter" (chr(13)+chr(10)) is encountered?

    Can you give a use case? Are you using some Repository API scripts that expect that rm_text_lines are no longer than a single line, that are now failing when the text is actually fairly long? Are you printing and want to make sure that line breaks occur where the user put them?
    I ask because there really isn't a way to force Designer to break long text into multiple rm_text_line rows. Therefore, you are going to have to change your API scripts and reports to take the possible long lines into account.

  • PHP Multiple Row Insert

    I've created a Database schema that will allow the admin to
    easily update thier form. To do this I am using the data from the
    DB to dynamically create the form. For example, if the admin wants
    to add a new input to the form, they can do that by giving it a
    name and a type, such as text or radio.
    I've written code that displays the form based on the data.
    I'm stuck on getting the results from the form inserted back to the
    DB. Hopefully I can explain this well enough without having to post
    all the details.
    I have one table that is the responses from the form. Each
    row contains 5 columns that represent the request, the question,
    the option chosen, any details from the option chosen (text from a
    text field) and a customer id.
    I need to do an insert that will create a new row for the
    user's response to each question. I'm having some difficulty
    creating this mutiple row insert. Here is what I have so far, I'm
    using a mix of a DW insert with my own code. I'm hoping it's just a
    syntax issue...but it could be more. Thanks in advance.

    I didn't really explain the result. Nothing is inserted into
    the DB and everything that appeared on the page before adding the
    insert now no longer appears.

  • Apex - Multiple Row Insert

    Hi Experts,
    I have created a application called shop floor @ http://apex.oracle.com/pls/apex/f?p=4550:1:0::::F4550_P1_COMPANY:SHOPFLOOR.
    Work sapce : shopfloor
    username :: [email protected]
    pass : apex123
    Application url : http://apex.oracle.com/pls/apex/f?p=74245:LOGIN_DESKTOP:17263636802909
    username : [email protected]
    passowrd : apex123
    I have create a trigger to capture username and insert date into the username and inser date field.
    This is the functionality I want on this form.
    When I click submit
    1) it should insert all the 8 rows into the database table .
    2)After submit, old rows should be gone from form and new 8 rows to be created in the form with 8 fixed values in the field names and target, actual, username and inserdate , comments should be blank so that new informatiion can be inout by users on next day.
    Please guide me how to achive this.
    Appreciate ur help
    Thanks
    Venkat
    The thing is

    You should donwnload one of the sample applications here and install it in your workspace. There you can see how these things are done. That is realy basic.
    http://www.oracle.com/technetwork/developer-tools/apex/application-express/packaged-apps-090453.html
    Sample Master Detail or
    Sample Tabular Form
    Usually, the triggers are taking care of inserting the audit information (creation date and user, change date and user).
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.apress.com/9781430235125
    http://apex.oracle.com/pls/apex/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------

  • Multiple row insertions having a multiple item form

    Hello everyone
    A director at the company i work has asked for an application to help users request cleaning products for each of the buildings in the premises.
    Consider there are 2 main tables:
    - table request_cab, having the following columns:
    - ID
    - year
    - request_number
    - request_date
    - obs
    - user_id (references table users)
    - dept_id (references table departments)
    - deliverydate
    - deliveryplace_name
    - warehouse_id (references table warehouses)
    - table request_lin, having:
    - ID
    - cab_id (references request_cab)
    - year
    - quantity
    - product_id (references table product)
    - productmeasure_id (references table measures)
    As seen, table request_lin keeps the product details of the user's request while request_cab keeps the info regarding the request itself and who has made it.
    The director wants only one form displaying all the 35 cleaning products available for request at the same time, having the users to insert the quantity of the corresponding product to request. She doesn't want the user to select the products to be requested so select-boxes won't do.
    The problem i have is that the only way i know how to work with APEX is that each field on the form represents a single and different column in the table and what i need is to consider each field a single row to be inserted - this means, at worst, i have 35 lines to insert.
    I believe it can't be done so i ask for your expert's knowledge to help me answer this question: Can this be done in APEX?
    I thank in advance ALL the help you can give me!
    Best regards
    allp

    Hi
    Thank you for your reply.
    I've been trying the tabular form option but i don't think it'll do because the idea is to have all items at the same form, displayed like a list. I've noticed 2 things:
    - With tabular form, you have to insert each product by itself... And, even if i have an auxiliary table with all the id and product names that have to be displayed on the form, i can't integrate it at the table to which the tabular form will insert the records (in this case, table request_lin)...
    - with manual tabular form, i have to list all the content of the request_lin table, which i don't want... I just need a template showing all products and textboxes to enter quantities...
    Best regards
    allp

  • Database engine independent INSERT of multiple rows

    In our product we try to support multiple database engines while using as much standard SQL statements as possible. Our database has around 50 tables and our queries are generally pretty straightforward.
    Our initial database was MySQL, but now we successfully run the product on Apache Derby and we are also trying to support Oracle 10g Release 1.
    MySQL has a feature of multiple row inserts inside a single INSERT statement.
    INSERT INTO mytable(col1, col2, col3) VALUES
    (val11, val12, val13),
    (val21, val22, val23);
    On MySQL the multiple row insert is much more efficient than splitting it into separate inserts. I found something similar available in Oracle since release 9i:
    INSERT ALL
    INTO mytable(col1, col2, col3) VALUES
    (val11, val12, val13)
    INTO mytable(col1, col2, col3) VALUES
    (val21, val22, val23)
    SELECT 1 FROM DUAL;
    Of course this is far from portable. Does anyone know a portable solution to multiple row inserts?
    Fixed invalid Oracle multiple row insert.
    Message was edited by:
    user536129

    > That syntax isn't supported only by MySQL, but also by Derby and
    most probably DB2 (but I didn't check that one yet).
    That syntax contravenes a fundamental rule of sharable SQL - it has a variable/repeating set of commands for multiple values.
    It honestly does not make any sense for a RDBMS to support this syntax. Unless said RDBMS has head-up-backside when it comes having to hard parse every single SQL statement and not bothering with a shared SQL pool.
    In Oracle, the feature that achieves this abortion-syntax-of-mySQL is called BULK PROCESSING.
    You pass an INSERT statement to Oracle. It is parsed (soft when it already resides in the shared pool). You then execute it by providing Oracle with an array of values to insert.
    In PL/SQL this is done using the FORALL statement.
    Implying that Oracle should support the mySQL/Derby/DB2 syntax is just plain silly. Oracle scales up. Not down.

Maybe you are looking for

  • How to transfer images & videos from inbox to pc

    Hello everyone  I need your help how to tarnsfer videos and images from inbox to my computer I can send them one by one but recently I send abuot 200 images and videos  and I don't think I can send them one by one and when I mark them I can't find th

  • Exception of buffer overflow.

    Hi There, I have a code to read the text file in jsp, the problem i am facing is of buffer overflow as the text file contains more than 2000 records and when i upload data to database it throws exception of buffer overflow, any help will be appriciat

  • F4 help on a field on selection-screen called using call selectionn-screen

    Hi, I am calling a selection-screen at runtime using call selection-screen 123. Now in this selection screen I am taking a parameter thead-tdid as a parameter. Could anyone tell me how to get the f4 help for this parameter. Please lemme know.. Thanks

  • Open png file

    Using Labview with Measurement & Automation (MAX) software I am able to grab a 10bit image using a IMAQ 1409 board and save the image as a PNG file. How can I re-open this file for viewing using a NI or third pary viewer. PhotoShop or Activiewer do n

  • Liquidity forecast Downpayment For Sales order

    Hi gurus, When i post down payment for sales order with special indicator "a" system does not decrease sales order amount at liquidity forecast(FF7B). Is it a system bug or are down payments does not considered for sales orders like purchase orders?