Insert multiple record Oracle forms 6i

Hi all

I have a single column of field Field1, button, in the form TEXT_ITEM1.

After giving the sales order number in Field1, when should press us the button, the items (item_code) shown in the TEXT_ITEM1.

I went through the discussion Insert several Oracle forms 6i, 9i/10 g recordbut did not exactly how to write the loop button when button pressed.

first_record;
<<record_loop>>
loop
  insert into ....
  exit when :system.last_record = 'TRUE';
  next_record;
end loop record_loop;

My request for the loop is.

Select RI_ITEM_CODE from OT_REQ_ITEM

Where REQ_NO =: field1;

Please suggest

Thanks in advance.

Kind regards

Afzal.

Forgive me if I am oversimplifying this, but why not just base your block of data to the table: XXTABLE.  Then, you just put your form in design query (F7). Enter the value of 1122 in the area of the INVOICE_NUM and selects Execute Query (F8).  Then forms does all the work to extract and display the records without having to write code to do this.  This saves you having to write the code to perform and DML as well because the forms will take care of the Insert, Update and Delete automatically when your users click on save or press F10 (if I remember correctly).

If you must absolutely query and display your data manually, then you cannot use the standard SELECT INTO method because it will only show 1 record.  You need to loop through your recordset and to manually edit the records in your block after you assign a value to the line.  For example:


 /* Sample Button Code */
DECLARE
  v_invoice_num NUMBER := BLOCK.TEXT1;

  CURSOR Get_Items (p_invoice NUMBER) IS
  SELECT INVOICE_NUM, ITEM_CODE
  FROM XXTABLE
  WHERE invoice_num = p_invoice;
 BEGIN
  GO_BLOCK('BLOCK');
  CLEAR_BLOCK(NO_VALIDATE);

  FOR rec in Get_Items(v_invoice_num) LOOP
  :BLOCK.INVOICE_NUM := rec.invoice_num;
  :BLOCK.ITEM_CODE := rec.item_code;
  Next_Record;
  END LOOP;
 END:

I really don't like this method, but it could work.

Craig...

Tags: Oracle Development

Similar Questions

  • Insert multiple record Oracle forms 6i/9i / 10g

    Hello

    How can I insert multiple record using a tabular view as an oracle.

    what I use for loop?

    can someone help me? I have kindda stuck in this problem...


    Scenario:
    I have 5 display of last_name text_item and I put 4 names on it...

    If I use Insert, it only get the 4th name I drove...

    question:
    How can I put them all together?

    I build the block manually.

    Not a very good idea, I think, but if you really want to do it this way, you will need to loop through the records:

    first_record;
    <>
    loop
       insert into ....
       exit when :system.last_record = 'TRUE';
       next_record;
    end loop record_loop;
    
  • Insert multiple records in a form with checkboxes

    Hello

    I need to insert multiple records in a database of a form using Coldfusion and am stuck - it works correctly when inserting one record at a time. Basically, the user will choose their name of the employee (EmployeeID) in a dynamic list, then several session (open) numbers that represent classes of training.

    When I try and select several check boxes, I get this error:
    "The number of query values and destination fields is not the same."

    The boxes of the open field are not dynamic, as you can see-how use CFLOOP or any other method to allow several checkboxes be selected, and all open documents is entered into the database on a form?

    I used server behaviors Dreamweaver 8 to create the form - which is limiting I know but I'm not a coder. I hope I can add code here to do things correctly function.



    ----APPLICATION CODE------------------------------------------------------------------

    <!-get employee names->
    < cfquery name = "rsDisplayEmployee" datasource = "FormationRH" >
    SELECT *.
    OF tblEmployees
    ORDER BY LastName ASC < / cfquery >
    <!-->-->
    <! - insert Records - >
    < cfset CurrentPage = GetFileFromPath (GetTemplatePath ()) >
    < cfif IsDefined "(FORM. MM_InsertRecord") AND the FORM. MM_InsertRecord EQ 'form1' >
    < cfquery datasource = "FormationRH" >
    INSERT INTO tblEnrollments (open, EmployeeID)
    VALUES)
    < cfif IsDefined "(FORM. Open") AND #FORM. Open # NEQ "" > "".
    #FORM. Open #.
    < cfelse >
    NULL VALUE
    < / cfif >
    ,
    < cfif IsDefined "(FORM. EmployeeID") AND #FORM. EmployeeID # NEQ "" > "".
    #FORM. EmployeeID #.
    < cfelse >
    NULL VALUE
    < / cfif >
    ) < / cfquery >
    < cflocation url = "2.cfm" >
    < / cfif >
    <!-->-->

    --------FORM CODE-----------------------------------------------------------------------

    < form action = "" < cfoutput > #CurrentPage # < / cfoutput > "id = 'form' name ="form"method ="POST">"
    < table width = "100%" border = "0" cellspacing = "0" cellpadding = "4" >
    < b >
    < td width = "100%" > < h2 > < strong > select an employee name < facilities > < / h2 > < table >
    < /tr >
    < b >
    < td > < select name = "EmployeeID" >
    < cfoutput query = "rsDisplayEmployee" >
    < option value = "#rsDisplayEmployee.EmployeeID #" > #rsDisplayEmployee.LastName #, #rsDisplayEmployee.FirstName # < / option >
    < / cfoutput >
    < / select > < table >
    < /tr >
    < /table >
    < h2 > < strong > select training class < facilities > < / h2 >
    < table width = "600" border = "0" cellspacing = "0" cellpadding = "0" >
    < b >
    < td width = "227" valign = "top" > class < table >
    < td width = "373" valign = "top" > < input name = "Open" type = "checkbox" value = "937" / >
    Date < table >
    < /tr >
    < b >
    < td valign = "top" > class < table >
    < td valign = "top" > < label >
    < input name = "Open" type = "checkbox" value = "936" / >
    < / label >
    Date < table >
    < /tr >
    < /table >
    < br / >
    < input type = "submit" name = "Submit" value = 'Sign Up!' / >
    < input type = "hidden" name = "MM_InsertRecord" value = "form" >
    < / make >

    "Add a line" I want to say that, for each of the checkboxes selected in your form, the code will be to insert a new record in the database table. Sorry I probably didn't phrase it very well.

    so, no, the code does not need to wrap around each element. Instead the code examines the form.fieldnames variable (form.fieldnames, which is a list separated by commas of all fields defined in the form, is automatically submitted to each form submission - you don't have to define yourself somehow) and for each selected checkbox will insert a new record in your table with the check box selected and selected value the value of the id of the employee.

  • Insert multiple records in a database using the DB adapter and stored procedure

    Hi all

    I want to insert multiple records in a database using a stored procedure. I wanted to insert these records using a data adapter and data adapter must be called by a mediator.

    Can anyone suggest me some ideas if it's possible with capabtilities OOB in SOA suite or not?

    Thank you for your help in advance.

    Thank you
    Shiv

    The trick is in the stored procedure. You must use a data type that will handle multiple records I use varray. An example can be found in this post.

    Re: Mutiple calls to AppsAdapter (pl/sql) when the payload has multiple records

    When you read the procedure stored in the db adapter wizard looks and xsd / xml if you have maps accordingly.

    see you soon
    James

  • Insert multiple records in a query from a loop

    Hello

    Im am seriously struggling with something here...


    PROBLEM:
    I want to insert multiple records of checkbox in my db...
    A simple insert statement inserts the 1 record...

    How can I insert all records?

    For example: 10 family names must be inserted at the same time...

    Check my code...


    PLEEEASE, im really craving for help!

    Thank you. Worked perfectly!

  • Calendar - insert multiple records by account number/length of

    Hello

    I would write a process allowing to insert multiple rows in a table. I think it should be a LOOP statement, but I don't know how in the APEX.

    I got a simple form with the following page:

    P2_Calendar_ID-> hidden field, populated by standard processes to Get PK to generate IDS again for the insert statement

    P2_Name-> text field

    P2_Date-> Date picker field

    P2_Duration-> numeric field

    The user name (P2_Name), choose a date (P2_Date) and type in a number (P2_Duration) and send the form. Here, I need the above mentioned process of pl/sql.

    I think that first of all it must be created a loop to generate the Dates of the picked a (P2_Date) and increment the date by the number (P2_Duration), and store dates in the variable. Then there should be another loop to insert the number of records in a table, so it has inserted the same number of rows depending on the number in P2_Duration and with the dates increment according to the P2_Duration.

    Name of the CALENDAR table after columns:

    Calendar_ID-> number)

    Name-> varchar2

    Date-> Date

    Example of what the user will fill in the form above:

    P2_Name-> Vladimir

    P2_Date-> may 9, 2014

    P2_Duration-> 3

    It must be created the following lines in a table CALENDAR:

    Date name Calendar_ID

    1 Vladimir may 9, 2014

    2 Vladimir 10 may 2014

    3 Vladimir may 11, 2014

    Of course the Calendar_ID is generated by the standard Get PK process, which might need to be included in the loop... I think so.

    Thank you for your help.

    Best regards

    Vladimir

    PS: I use the APEX Version: Application Express 4.2.5.00.08

    Hi Vladimir,.

    Simply create a process on submit more info here: 8.5 Page understanding the process , with your touch as a trigger and add the code in this document, similar to the below I would say: and you can just get rid of the hidden element calendar_id

    Thank you

    DECLARE

    DATE OF T_DATE;

    BEGIN

    FOR DATEINC IN 0.TO_NUMBER(:P2_DURATION) - 1 LOOP

    T_DATE: = TO_DATE(:P2_DATE,'DD-MON-YYYY') + DATEINC;

    INSERT INTO CALENDAR (CALENDAR_ID, NAME, DATE) VALUES (CAL_ID_SEQ.nextval,: P2_NAME, T_DATE);

    END loop;

    END;

  • Display empty records oracle forms 11g

    Treat all the...

    I use oracle 11g forms, I've created a form using the data block Wizard & Wizard formatting, but when I run the form, the form running successfully in the browser, url is ( Forms / http://arun-pc:9001 / frmservlet), but it is showing empty records.

    When I check with sql more user Scott, I found 10 records in the table departments, same user and same table I used in oracle forms.

    I don't know what the problem... I am new to oracle forms please help...

    I'm waiting for your answer valuable 4r

    S thanks in advance...

    Dear

    You can write the following code

    Execute_Query;

    in your trigger a TIME NEW FORM INSTANCE of your form.

    This will run the query automatically when your form loads.

    Concerning

    Oracle-911

  • Insert multiple records in the single form

    Hi all

    I met already insert many rows into a table using ADF BC. The solution is in the following thread

    Re: How to create several new lines in the Table of the ADF?

    However,.
    The above solution is useful when you want to enter new values as well as all the table entries is displayed.
    What can I do if I don't want all values in the table, but just a page 'AddEntries' where I can only add new lines without going through the table entries is displayed.

    As,

    Say a form has 5 rows

    Each line has empId, eMailSlNo, send attributes

    EmpId is the same for all 5 recordings but emailId is different.

    EmpId eMailSlNo plus the PK.

    empId generated by the sequence.

    Now, on presentation of the form, I want all five records to be inserted.

    (can I use ADF form instead of the table of the ADF for the ViewObject in this case. I tried ADF form but I could only insert 1 plug at the same time).

    I use 10.1.3.4

    Help, please.

    Thanks in advance,
    Shri

    Published by: newtoOTN on December 29, 2009 18:02

    Shri salvation,

    ADF form is intended for the single insert/update. For multiple insert/update/delete using the collection as table UI is preferred. I guess your db table or table design INTERFACE default (in my opinion but I do not know your usecase entirely, so I guess might b wrong).

    I would say,

    -make EmpId as PK
    -have another table to store EmpId (foreign key), emailSiNo, email
    -Having the relationship of the master / detail between the British Colombia ADF db tables.
    -Create master / detail UI and on the selection of the master, view the details and if no record is found does not add files and commit.

    See these examples:
    http://www.Oracle.com/technology/products/jdev/tips/Mills/MasterDetailSync/Master_Detail_Synchronization_in_ADF_Faces.html
    http://andrejusb.blogspot.com/2007/06/create-edit-and-delete-operations-in.html

    Hope it makes sense.

    ~ K

  • to insert multiple records in another table

    Hi all;

    How can I increase the number of records in the table?

    SQL > insert into tab2 to select * From tab1;

    Enter tab2 to select * From tab1

    *

    ERROR on line 1:

    ORA-00926: lack of keyword VALUES

    Hi try this...

    Insert in tab2 select * from tab1

  • Order insertion of records using forms

    Hello

    (forms6i)

    I datablock, without querying the database records, I enter some values and try to save.
    In case if one of the input files already exists in the database, I should stop the insertion and the cursor must be on the document that repeats.

    I tried on_insert trigger as
    declare
         alno number;
         cnt number;
    begin
         
    select count(fname||','||lname) into cnt
    from teacher_dup where 
    fname||','||lname =:fname||','||:lname;
    
    if cnt >0 then
         set_alert_property('alert1',alert_message_text,'The record already exists in the database');
         alno := show_alert('alert1');
         rollback;
         raise form_trigger_failure;
    else 
         INSERT_RECORD;
    --     :fname:=null;:lname:=null;:tid:=null;
         
    end if;
    
    end;
    Work of Jose, but shows the error message like
    ROLLBACK_NR-INSERT Trigger small FRM-40737 illegal procedure.

    What I do is correct?

    Also if a 3-disc set, user tries to insert
    The only record is violating primary key constraints, then I don't want to save documents in the table.
    But the above procedure saves the other records, except the one that violates.

    How can I control that?

    Thank you

    Adkins,

    Try the code in the trigger PRE_INSERT ON_INSERT trigger INSTEAD of below.

    declare
         alno number;
         cnt number;
    begin
    
    select count(fname||','||lname) into cnt
    from teacher_dup where
    fname||','||lname =:fname||','||:lname;
    
    if cnt >0 then
         set_alert_property('alert1',alert_message_text,'The record already exists in the database');
         alno := show_alert('alert1');
         raise form_trigger_failure;
    end if;
    
    end;
    

    I hope this helps.

    Kind regards

    Manu.

  • Inserting multiple records of a QofQ?

    I do (yet!) an application for the parents to sign up for more information of the school of their child and giving them the opportunity to choose more than one year by using the checkboxes. I am of the grading as a string, then their analysis in different grades available and then query the db to see if subscription E-mail/school/grade already existing. If there is not, I would like to add to the db. Using CFDUMP, I've verfied that I extract the correct records for Add.

    I have appended to the query that selects records to add, then on my current INSERT query (choking on "INSERT") - I tried to put in square brackets the CFWACK INSERTION, but that no longer works. The error is "query of queries syntax error; INSERT met ".

    I have it!

    I had to change the allocation in the dbtype cfquery query to datasource = schoolnotices = INSERT.

    THANK YOU all for your advice. I learn loads and getting better with smaller on the way more problems as big as that. :)

  • When inserting duplicate records

    Hello

    I have a problem when I try to record a new record that I have just inserted.

    Oracle Forms is to Save all the records in the block, including the old discs (which are exist in the block and the DB).

    According to responses in the forum, the reason is that I use the cursor to fill my data frame. but I need to use the slider since I get 2 tables and I handle on anther column which is not dependent on the DB column.

    what trigger I use, I have more important - that the code I have to write in it?

    Thanks in advance,

    Elad


    Hi Xem, karim and O.Developer

    Ultimately, the solution comes down to a single line in the cursor...

    Just before the 'next record' we write this function:

    SET_RECORD_PROPERTY (my_cursor % ROWCOUNT, MY_DATA_BLOCK, STATUS, QUERY_STATUS);

    There affect the status of 'QUERY_STATUS' to each record that extract DB (initially, a times-news-block-instance), and like that, when we commit to insert - these records nor considered to be 'new '...

    Note: the "sur-insert" trigger do not need.

    Elad

  • Insert multiple rows in a database

    Hello
    I worked on a project that takes a JMS queue xml document and inserts the data into db. But the problem here is that there may be any number of data sets. I use EPCO for my work, but no matter what I do, the data is not simply inserted. Could you any body please help me? Here is an example of the message that I'm trying to insert as the XSD for the JCA and entry documents.

    XSD for JMS Message:

    <? XML version = "1.0" encoding = "windows-1252"? >
    < xsd: Schema container = "http://www.w3.org/2001/XMLSchema".
    xmlns = "http://www.example.org".
    targetNamespace = "http://www.example.org".
    elementFormDefault = "qualified" >
    < xsd: element name = "canonical" >
    < xsd: complexType >
    < xsd: SEQUENCE >
    < xsd: element name = "order" >
    < xsd: complexType >
    < xsd: SEQUENCE >
    < xsd: element name = "data" maxOccurs = "unbounded" >
    < xsd: complexType >
    < xsd: SEQUENCE >
    < xsd: element name = "rowCode" type = "xsd: String" / >
    < xsd: element name = "productNumber" type = "xsd: String" / >
    < xsd: element name = "attributeType" type = "xsd: String" / >
    < xsd: element name = "attributeCode" type = "xsd: String" / >
    < xsd: element name = "transactionType" type = "xsd: String" / >
    < xsd: element name = "timestamp" type = "xsd: DateTime" / >
    < / xsd: SEQUENCE >
    < / xsd: complexType >
    < / xsd: element >
    < / xsd: SEQUENCE >
    < / xsd: complexType >
    < / xsd: element >
    < / xsd: Schema >


    JCA XSD:

    <? XML version = "1.0" encoding = "UTF - 8"? >
    < xs: Schema targetNamespace = "http://xmlns.oracle.com/pcbpel/adapter/db/top/InsertData" xmlns = "http://xmlns.oracle.com/pcbpel/adapter/db/top/InsertData" elementFormDefault = "qualified" attributeFormDefault = "qualified" xmlns: XS = "http://www.w3.org/2001/XMLSchema" >
    < xs: element name = "OrderDataCollection" type = "OrderDataCollection" / >
    < name XS: complexType = "OrderDataCollection" >
    < xs: SEQUENCE >
    < xs: element name = "OrderData" type = "OrderData" minOccurs = "0" maxOccurs = "unbounded" / >
    < / xs: SEQUENCE >
    < / xs: complexType >
    < name XS: complexType 'OrderData' = >
    < xs: SEQUENCE >
    < xs: element name = "prodnum" type = "xs: Decimal" / >
    < xs: element name = 'attrtype"minOccurs ="0"nillable ="true">
    < xs:simpleType >
    < xs:restriction base = "XS: String" >
    < xs:maxLength value = "20" / >
    < / xs:restriction >
    < / xs:simpleType >
    < / xs: element >
    < xs: element name = "attrcode" minOccurs = "0" nillable = "true" >
    < xs:simpleType >
    < xs:restriction base = "XS: String" >
    < xs:maxLength value = "10" / >
    < / xs:restriction >
    < / xs:simpleType >
    < / xs: element >
    < xs: element name = "transtype" minOccurs = "0" nillable = "true" >
    < xs:simpleType >
    < xs:restriction base = "XS: String" >
    < xs:maxLength value = "1" / >
    < / xs:restriction >
    < / xs:simpleType >
    < / xs: element >
    < xs: element name = "ordertime" type = "xs: DateTime" minOccurs = "0" nillable = "true" / >
    < / xs: SEQUENCE >
    < / xs: complexType >
    < / xs: Schema >

    Input samples:

    <? XML version = "1.0" encoding = "windows-1252"? >
    < ProductData >
    < header >
    < rowCode >: < / rowCode >
    < interfaceCode > H6D9J7 < / interfaceCode >
    < createdOn >
    < date >
    < year > 2011 < / year >
    < month > 05 < / month >
    < day > 23 < / day >
    < / date >
    < time >
    < time > 02 < / time >
    < minute > 05 < / minute >
    < seconds > 11 < / seconds >
    < / time >
    < / createdOn >
    < description > Front Shop of the attributes of FMS to JDA PMM < / description >
    < / header >
    < body >
    < data >
    < rowCode > D < / rowCode >
    < other > 0004567 < / productNumber >
    < attributeType > MIMI < / attributeType >
    < attributeCode > CCCCCCCjjj < / attributeCode >
    < transactionType > A < / transactionType >
    < timestamp >
    < date >
    < year > 2011 < / year >
    < month > 02 < / month >
    < day > 19 < / day >
    < / date >
    < time >
    < time > 02 < / time >
    < minute > 05 < / minute >
    < seconds > 11 < / seconds >
    < / time >
    < / timestamp >
    < / data >
    < data >
    < rowCode > D < / rowCode >
    < other > 0004567 < / productNumber >
    < attributeType > TTTTTT2 < / attributeType >
    < attributeCode > CCCCCCjjj2 < / attributeCode >
    < transactionType > A < / transactionType >
    < timestamp >
    < date >
    < year > 2011 < / year >
    < month > 02 < / month >
    < day > 19 < / day >
    < / date >
    < time >
    < time > 02 < / time >
    < minute > 05 < / minute >
    < seconds > 11 < / seconds >
    < / time >
    < / timestamp >
    < / data >
    < / body >
    <>footer
    < rowCode > Z < / rowCode >
    < interfaceCode > H6D9J7 < / interfaceCode >
    < numberOfRows > 000000000002 < / numberOfRows >
    < / footer >
    < / ProductData >

    I will be really grateful if someone can help me. Thank you.

    Check below link it may help you

    How to insert multiple records using the single DB adapter

    Thank you
    AJ

  • How to put the form into insert mode without clicking a button insert new record

    Hi all

    I use apex 4.2 on windows, internet Explorer 10 on oracle 11g R2, all 64 bits.

    I'm creating mobile applications.

    I have a list page, I put the links on this page.

    one of the links is a form of opening and passing some values that form.

    the form I open with custome plsql trigger to generate the primary key.

    I do not include an Insert button in the form, I call you, I want to just the user to type something in the column remarks of the newly opened form.

    and when the user clicks the Save button, the folder must be inserted as a new record in the table of underscore.

    now, the pk is not because I do not press on the Insert button, since I do not include the Insert button.

    now when I navigate my list Page by clicking on the point list and in the newly open shape, I enter some data in the Notes field and click on the button, save

    It is not saving the table or give any error?

    How to solve this problem?

    Kind regards.

    Mahjoor,

    If your form is wizard generated then

    Change your suite save button and put

    and confirm that regardless of the Page item Insert Source values contains more

    If you manually insert values shaped then write a Page process to insert this page elements values in the table

    during the click on the button Save.

    I hope this helps you.

    Leave.

  • Selection multiple-oracle forms 6

    The power of groups Record - Oracle Developer forms Techniques

    as Figure 2.7. Selection of several departments.

    Which can provide type Demo.FMB me?


    thx.......................

    Take a look at this URL: forms: how to select multiple records in a block by using the folder groups. This demo was written in Oracle Forms 10 g, but when I created the original REC_GROUP package I was using Forms 6i and this demo does not work in Forms 6i.  You will not be able to use the included CRAIG.pll so just to create the REC_GROUP package in your form instead.

    I hope this helps.

    Craig...

Maybe you are looking for