Inserting multiple rows into a table using a multiple-select list

I'm trying to figure out how to take the output of a multiple-select list (":" separated list of values) and use that to update a table by inserting multiple rows based on the values. Is there a straight-forward way to do that in APEX?
Thanks.
Chris

Hi Chris,
I think this should give you what you need: Working with a Multiple Select List Item
--Jennifer                                                                                                                                                                                                                                                                                                                                                                                                   

Similar Messages

  • Inserting multiples rows into a table using function or procedure..

    How do i insert multiples rows into a table using function or procedure?
    Please provide me query..

    Use FORALL bulk insert statement...
    eg:
    procedure generate_test_data as
    type cl_itab is table of integer index by pls_integer;
    v_cl_itab cl_itab;
    type cl_vtab is table of varchar2(25) index by pls_integer;
    v_cl_vtab cl_vtab;
    type cl_dtab is table of date index by pls_integer;
    v_cl_dtab cl_dtab;
    begin
    for i in 1.. 100 loop
              v_cl_itab(i):= dbms_random.value(1,1000);
              v_cl_vtab (i):=dbms_random.string('a',20);
              v_cl_dtab (i):=to_date(trunc(dbms_random.value(2453737, 2454101)),'j');          
         end loop;
         forall i in v_cl_itab.first .. v_cl_itab.last
              execute immediate 'insert into test_order values( :n, :str , :dt ) ' using v_cl_itab(i), v_cl_vtab (i), v_cl_dtab (i);          
         commit;
    end;

  • Inserting Multiple Rows into Database Table using JDBC Adapter - Efficiency

    I need to insert multiple rows into a database table using the JDBC adapter (receiver).
    I understand the traditional way of repeating the statement multiple times, each having its <access> element. However, I am just wondering whether this might be performance-inefficient, as it might insert records one by one.
    Is there a way to ensure that the records are inserted into the table as a block, rather than record-by-record?

    Hi Bhavesh/Kanwaljit,
    If we have multiple ACCESS tags then what happens is that the connection to the database is made only once. But the data is inserted row by row.
    Why i am saying this?
    If we add the following in JDBC Adapter..logSQLStatement = true. Then incase of multiple inserts we can see that there are multiple
    <i>Insert into tablename(EMP_NAME,EMP_ID) VALUES('J','1000')
    Insert into tablename(EMP_NAME,EMP_ID) VALUES('J','2000')</i>
    Doesnt this mean that rows are inserted one by one?
    Correct me if i am wrong.
    This does not mean that the transaction is not guaranted. Either all the rows will be inserted or rolled back.
    Regards,
    Sumit

  • Inserting multiple rows into a table (using sequences)

    Hi!
    I want to insert multiple rows into a db table, but I don't know how.
    I know how to insert 1 row using a sequence:
    I put all the fields in the jsp form's page and in the submit page I put something like this:
    <jbo:Row id="myRow" datasource="ds" action="Update" rowkeyparam="MyRowKey" >
    <jbo:SetAttribute dataitem="*" />
    </jbo:Row>
    But how can I insert multiple rows like this:
    Id          Name
    1          ana
    2          monteiro
    3          maria
    Thanks!

    Hi Chris,
    I think this should give you what you need: Working with a Multiple Select List Item
    --Jennifer                                                                                                                                                                                                                                                                                                                                                                                                   

  • Get Multiple Rows into internal Table using Webdynpro Alv Display ..

    Hi guys ,
    I need to find out the logic for getting all the selected rows into the internal table.
    When i display the ALV Output on webdypro screen .
    USer Selects multiple rows for further processing ..
    Ineed to get all the rows selected by user into an internal table .
    Please let me know how to achive this ...
    Thanks in advance for quick reply
    Regards
    Saurabh Goel

    Hi,
    You need to use the method GET_SELECTED of IF_WD_CONTEXT_NODE to get the rows selected. Also ccheck for the paramters of that method, this retruns the element set.
    This meets your requirement.
    Regards,
    Lekha.

  • Error inserting a row into a table with identity column using cfgrid on change

    I got an error on trying to insert a row into a table with identity column using cfgrid on change see below
    also i would like to use cfstoreproc instead of cfquery but which argument i need to pass and how to use it usually i use stored procedure
    update table (xxx,xxx,xxx)
    values (uu,uuu,uu)
         My component
    <!--- Edit a Media Type  --->
        <cffunction name="cfn_MediaType_Update" access="remote">
            <cfargument name="gridaction" type="string" required="yes">
            <cfargument name="gridrow" type="struct" required="yes">
            <cfargument name="gridchanged" type="struct" required="yes">
            <!--- Local variables --->
            <cfset var colname="">
            <cfset var value="">
            <!--- Process gridaction --->
            <cfswitch expression="#ARGUMENTS.gridaction#">
                <!--- Process updates --->
                <cfcase value="U">
                    <!--- Get column name and value --->
                    <cfset colname=StructKeyList(ARGUMENTS.gridchanged)>
                    <cfset value=ARGUMENTS.gridchanged[colname]>
                    <!--- Perform actual update --->
                    <cfquery datasource="#application.dsn#">
                    UPDATE SP.MediaType
                    SET #colname# = '#value#'
                    WHERE MediaTypeID = #ARGUMENTS.gridrow.MediaTypeID#
                    </cfquery>
                </cfcase>
                <!--- Process deletes --->
                <cfcase value="D">
                    <!--- Perform actual delete --->
                    <cfquery datasource="#application.dsn#">
                    update SP.MediaType
                    set Deleted=1
                    WHERE MediaTypeID = #ARGUMENTS.gridrow.MediaTypeID#
                    </cfquery>
                </cfcase>
                <cfcase value="I">
                    <!--- Get column name and value --->
                    <cfset colname=StructKeyList(ARGUMENTS.gridchanged)>
                    <cfset value=ARGUMENTS.gridchanged[colname]>
                    <!--- Perform actual update --->
                   <cfquery datasource="#application.dsn#">
                    insert into  SP.MediaType (#colname#)
                    Values ('#value#')              
                    </cfquery>
                </cfcase>
            </cfswitch>
        </cffunction>
    my table
    mediatype:
    mediatypeid primary key,identity
    mediatypename
    my code is
    <cfform method="post" name="GridExampleForm">
            <cfgrid format="html" name="grid_Tables2" pagesize="3"  selectmode="edit" width="800px" 
            delete="yes"
            insert="yes"
                  bind="cfc:sp3.testing.MediaType.cfn_MediaType_All
                                                                ({cfgridpage},{cfgridpagesize},{cfgridsortcolumn},{cfgridsortdirection})"
                  onchange="cfc:sp3.testing.MediaType.cfn_MediaType_Update({cfgridaction},
                                                {cfgridrow},
                                                {cfgridchanged})">
                <cfgridcolumn name="MediaTypeID" header="ID"  display="no"/>
                <cfgridcolumn name="MediaTypeName" header="Media Type" />
            </cfgrid>
    </cfform>
    on insert I get the following error message ajax logging error message
    http: Error invoking xxxxxxx/MediaType.cfc : Element '' is undefined in a CFML structure referenced as part of an expression.
    {"gridaction":"I","gridrow":{"MEDIATYPEID":"","MEDIATYPENAME":"uuuuuu","CFGRIDROWINDEX":4} ,"gridchanged":{}}
    Thanks

    Is this with the Travel database or another database?
    If it's another database then make sure your columns
    allow nulls. To check this in the Server Navigator, expand
    your DataSource down to the column.
    Select the column and view the Is Nullable property
    in the Property Sheet
    If still no luck, check out a tutorial, like Performing Inserts, ...
    http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/index.jsp
    John

  • Insert Multiple rows into the table from that table data

    Hi All,
    I have a requirement like to insert mulitple rows into the table from that table data only(I need to replicate the data).
    In this table primary key is composite primary key with all foreign keys.primary key also including the Date foreign key.I need to change that date at the of insertion.
    INSERT
    INTO myschema.Fact_page_performance
    time_sk ,
    batch_id ,
    delta_msec ,
    delta_user_msec,
    error_code_sk ,
    content_errs ,
    element_count ,
    page_bytes ,
    Available ,
    date_sk
    VALUES
    (SELECT time_sk ,
    batch_id ,
    delta_msec ,
    delta_user_msec,
    error_code_sk ,
    content_errs ,
    element_count ,
    page_bytes ,
    Available
    FROM myschema.FACT_PAGE_PERFORMANCE_BACKUP
    WHERE date_sk=20090509,20090510
    But it is giving the error like missing Expression.
    Could anyone please help to me.
    Thanks and Regards
    Swetha.

    You can have either VALUES or SELECT not both
    INSERT
    INTO myschema.Fact_page_performance
    time_sk ,
    batch_id ,
    delta_msec ,
    delta_user_msec,
    error_code_sk ,
    content_errs ,
    element_count ,
    page_bytes ,
    Available ,
    date_sk
    SELECT time_sk ,
    batch_id ,
    delta_msec ,
    delta_user_msec,
    error_code_sk ,
    content_errs ,
    element_count ,
    page_bytes ,
    Available
    FROM myschema.FACT_PAGE_PERFORMANCE_BACKUP
    WHERE date_sk=20090509,20090510;

  • Best practice for deleting multiple rows from a table , using creator

    Hi
    Thank you for reading my post.
    what is best practive for deleting multiple rows from a table using rowSet ?
    for example how i can execute something like
    delete from table1 where field1= ? and field2 =?
    Thank you

    Hi,
    Please go through the AppModel application which is available at: http://developers.sun.com/prodtech/javatools/jscreator/reference/codesamples/sampleapps.html
    The OnePage Table Based example shows exactly how to use deleting multiple rows from a datatable...
    Hope this helps.
    Thanks,
    RK.

  • Inserting Multiple Rows into a Table

    I am having problems insert multiple rows. I am using Table1.Row1.instanceManger.addInstance(1).
    I try adding another line using
    Table1.Row2.Cell2.value.#text= "TEST"
    and I get an error acessor is unknown. I assume this is an index issue. Can someone tell me if I am doing this wrong and discuss table indexes?

    The first thing I notice is that your variable, "num," isn't initialized in the FOR loop like I'm used to seeing.. The next thing I would try would be declaring my variables outside of the loop. Something like this maybe.
    String query = null;
    Statement stmt = null;
    int rowsUpdated = 0;
    for (int num = 0; num < 10; num++);     {
         query = "INSERT into apartment (apartmentID,blockID) VALUES ('"+num+"','"+aid+"')";
         stmt = con.createStatement();
         rowsUpdated += stmt.executeUpdate(query);
    }Let me know how it goes.
    -Aaron
    http://www.WeKnowErrors.com/ A free Wiki for error codes and computer problems.

  • Multiple Rows into a table

    Hello, I am trying to insert 10,000 duplicate rows into a table for testing purposes. What statements can I use to do this?
    Oracle 11gv2 on HP-UX

    Hi,
    You want all of the 10,000 new rows to be completely identical? Here's one way:
    INSERT INTO table_x (quantity, entry_date)
            SELECT           100,      SYSDATE
         FROM          dual
         CONNECT BY   LEVEL <= 10000
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables, and also post the results you want from that data.
    If you're asking about a DML statement, such as INSERT, the sample data will be the contents of the table(s) before the DML, and the results will be state of the changed table(s) when everything is finished. In this problem, it could be that the only table involved has no rows before the DML. In that case, post no INSERT statements, just the CREATE TABLE statement and the results. Simplify the problem. Pretend that you only want to INSERT maybe 5 rows; we'll find a solution that works equally well for 10,000 rows.
    Explain, using specific examples, how you get those results from that data.

  • Inserting an image into a table using the iPad?

    I am trying to make an evidence table in pages. I need to insert photographs into a table, next to the related statement. Is it possible to insert a photograph into the table on an iPad as I obviously don't have the 'command' button that others are using. If this is possible I want to be able to insert the picture as a predefined size?

    Hi,
    Yes, you can do this by using the Word Edit Cell VI under Report Generation>>Word Specific>>Word Tables in your block diagram functions pallette.  After creating a table, you can edit specific cells and send the file path of the image saved on your computer to that specific cell.  I put together an example that I've attached here as well to help you out with this.
    Regards,
    Austin S.
    National Instruments
    Academic Field Engineer
    Attachments:
    RGTWordImageInTable.vi ‏14 KB

  • Problem with inserting two BLOBs into a table using setBinaryStream

    DBMS 9.2.0.1.0, Oracle JDBC driver 10.1.0.2.0
    The following code insert in one INSERT two BLOBs
    into two columns using PreparedStatement.setBinaryStream(). When the size of the of at least one blob exceeds
    some limit (? 2k, 4k ?), the values are swapped and
    inserted into wrong columns.
    Please, is this a problem in JDBC driver?
    ====================================================
    import java.io.ByteArrayInputStream;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.PreparedStatement;
    import java.sql.SQLException;
    import java.sql.Statement;
    * Test - two BLOBs swapped problem.
    * If size of the blob is larger that some treshold, they are swapped in the database.
    public class BlobSwapTest {
    private static Connection getConnection() throws SQLException {
    try {
    Class.forName("oracle.jdbc.driver.OracleDriver");
    } catch (ClassNotFoundException cnfe) {
    throw new SQLException("ClassNotFoundException: " + cnfe.getMessage());
    return DriverManager.getConnection("jdbc:oracle:thin:@//HOST:1521/DB", "USER", "PSWD");
    private static void createTable() throws SQLException {
    Connection conn = getConnection();
    Statement stmt = null;
    try {
    stmt = conn.createStatement();
    try {
    stmt.execute("DROP TABLE BlobTest2");
    } catch (SQLException e) {
    System.err.println("Table BlobTest2 was not deleted: " + e.getMessage());
    stmt.execute(
    "CREATE TABLE BlobTest2 ("
    + " pk VARCHAR(512), "
    + " blob BLOB, "
    + " blobB BLOB, "
    + " PRIMARY KEY (pk)"
    + ")"
    } finally {
    try {
    if (stmt != null) stmt.close();
    } finally {
    conn.close();
    public static void main(String[] args) throws SQLException {
    createTable();
    Connection conn = getConnection();
    PreparedStatement pstmt = null;
    try {
    conn.setAutoCommit(false);
    pstmt = conn.prepareStatement("INSERT INTO BlobTest2 VALUES (?,?,?)");
    final int size = 5000; // change the value to 500 and the test is OK
    byte[] buf = new byte[size];
    byte[] buf2 = new byte[size];
    for (int i = 0; i < size; i++) {
    buf = 66;
    buf2 = 88;
    pstmt.setString(1, "PK value");
    pstmt.setBinaryStream(2, new ByteArrayInputStream(buf), size);
    pstmt.setBinaryStream(3, new ByteArrayInputStream(buf2), size);
    pstmt.executeUpdate();
    conn.commit();
    } finally {
    if (pstmt != null) pstmt.close();
    conn.close();
    ====================================================

    See my response in the JVM forum.

  • Inserting multiple rows into database table

    hi
    I have a simple jsp/html page like this:
    <h1>Enter Comments</h1>
       <select name = "g1">
            <option>10</option>
            <option>20</option>
            <option>30</option>
            <option>40</option>
            <option>50</option>
            <option>60</option>
            <option>70</option>
            <option>80</option>
            <option>90</option>
            <option>100</option>
        </select> <input name = "comment1" type = "text" size = "60"><p>
         <select name = "g1">
            <option>10</option>
            <option>20</option>
            <option>30</option>
            <option>40</option>
            <option>50</option>
            <option>60</option>
            <option>70</option>
            <option>80</option>
            <option>90</option>
            <option>100</option>
        </select> <input name = "comment1" type = "text" size = "60"><p>but when i say : String fruit=request.getParameter("g1");
    String fruit=request.getParameter("comment1");
    only one gets written into the table. How would I write them both into seperate rows of the table? e.g.
    g1 comment1
    g1 comment1
    thank you all,

    change the name of the second select and second text element.
    You're only getting one because they're named the same, so the second one is overwriting the values of the first.
    HTH.

  • What is the best practice for inserting (unique) rows into a table containing key columns constraint where source may contain duplicate (already existing) rows?

    My final data table contains a two key columns unique key constraint.  I insert data into this table from a daily capture table (which also contains the two columns that make up the key in the final data table but are not constrained
    (not unique) in the daily capture table).  I don't want to insert rows from daily capture which already exists in final data table (based on the two key columns).  Currently, what I do is to select * into a #temp table from the join
    of daily capture and final data tables on these two key columns.  Then I delete the rows in the daily capture table which match the #temp table.  Then I insert the remaining rows from daily capture into the final data table. 
    Would it be possible to simplify this process by using an Instead Of trigger in the final table and just insert directly from the daily capture table?  How would this look?
    What is the best practice for inserting unique (new) rows and ignoring duplicate rows (rows that already exist in both the daily capture and final data tables) in my particular operation?
    Rich P

    Please follow basic Netiquette and post the DDL we need to answer this. Follow industry and ANSI/ISO standards in your data. You should follow ISO-11179 rules for naming data elements. You should follow ISO-8601 rules for displaying temporal data. We need
    to know the data types, keys and constraints on the table. Avoid dialect in favor of ANSI/ISO Standard SQL. And you need to read and download the PDF for: 
    https://www.simple-talk.com/books/sql-books/119-sql-code-smells/
    >> My final data table contains a two key columns unique key constraint. [unh? one two-column key or two one column keys? Sure wish you posted DDL] I insert data into this table from a daily capture table (which also contains the two columns that make
    up the key in the final data table but are not constrained (not unique) in the daily capture table). <<
    Then the "capture table" is not a table at all! Remember the fist day of your RDBMS class? A table has to have a key.  You need to fix this error. What ETL tool do you use? 
    >> I don't want to insert rows from daily capture which already exists in final data table (based on the two key columns). <<
    MERGE statement; Google it. And do not use temp tables. 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • Displaying multiple  rows of  a table using smartforms

    hi,
    how to get multiple  rows on a  form from a  table using smartforms.I succeded in getting only the first row of the table on the main window of the page .In order to display more than one record on the page what i have to do.

    You have to use LOOPS / TEMPLATES to achieve this
    Here is a very good code sample for using Template,Table,Loop in smartforms with screen shot
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3c5d9ae3-0501-0010-0090-bdfb2d458985
    Please do not post multiple threads. Kindly close them rewarding point for helpful answers,
    extracting multiple records
    to display multiple records in smart form
    Re: extracting multiple records
    Kindly reward point and close the duplicates.
    Regards
    Kathirvel

Maybe you are looking for

  • Add date to new text file name and generic text in body

    Okay, I hope this is the right forum. To help manage and keep track of incoming assets/files and I created an Automator workflow with the following: "Get Selected Finder Items → Get Folder Contents → New Text File (w/Show this action when the workflo

  • HT4859 how do i get my apps back on my ipod

    we had to reset my daughters Ipod touch and if I go into the icloud on the device and then into manage storage for the device, I can see all of her games (and they all have 'on' next to them) but I cannot seem to figure out how to get them to re-down

  • [wscompile] error: invalid remote interface

    I have an interface I want to publish as a web service. This interface extends java.rmi.Remote and each of its methods throws a RemoteException. But when I run wscompile (via ant) against this interface in order to have the wsdl file generated it giv

  • Using JUnit to let user type into Swing components

    Our goal is to create a test suite in which the user, our customer, types into components in JFrames and experiments with these components. We wanted to enable him to play with a TestCase/JFrame until he closed the JFrame, and let AllTests do the nex

  • Unable to open PDF from IE web pages

    Windows 7, IE 11, Adobe Reader XI I have no problem opening same when using Chrome so there must be some setting that I've failed to find in IE. I've reinstalled AR several times and adjusted as many IE settings as I've found suggestions for in the f