Master-Detail Multi-Row Insert

Im still using Oracle forms 6i. How do we create here in ADF for the transaction in master-detail operation specially in inserting multi-row in detail. In forms we can use key-next item trigger next_record for new record transaction for drugs or we can use bar code scanning to insert new records & automatically go to next records waiting for another input...
pls help me i want to upgrade & pls sorry for my english...
just want this adf behave like forms in terms of master-detail transaction entry...
i appreciate if someone can help me or give me demo file to download & play with it...
Edited by: user8983555 on Nov 10, 2010 10:30 AM

tnx for the fast reply..
im new with jdeveloper and no knowledge in java or html. im concentrated in pl/sql , forms 6i.We still using this until now in character base in unix environment but some module in gui mode.im working in hospital which is complete informations sytem (stock,pharm..etc...gl...) which in bulk transactions specially patients outclinic & inpatients charges.now we have also this reservations system for out clinics thats the reason im like to develop for in a web that a patient can reserve on line and i dont like running our application in different front end (forms 6i &jdeveloper).
(now currently checking form10g & just set up AS10g which is working.can deploy and connect,LAN). but im very interested in ADF when i see the demo on Oracle website.
now our company pplanning to change our application to power builder whiich is not good in performance regarding in hadling big databases (slow query,needs burst AS...) thru to the demonstration of the
apllication vendors.
im very glad if you can help. can you post a links or demo file to do this as you said....(You can replicate the code in the button in some other event on your page, for example when the value of the last field in the row is changed.
It all comes down to the question of when you actually want to create a new row, and in that event you call the createInsert method.)
this is my only problem now to make this master-detail multi-row insert like ora form.
again sorry for my english...

Similar Messages

  • Multi-row insert in master-detail tables

    Hi, I'm using jdev 10.1.3.2 with jheadstart and my problem is:
    I hava a master-detail structure, both are tables and my goal is that I want multi insert (exactly 3) in master and detail table when user makes new order(some business scenario). I cannot create rows in master or detail VO by overriding create() method because its entities have complex primary keys and some part of this key is populated by the user with lov. So I set in jhs new rows to 3 and checked multi-row insert allowed but the problem is that overall I can only create rows in master table after I submit form. I want to create row in master table and fill rows in detail table, and after that I want to have opportunity to create second (or even third) row in master table and fill rows in detail table.
    thanks for help.
    Piotr

    See JHS DevGuide: 3.2.1. Review Database Design:
    If you are in the position to create or modify the database design, make sure all
    tables have a non-updateable primary key, preferably consisting of only one
    column. If you have updateable and/or composite primary keys, introduce a
    surrogate primary key by adding an ID column that is automatically populated.
    See section 3.2.4 Generating Primary Key Values for more info. Although ADF
    Business Components can handle composite and updateable primary keys, this
    will cause problems in ADF Faces pages. For example, an ADF Faces table
    manages its rows using the key of the underlying row. If this key changes,
    unexpected behavior can occur in your ADF Faces page. In addition, if you want
    to provide a drop down list on a lookup tables to populate a foreign key, the
    foreign key can only consists of one column, which in turn means the referenced
    table must have a single primary key column.
    Groeten,
    HJH

  • Issues in Table with Multi-Row Insert

    I have created a master detail screens using jheadstart on 2 separate pages, Master in the Form layout and detail in the Table Layout with multi-row insert, update and delete flags ON. Have set the New Rows count = 2.
    Issue 1
    If I try to delete any existing rows, it gives error for new rows saying value is required for the mandatory fields. It should just ignore the new rows if I have not updated any values for any attributes in the those row(As it does for non Master-Detail Table layout). I guess this might be happening because the jheadstart code is setting the foreign key for new rows the detail, but not resetting the status of the rows back to INITIALIZED.
    I also noticed that the create() of underlying EO is getting called for those blank rows when I click on 'Save' button, even if I have not changed any data in those rows.
    Issue 2
    When I try to select the new rows also for deletion, I am getting a '500 Internal Server Error' with following stack trace... This is also happening for normal (non Master-Detail) Table layout.
    java.lang.IllegalStateException: AdfFacesContext was already released or had never been attached.     at oracle.adf.view.faces.context.AdfFacesContext.release(AdfFacesContext.java:342)     at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl.doFilter(AdfFacesFilterImpl.java:253)     at oracle.adf.view.faces.webapp.AdfFacesFilter.doFilter(AdfFacesFilter.java:87)
    Issue 3
    I have put some validation code in the validate() method in the MyEntityImpl.java class.
    The validate method seems tobe getting called lots of times, in my case 20 times, where the new rows are just 2.
    Environment:
    Jdeveloper 10.1.3, JHeadStart 10.1.3 build 78, Windows XP
    thanks

    Thanks for the reply.
    Issue 1:
    What I have observed that in case of multi-row select enabled tables, the blank rows do not have any data. This is because the EO's create() method is called only when we post the data using 'Save' button. Thus the Foreign Keys are also not setup. This is a correct behavior since create() and FK setups etc should get done only if the user has inputted any value in the new rows and thus intend to insert new data into the table.
    I am able to find the exact cause of this issue. It is happening because in the details table, I have a column which needs tobe shown as checkbox. Since we can only bind checkbox to an Boolean attribute in VO, I have created a transient attribute of type Boolean, which basically calls the getter/setter of actual attribute doing the String "Y"/"N" to true/false conversion. Here is code for the transient attribute getter/setter
    public Boolean getDisplayOnWebBoolean() {
    return "Y".equals(getDisplayOnWeb()) ? Boolean.TRUE : Boolean.FALSE;
    public void setDisplayOnWebBoolean(Boolean value) {
    if(Boolean.TRUE.equals(value))
    setDisplayOnWeb("Y");
    else
    setDisplayOnWeb("N");
    Now when I click on the "Save" button, the setter for the boolean field is getting called with the value = false and this is resulting into the row being maked as dirty and thus the validation for the required attributes is getting executed and failing.
    Issue 2:
    Confirmed that correct filter-mapping entries are present in the web.xml.
    Now when I select the new blank rows for deletion and click save, following exception is thrown:
    java.lang.ClassCastException: oracle.jheadstart.controller.jsf.bean.NewTableRowBean at oracle.jheadstart.controller.jsf.bean.JhsCollectionModel.getRowsToRemove(JhsCollectionModel.java:412) at oracle.jheadstart.controller.jsf.bean.JhsCollectionModel.doModelUpdate(JhsCollectionModel.java:604) at oracle.jheadstart.controller.jsf.lifecycle.JhsPageLifecycle.processModelUpdaters(JhsPageLifecycle.java:541) at oracle.jheadstart.controller.jsf.lifecycle.JhsPageLifecycle.validateModelUpdates(JhsPageLifecycle.java:571)
    thanks - rutwik

  • Sqlite multi-row insert

    In php & mysql I am used to being able to do multi row inserts into a table using;
    INSERT INTO table (column1,column2) VALUES (val1,val2),(val3,val4)
    Is there any Sqlite equivalent? I need to populate around 100 rows on first run of a mobile application.
    Thanks,
    Pete

    If what _spoboyle recommends doesn't work in AIR and if you haven't already, look into the SQLConnection.begin() and commit().  It seems at least you can group your SQL transactions.

  • Multi Row Insert

    I have read a few posts that mention a multi-row-insert but I can't find it.
    There is a multi row update and a multi row delete.
    I am using html db 1.6. We will be upgrading after we get this version of our app up and running, but don't want to take time out for the upgrade right now.
    Is multi_row_insert new to Application Express 2.0?
    Thanks,
    Gregory

    No, the multi row insert is not new to 2.0
    The builtin MRU processes handle multi-row updates and multi-row inserts. However, the default Add Rows process that the wizard creates on a tabular form does create only 1 blank row when you click the Add Row button. To increase this, just open the Add Rows process page and change 1 to a different number.

  • Multi row insert with checkboxes and textfield

    i'm trying to build a multi row insert on tabular form.
    i have checkboxed to choose the rows which i want to insert.
    in this row i have to insert a value into the textfield.
    but when i'm looping my checkec checkoxes my prcedure always takes the first textfields in my report.
    what's going wrong?
    select apex_item.checkbox(30,ar_id, 'class="checkThis"') as ar_id
    ,apex_item.display_and_save(31,ar_nr) as ar_nr
    ,ar_name
    ,apex_item.text(32,null) as Menge
    from ar
    FOR i IN 1.. APEX_APPLICATION.G_F30.COUNT LOOP
    insert blabla (st_profil_id, ar_id,menge)
    values(:P5_st_profil_id,APEX_APPLICATION.G_F30(i),APEX_APPLICATION.G_F32(i));
    end loop;

    Hi,
    Please read the following
    http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21676/apex_app.htm#CHDGJBAB
    http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21676/apex_item.htm#CHDDCHAF , especially the Creating an On-Submit Process.
    Cheers,

  • Multi Row Inserts

    Is there any way of providing Multi Row Inserts in a single region.
    I am looking for a way to add several records at once in a table format, much like the multi row update functionalty.
    Is this possible?

    Can you use an OUTPUT clause? See examples
    MERGE INTO dbo.Customers AS TGT
    USING dbo.CustomersStage AS SRC
      ON TGT.custid = SRC.custid
    WHEN MATCHED THEN
      UPDATE SET
        TGT.companyname = SRC.companyname,
        TGT.phone = SRC.phone,
        TGT.address = SRC.address
    WHEN NOT MATCHED THEN 
      INSERT (custid, companyname, phone, address)
      VALUES (SRC.custid, SRC.companyname, SRC.phone, SRC.address)
    WHEN NOT MATCHED BY SOURCE THEN
      DELETE
    OUTPUT 
      $action AS the_action, deleted.custid AS del_custid, inserted.custid AS ins_custid;
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Use master-detail as both insert-edit mode

    Guys,
    I am again in need for your expert suggestions....(I am using Jdev 11.1.1.3 and really new to adf world)
    I need to implement a scenario where user will click the menu item and system should open a detail page in insert mode.
    I have a page fragment for headers.... which has menu bars.... and one the of item in the menu bar is "Create new Record"
    My application has master-detail page (master with multiple details). I would like (don't have to) to use the same master-detail for Insert and Edit
    More detail scenario: 1. User will click "Create new Record" menu item
    2. Load the master-detail page in insert mode
    3. when they save the record, page should turn to edit mode...
    any help is greatly appreciated......
    Edited by: raj-acha on Sep 2, 2010 9:22 AM

    I can use goMenuItem to open the master-detail page. Do you think any issue with this?
    Also, Can i use the master-detail page for both Insert and Edit? if so, please suggest me possible solution. (I have master-detail page and only opens in edit mode)
    -R

  • Master-Detail and Auto Insert Detail rows

    Apex 3.0
    I'm trying to do a Master-Detail form. I have it set to stay on the same page when I Create a new Master Record.
    Now, what I would like to do is auto insert data into the Detail Rows some predefined information and have it ready for the user to enter the rest of the information. I did this by creating a Page Process to trigger on the Add Row button for the Details region. The code I used is:
    begin
    insert into purch_insurance_type (Contract_ID, INSURANCE_TYPE) values(:P7_Contract_ID, 'General');
    insert into purch_insurance_type (Contract_ID, INSURANCE_TYPE) values(:P7_Contract_ID, 'Automobile');
    insert into purch_insurance_type (Contract_ID, INSURANCE_TYPE) values(:P7_Contract_ID, 'Excess');
    insert into purch_insurance_type (Contract_ID, INSURANCE_TYPE) values(:P7_Contract_ID, 'Workers Comp');
    insert into purch_insurance_type (Contract_ID, INSURANCE_TYPE) values(:P7_Contract_ID, 'Others (Builders Risk)');
    end;
    P7_Contract_ID is the PK on the Master table and I predefine the Insurance Type. The rest of the table the user is able to enter as needed.
    When I run it, the new rows show up but the Insurance Type is NULL and browsing from one record and back the new rows are gone. It seems like the PK for the Detail rows are not being filled. I have a Sequence Trigger set to fire on Update:
    CREATE OR REPLACE TRIGGER "BI_PURCH_INSURANCE_TYPE"
    before insert on "PURCH_INSURANCE_TYPE"
    for each row
    begin
    if :NEW."INSURANCE_TYPE_ID" is null then
    select "PURCH_INSURANCE_TYPE_SEQ".nextval into :NEW."INSURANCE_TYPE_ID" from dual;
    end if;
    end;
    ALTER TRIGGER "BI_PURCH_INSURANCE_TYPE" ENABLE
    What am I missing? Any ideas or suggestions?

    Hi All!
    I think there is no solution to this problem, only single selection is the solution.
    If any one has anyother solution plz let me know.
    Thanks and regards.
    Abbasi

  • Master-detail editing or inserting

    Hi,
    I'm very sorry because I don't write English well...
    I'm studying ADF and I want to know master-detail editing(inserting) method using ADF.
    I know master-detail view and deleting.
    I need one master row editing(inserting) and multi detail row editing(inserting) in the same page(.JSP file) and Form tag.
    For reference, I read and practice below URL.
    http://www.oracle.com/technology/products/jdev/tips/mills/JSP_Multi_Row_Edits.html
    Please help me..
    Have a nice day..
    Thank you...
    May..

    Have you looked at our Oracle JHeadstart offering? If you truly need multi-row editing, it extends the base ADF DataAction to easily generate pages that handle multi-row operations of all kinds.
    A complete tutorial is available here:
    http://www.oracle.com/technology/products/jdev/tips/muench/jhstutorial/index.html
    Otherwise, you'll need to indicate more about what's not working for you after you have read Duncan's tutorial you cite above.

  • Master detail form initial insert issue on details sub-region

    Hello,
    I created a master detail form with report which should do insertion on master and detail region/subregion.
    On insert mode I enter with data master and detail block, when I press "Create" button, insertion happens only on master block (order table) not and on detail block (order_item table).
    On EDIT mode it does insertions/updates on master and detail block without problems.
    Application Express 4.2.1.00.08
    Oracle Database 11g Express Edition Release 11.2.0.2.0
    I appreciate your help.
    Regards

    Something like this should do the work:
    CREATE OR REPLACE TRIGGER order_item_table_tr
       BEFORE INSERT
       ON order_item_table
       FOR EACH ROW
    BEGIN
       IF :NEW.order_id IS NULL
       THEN
          :NEW.order_id := v ('P1_ORDER_ID');
       END IF;
    END order_item_table_tr;
    /Make sure the Automatic Row Processing (DML) of the order table returns key into item > Return Key Into Item > P1_ORDER_ID (or however the primary key of the order table is named)
    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
    -------------------------------------------------------------------

  • Master Detail Multi Detail Form

    Hello,
    How can I create a master detail with more than one detail form.
    Do I need to link this in the viewlink or view object?
    Could someone provide some insight into this?
    Thanks
    Rgds

    I have a big issue.
    Let us consider : Item , SubItem relationship.
    Component : Item VO , SubItemVO , Item can have many subitem.
    1.Created ItemVO
    2.Create SubItemVO
    3.Create View Link based on ItemVo-ItemId that is FK in SubItem table.
    4.Created JSF page and Dragged ItemVO from Datacontrol to JSF Pagen as ADF ReadOnly Table.
    5.Expanded Item table structure in Structure window and open the detailstamp.
    6.Dragged SubItemVO in detailstamp as ADF ReadOnly table.
    Expected Result :
    1. ItemVO First Row
    1.SubItems belonging to ITEMVO First Row
    2.SubItems belonging to ITEMVO First Row
    2.ItemVO Second Row.
    1.SubItems belonging to ITEMVO Second Row
    Current Result :
    1. ItemVO First Row
    1.SubItems belonging to ITEMVO First Row
    2.SubItems belonging to ITEMVO First Row
    2.ItemVO Second Row.
    1.SubItems belonging to ITEMVO First Row
    2.SubItems belonging to ITEMVO First Row
    Description: Second ItemVO when expanded shows first ItemVO SUBITEMS.
    Thanks,

  • Multi row insert or Batch execute via OLE DB?

    Hi all,
    This is my first posting and thanks for answering my questions.
    I would like to know if there is a way to do multiple row insert to an oracle table via OLE DB or .NET technology. Currently, we are using the JDBC connection and that technology has a very handy method called: PrepareStatement which allows us to execute a batch of insert in one go.
    However, we have to switch to the OLE DB camp but I could not find the PrepareStatement equivalent method in OLE DB that allows me to execute a batch of command. My understanding is, in OLE DB, I can create a ADO.command object and assign it with an Insert Statement and then assign parameters which are the input values. However, it looks like I have to exeucte the command one at a time instead of adding them into a batch command like what PrepareStatement does.
    I am fairly new to OLE DB. Can you tell me if there is a way to execute a batch of insert command in a more efficient manner? Or is there a way in .NET or ODP.NET or ADO.NET? Either OLE DB or .NET route is good for us.
    Thanks for the input.
    Michael
    P.S. I am using Oracle 10g with OraOLEDB.Oracle as the OLE DB data provider

    Hi,
    See the site http://www.geocities.com/oledbpro/docs/examples/multiprocs.htm I think it is better to use parameterized insert/update statement to complete the work for the fastest speed.
    Yuancai (Charlie) Ye
    See 30 OLEDB samples
    Use of free SocketPro for creating super client and server applications
    www.udaparts.com

  • Multi-Row insert/update/delete not working via db-link

    App. Version: 2.0.0.00.49
    DB: Oracle 9i, not sure about the build
    Problem: Multirow Update/Insert/Delete doesn't work via db-link.
    Error received: ....ORA-1460: unimplemented or unreasonable conversion requested....
    Where: Tabular Form generated via Wizard
    Side note: It's working properly when local table(s) is/are used, it's not working via db-link or view.
    I've encountered this error with single update/insert/delete operations before, but was able to fix it via using temp-variables (v_xyz := :Px_xyz; as the proposed v('Px_xyz') was really slow with my scripts)...but with the automated DML-action I don't see a way to edit it accordingly.
    Workaround found:
    1a) Use local* collection on HTML-DB-Server, then write single row updates/deletes/inserts to the remote DB via DB-Link
    1b) Use local* table on HTML-DB-Server, then write single row updates/deletes/inserts to the remote DB via DB-Link
    * Local = on the same server that HTML-DB is running on...
    So,...to my questions:
    1. Can someone confirm that this is a "known feature" (aka bug)?
    2. Can someone tell me if this "known feature" has been eliminated in the newer version of HTML-DB/APEX (> 2.0.0.00.49)?
    Thanks.
    Ingo

    Hi,
    Do you have a small test case program that demonstrates this? A JDeveloper project showing what exactly is the problem when trying to use the BDB SQL JDBC driver to insert data into the BDB SQL database? What do you mean by "not working", do you get any errors, you do not get errors but you do not see the data in the database etc?
    What are the versions of Java, JDeveloper, ADF and BDB SQL you are using, and on what OS?
    Regards,
    Andrei

  • How can I do a multi-row insert based on a value in a field on my form?

    My Form contains these fields (for the purpose of inserting rows into my 'Ports' table)
    ..Number_of_Ports
    ..Device_Name
    ..Router_Name
    ..Router_Slot_Number
    ..Router_Port_Number
    ..Vlan_Number
    Based on the value entered for 'Number_of_Ports'
    I would like to insert 'X' number of rows into my 'Ports' Table
    with the values which are contained in:
    ..Device_Name
    ..Router_Name
    ..Router_Slot_Number
    ..Router_Port_Number
    ..Vlan_Number
    Can someone help me with this,
    Or should I post this on another forum?
    Thanks in advance- Gary

    Gary,
    You can accomplish this with a PL/SQL process using a FOR LOOP. For the following example, I am going to use fields that would have been generated for Page 1 of an application:
    Begin
    FOR i IN 1..:P1_NUMBER_OF_PORTS LOOP
    INSERT INTO tablename(port_number, device_name, router_name, router_slot_number_vlan_number)
    VALUES(i, :P1_DEVICE_NAME, :P1_ROUTER_NAME, :P1_ROUTER_SLOT_NUMBER, :P1_ROUTER_PORT_NUMBER, :P1_VLAN_NUMBER);
    End Loop;
    End;
    Hope this helps.
    Mike

Maybe you are looking for

  • Mailing more than one photo

    I would like to be able to email more than one photo at a time. That is if any developers are reading this thread.

  • 6 plus 128gb ordered on 9/22. Not even shipped yet.

    I am wondering why the ones who ordered later than me are getting their tracking number while I am not. I ordered 6 plus 128gb space gray on 9/22 and it is still being processed. No updates at all. I saw someone's post that his/her order was cancelle

  • Is it possible to create a personal Start project for sdtrpro?

    Is it possible that in a New project some Personal settings Be Inside from the beginning? I got a Standard Compressor and eq Setting for my Voice Over recordings. I want the vo Track in a specific color with the Track Name VO......etc Is it possible

  • I Wanted To Say Thanks

    Well... Despite my grumblings and concerns, Lightroom 1.1 has, for the short time that I have played with it, turned out to be a huge and very welcome improvement over 1.0, and for that I wanted to publicly say thank you. I am very impressed with wha

  • Size of Filestore

              Hi,           im using JMS on WL 6.1 for a durable topic on Solaris.           I have set up a Filestore for the "Paging Store".           Now I see that the Filesize of the Paging-Store-File           never shrinks again.           The mon