HOW TO CREATE MULTIPLE RECORDS IN A NONE DATABASE BLOCK?

I have a Form where I have a none database block with unbound items. The block
has 10 records. In the when-new-block instance I run a query by which I would
like to fill up the block with data. The code fragment looks like the
following:
begin
declare
tmp_curr_rec_id number;
begin
-- a hibak kiolvasasa
for c_hibak in ( select h.*, h.rowid
from hibak h
where 1=1 -- WF - Ide kerul a szurofeltetel
order by bejelentes_datum asc
) loop
-- bemasoljuk az adatokat az unbound item-ekbe
:mc_adat.ub_azonosito := c_hibak.azonosito;
:mc_adat.ub_verzio_letrehozas_datum :=
c_hibak.verzio_letrehozas_datum;
:mc_adat.ub_bejelento := c_hibak.bejelento;
:mc_adat.ub_bejelentes_datum := c_hibak.bejelentes_datum;
:mc_adat.ub_wf_verzio_csomopont :=
c_hibak.wf_verzio_csomopont;
:mc_adat.ub_wf_utolso_esemeny_szoveg :=
c_hibak.wf_utolso_esemeny_szoveg;
:mc_adat.ub_hiba_leiras := c_hibak.hiba_leiras;
:mc_adat.ub_hiba_hely := c_hibak.hiba_hely;
:mc_adat.ub_rekord_jelleg := 'H';
:mc_adat.ub_rowid := c_hibak.rowid;
-- beallitjuk a rekordot-ot olyanra, mintha semmi nem valtozott
volna
-- nem szeretnenk a form bezaraskor mindenfele figyelmezteteseket
-- olvasni a kepernyon
tmp_curr_rec_id := get_block_property( :system.current_block,
current_record );
set_record_property( tmp_curr_rec_id, :system.current_block,
status, new_status );
create_record;
end loop;
end;
end;
The block's update allowed, insert allowed, delete allowed property is set to
true.
The result of the code above is that only the last record fetched shows up in
the block. The problem is - as I found out - is that aech record is fetched,
the values are copied to the block items, but the create_record built-in
command would not move the cursor to the next row.
Can some one please help me with this?
TIA,
Tamas Szecsy

The problem was with the following code segment:
tmp_curr_rec_id := get_block_property( :system.current_block, current_record );
set_record_property( tmp_curr_rec_id, :system.current_block, status, new_status );
After omitting these two lines, the code worked properly.
Thansk for all whoe replied.
Regards,
Tamas

Similar Messages

  • How to create multiple records using ADF

    Currently working on my first ADF BC and UIX project, and I basically want to create multiple records after a user makes a choice on the screen. I would like to know at what layer should this functionality be implemented?
    Would this be more at the Struts/Controller level, where I have a java class to perform the creation as part of a data action? I ask because, I am not sure if this is feasible at the ADF BC level (View objects and Entity Objects) via some sort of customization, and i am new to the different possibilies avail as part of the ADF framework
    Regards
    Anora
    (Jdeveloper 10.1.2.1 build 1913, Oracle DB 10.1.2)

    I'd put it into the application module. You then can call the method from the controller layer or from an other application module. This way you put it into the business logic, which helps if you ever decide to use a different client approach (like swing).

  • Can we create multiple records before navigation to that block

    Can we create multiple records and assign values in Forms, before navigation to that block (in a trigger ), and populate ?

    Hello,
    No you cannot. You need to be inside the block in order to use the Create_Record built-in.
    Francois

  • Multiple records in a non-DB block

    I have about 10 records in a non-DB block (B_main).
    I need to get all the records and insert them into a db table. How can I achieve this?
    Forms10 text fields inside Retek are appearing with a default 'Yellow' color. I tried setting them to grey....but they are
    still defaulting back to yellow when I run the form in the application. How can I change them to appear in grey?
    Thanks,
    Chiru

    I have about 10 records in a non-DB block (B_main).
    I need to get all the records and insert them into a db table. How can I achieve this?If you want to insert all the records into a DB-table, why do you use a non-DB-block for it? In that case you would have to do NO work, simply issue a COMMIT_FORM.
    With the non-DB-block you have to loop over the block like:
    FIRST_RECORD;
    LOOP
      INSERT INTO TAB (
        COL1,
        COLN
      ) VALUES (
        :BLOCK.COL1,
        :BLOCK.COLN
      EXIT WHEN :SYSTEM.LAST_RECORD='TRUE';
      NEXT_RECORD;
    END LOOP;But again, why not use a database-block?

  • SqlLoader: how to create multiple records out of one CSV input line?

    A question concerning the SQL-Loader.
    I need to load data from a CSV file where one of the CSV values determines how many records should be inserted.
    Example of the input data:
    KEYWORD;2;REC1_COL1_X,REC1_COL2_X;REC2_COL1_X;REC2_COL2_X
    KEYWORD;3;REC1_COL1_Y;REC1_COL2_Y,REC2_COL1_Y;REC2_COL2_Y;REC3_COL1_Y;REC3_COL2_Y
    KEYWORD;4;REC1_COL1_Z;REC1_COL2_Z,REC2_COL1_Z;REC2_COL2_Z;REC3_COL1_Z;REC3_COL2_Z,REC4_COL1_Z;REC4_COL2_Z
    If the KEYWORD is found, then the next value determines how many value pairs will follow, and therefore how many rows should be created in the affected DB table.
    As a result I hope to achieve this:
    SELECT Column1, Column2 FROM testTable
    REC1_COL1_X,REC1_COL2_X
    REC2_COL1_X;REC2_COL2_X
    REC1_COL1_Y;REC1_COL2_Y
    REC2_COL1_Y;REC2_COL2_Y
    REC3_COL1_Y;REC3_COL2_Y
    REC1_COL1_Z;REC1_COL2_Z
    REC2_COL1_Z;REC2_COL2_Z
    REC3_COL1_Z;REC3_COL2_Z
    REC4_COL1_Z;REC4_COL2_Z
    I learned how to import data using Oracle SQL loader for cases where one input line more or less matches a (new) row in a DB table. But how to handle this?

    Hello 784948.
    Assuming that the delimiter is a comma, and also assuming that the number of pairs is limited to four, you could use the following tested control fileLOAD DATA
    APPEND
    INTO TABLE testTable
    WHEN (1:7) = 'KEYWORD' AND (9) = '1'
    FIELDS TERMINATED BY ","
    TRAILING NULLCOLS
    ( KeywordColumn    FILLER
    , PairCountColumn  FILLER
    , InputColumn1
    , InputColumn2
    , FillerColumn1    FILLER
    , FillerColumn2    FILLER
    , FillerColumn3    FILLER
    , FillerColumn4    FILLER
    , FillerColumn5    FILLER
    , FillerColumn6    FILLER
    INTO TABLE testTable
    WHEN (1:7) = 'KEYWORD' AND (9) = '2'
    FIELDS TERMINATED BY ","
    TRAILING NULLCOLS
    ( KeywordColumn    FILLER  POSITION(1)
    , PairCountColumn  FILLER
    , InputColumn1
    , InputColumn2
    , FillerColumn1    FILLER
    , FillerColumn2    FILLER
    , FillerColumn3    FILLER
    , FillerColumn4    FILLER
    , FillerColumn5    FILLER
    , FillerColumn6    FILLER
    INTO TABLE testTable
    WHEN (1:7) = 'KEYWORD' AND (9) = '3'
    FIELDS TERMINATED BY ","
    TRAILING NULLCOLS
    ( KeywordColumn    FILLER  POSITION(1)
    , PairCountColumn  FILLER
    , InputColumn1
    , InputColumn2
    , FillerColumn1    FILLER
    , FillerColumn2    FILLER
    , FillerColumn3    FILLER
    , FillerColumn4    FILLER
    , FillerColumn5    FILLER
    , FillerColumn6    FILLER
    INTO TABLE testTable
    WHEN (1:7) = 'KEYWORD' AND (9) = '2'
    FIELDS TERMINATED BY ","
    TRAILING NULLCOLS
    ( KeywordColumn    FILLER  POSITION(1)
    , PairCountColumn  FILLER
    , FillerColumn1    FILLER
    , FillerColumn2    FILLER
    , InputColumn1
    , InputColumn2
    , FillerColumn3    FILLER
    , FillerColumn4    FILLER
    , FillerColumn5    FILLER
    , FillerColumn6    FILLER
    INTO TABLE testTable
    WHEN (1:7) = 'KEYWORD' AND (9) = '3'
    FIELDS TERMINATED BY ","
    TRAILING NULLCOLS
    ( KeywordColumn    FILLER  POSITION(1)
    , PairCountColumn  FILLER
    , FillerColumn1    FILLER
    , FillerColumn2    FILLER
    , InputColumn1
    , InputColumn2
    , FillerColumn3    FILLER
    , FillerColumn4    FILLER
    , FillerColumn5    FILLER
    , FillerColumn6    FILLER
    INTO TABLE testTable
    WHEN (1:7) = 'KEYWORD' AND (9) = '4'
    FIELDS TERMINATED BY ","
    TRAILING NULLCOLS
    ( KeywordColumn    FILLER  POSITION(1)
    , PairCountColumn  FILLER
    , FillerColumn1    FILLER
    , FillerColumn2    FILLER
    , InputColumn1
    , InputColumn2
    , FillerColumn3    FILLER
    , FillerColumn4    FILLER
    , FillerColumn5    FILLER
    , FillerColumn6    FILLER
    INTO TABLE testTable
    WHEN (1:7) = 'KEYWORD' AND (9) = '3'
    FIELDS TERMINATED BY ","
    TRAILING NULLCOLS
    ( KeywordColumn    FILLER  POSITION(1)
    , PairCountColumn  FILLER
    , FillerColumn1    FILLER
    , FillerColumn2    FILLER
    , FillerColumn3    FILLER
    , FillerColumn4    FILLER
    , InputColumn1
    , InputColumn2
    , FillerColumn5    FILLER
    , FillerColumn6    FILLER
    INTO TABLE testTable
    WHEN (1:7) = 'KEYWORD' AND (9) = '4'
    FIELDS TERMINATED BY ","
    TRAILING NULLCOLS
    ( KeywordColumn    FILLER  POSITION(1)
    , PairCountColumn  FILLER
    , FillerColumn1    FILLER
    , FillerColumn2    FILLER
    , FillerColumn3    FILLER
    , FillerColumn4    FILLER
    , InputColumn1
    , InputColumn2
    , FillerColumn5    FILLER
    , FillerColumn6    FILLER
    INTO TABLE testTable
    WHEN (1:7) = 'KEYWORD' AND (9) = '4'
    FIELDS TERMINATED BY ","
    TRAILING NULLCOLS
    ( KeywordColumn    FILLER  POSITION(1)
    , PairCountColumn  FILLER
    , FillerColumn1    FILLER
    , FillerColumn2    FILLER
    , FillerColumn3    FILLER
    , FillerColumn4    FILLER
    , FillerColumn5    FILLER
    , FillerColumn6    FILLER
    , InputColumn1
    , InputColumn2
    )Luke
    Please mark the answer as helpful or answered if it is so. If not, provide additional details.
    Always try to provide create table and insert table statements to help the forum members help you better.
    Edited by: Luke Mackey on Aug 5, 2010 1:23 PM (always better to test before posting)

  • How to get multiple records using fn-bea:execute-sql()

    Hi,
    I created Proxy service(ALSB3.0) to get records from DB table. I have used Xquery function(fn-bea:execute-sql()). Using simple SQL query I got single record, but my table having multiple records. Please suggest how to get multiple records using fn-bea:execute-sql() and how to assign them in ALSB variable.
    Regards,
    Nagaraju
    Edited by: user10373980 on Sep 29, 2008 6:11 AM

    Hi,
    Am facing the same issue stated above that I couldnt get all the records in the table that am querying in the Proxyservice.
    For example:
    fn-bea:execute-sql('EsbDataSource', 'student', 'select Name from StudentList' ) is the query that am using to fetch the records from the table called StudentList which contains more than one records like
    Id Name
    01 XXX
    02 YYY
    03 ZZZ
    I tried to assign the result of the above query in a variable and while trying to log the variable, I can see the below
    <student>
    <Name>XXX</Name>
    </student>
    I want to have all the records from my table in xml format but it's not coming up. I get the value only from the first row of my table.
    Please suggest.
    regards,
    Venkat

  • How to select multiple records from a TREE in the table

    HI,
    I have a tree structure which is in the table.When I open the node of the tree,all the subnodes are coming as one-one records in the table.I want to slect multiple record from this table.I applied onLeadSelect for this table,I can select only 1 record from the table.
    Can any one plz suggest me how to select multiple records from the table so that I can get all the data of those selected record.
    Regards
    -Sandip

    Rashmi/Kukku,
    First of all, Thanks for your help!
    Is there any other way in which we can access tables other than using BAPIs or RFCs?
    In my case, there is a table structure which has to be updated with values after validating a key. i don't think there is any RFC available now. do i need to create bapi/rfc for that?
    Krishna Murthy

  • How to create multiple Tree Type Region In Tabular Form ?

    Dear Friends,
    i have to design tabular form to Distribute User Rioght to emp to access application
    eg if i have Three module in application
    1.Administration
    2.Attendance
    3.Accounts
    Module
    1 Administration have 5 Pages A,B,C,D,E.
    Module
    2 Attendance HAVE 4 Pages F,G,H,I
    Module
    3 Accounts HAVE 7 Pages J,K,L,M,N,O,P
    I need these three module divided into three section in tabular form as a tree Type like
    Module 1 Tree Open in Tabular Form like
    - (Tree Mark Open )
    =======================================================
    PAGE_ID-------------SUBPAGE_ID-------VIEW-------------------MODIFY-------------------CREATE----------------------------TABLE COLUMN NAME
    ========================================================          
    Administration-----------A------------------CHECK bOX------------CHECK BOX-------------CHECK BOX
    Administration-----------B------------------CHECK bOX------------CHECK BOX-------------CHECK BOX
    Administration-----------C------------------CHECK bOX------------CHECK BOX-------------CHECK BOX
    Administration-----------D------------------CHECK bOX------------CHECK BOX-------------CHECK BOX
    Administration-----------E------------------CHECK bOX------------CHECK BOX-------------CHECK BOX
    - (Tree Mark Open )
    Module 2 Tree Open in Tabular Form like
    Attendance-----------F------------------CHECK bOX------------CHECK BOX-------------CHECK BOX
    Attendance-----------G------------------CHECK bOX------------CHECK BOX-------------CHECK BOX
    Attendance-----------H------------------CHECK bOX------------CHECK BOX-------------CHECK BOX
    Attendance-----------I------------------CHECK bOX------------CHECK BOX-------------CHECK BOX
    - (Tree Mark Open )
    Module 3 Tree Open in Tabular Form like
    Accounts-------------J------------------CHECK bOX------------CHECK BOX-------------CHECK BOX
    Accounts-------------K------------------CHECK bOX------------CHECK BOX-------------CHECK BOX
    Accounts-------------L------------------CHECK bOX------------CHECK BOX-------------CHECK BOX
    Accounts-------------M------------------CHECK bOX------------CHECK BOX-------------CHECK BOX
    Accounts-------------N------------------CHECK bOX------------CHECK BOX-------------CHECK BOX
    Accounts-------------O------------------CHECK bOX------------CHECK BOX-------------CHECK BOX
    Accounts-------------P------------------CHECK bOX------------CHECK BOX-------------CHECK BOXi need divided these three Module in Tabular form in three region as tree.
    Table APPLICATION_PAGE_DETAILS
    ID                   NUMBER
    PAGE_ID             NUMBER
    SUB_PAGE_ID          NUMBER
    ========================
    TABLE USER_RIGHT
    ======================
    ID                  NUMBER
    EMP_ID            NUMBER
    PAGE_ID            NUMBER
    SUB_PAGE_ID        NUMBER
    VIEW                    VARCHAR2(1)
    MODIFY                VARCHAR2(1)
    CREATE                VARCHAR2(1)How to create multiple Tree Type Region In Tabular Form ?
    How can i do this ?
    Thanks
    Edited by: Vedant on Oct 4, 2011 3:21 AM
    Edited by: Vedant on Oct 4, 2011 9:09 PM
    Edited by: Vedant on Oct 13, 2011 8:57 PM

    Well think of it I believe the scenario is too bird viewed hence the solution can't be exact.
    But thinking of a possible solution every time a child operation fails have a catch block where you you go back to system if the parent needs to be deleted if yes, call Delete Method on the parent.
    Note: Make sure that the decision on whether or not the parent record needs to be deleted will depends on the question "Does Parent Record already has several other children associated to it or not"
    Hope this clarifies.
    Regards,
    Messer

  • Creating multiple records

    When creating multiple records in a table using a SBO object eg invoice object, do you have to create a new business object for each record that is created?  There is a lot of overhead in doing this (eg each object takes about 1MB of mem so to create 1000 invoices would hog 1GB of mem).  Is there a way to create just one instance of the object and use it to create many records?  How is the object cleared in between each record creation?

    Greg,
    Everytime you call GetBusinessObject() you should, at the end, also release the acquired memory.
    This can be done with the following code in .net (C#):
    System.GC.Collect();
    System.GC.WaitForPendingFinalizers();
    Another way to clear all the data is to call the <b>GetByKey(-1)</b>; the document with docentry '-1' does never exists and the fields of the object are normally cleared.
    Regards,
    Jurgen

  • How to show multiple records in JDeveloper automatically

    Hi, you guys,
    May I ask you how to show multiple records, say consecutive three records, of a View object in JDeveloper?
    I know that we can just drag and drop a view object as a child (Table) of a scrollPane.
    Are there any other approaches?
    Thanks a lot for your time.
    damon

    Thanks for your reply.
    You are right.
    Table binding is the best solution for that.
    But in my mind, a record in a table is always shown in one row (or one line), am I right?
    If so, it is not convient to show records with multitple columns.
    Let's say, there are 20 columns to show for each record. Then we should display a record in, say 3 lines.
    How can we do that?
    Are there any suggestions?
    I am thinking that maybe I can use secondary row set iterators for that since we can create two or more row set iterators for the same view object.
    Assume I want to show three consecutive records. I can use attribute binding to show the current record in three lines by dragging attributes one by one from Data Control Palette to Design Window as Child | TextField;
    But I do not know how to use a secondary row set iterator for the next record. Where shall I create a secondary row set ietrator such that I can use it to create and synchronize the bindings.
    Thanks a lot
    Damon
    Message was edited by:
    user599641

  • How to Save Multiple Records In Data Block

    Hi All,
    I Have Two Blocks --> Control Block,Database Block
    Please Any Idea How to Save Multiple Records In Data Block when User changed Data in Control Block.
    Thanks For Your Help
    Sa

    Now i have to use each record of control block(ctl_blk) as where condition in data base block(dat_blk)and display 10 records from database table.>
    Do you want this coordination to be automatic/synchronized or only when the user clicks a button or something else to signal the coordination? Your answer here will dicate which trigger to put your code in.
    As to the coordination part, as the user selects a record in the Control Block (CB), you will need to take the Key information and modify the Data Block's (DB) "DEFAULT_WHER E" block property. The logical place to put this code is the CB When-New-Record-Instance (WNRI) trigger. You code will look something like the following:
    /* Sample WNRI trigger */
    /* This sample assumes you do not have a default value in the BLOCK WHER E property */
    DECLARE
       v_tmp_dw    VARCHAR2(250);
    BEGIN
       v_tmp_dw := ' DB_Key_Column1 = '||:CONTROL.Key_Column1||' AND DB_Key_Column2 = '||:CONTROL.Key_Column_2;
       Set_Block_Property('DATA_BLOCK', DEFAULT_WHER E, v_tmp_df);
       /* If you want auto coordination to occur, do the following */
       Go_Block('DATA_BLOCK');
       Execute_Query;
       /* Now, return to the Control Block */
       Go_Block('CONTROL_BLOCK');
    END;
    The Control block items are assigned with values in Form level (Key_exeqry).If your CD is populated from a single table, it would be better to create a Master - Detail relationship (as Abdetu) describes.
    Hope this helps,
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

  • How to create a record based on the name of a file in the file-system?

    Hi,
    With a lot of pictures I want to have a database to gather some information about these pictures.
    First question is how to generate a record based on a file in the file system?
    e.g. the pictures are "c:\fotos\2009\01\disc_001.jpg" to "c:\foto\2009\01\dis_98.jpg" .
    now i want to create records with as one of the attributes the name of the picture (not the picture itself). how to create these records (based on the information of the file-ssytem). i.e. the number of records should be the same as the number of pictures.
    any suggestions?
    any reaction will be appreciated.
    Leo

    Link to Create directory
    http://www.adp-gmbh.ch/ora/sql/create_directory.html
    You can create a list of files in the directory and read the list files from that directory.
    [UTL_FILE Documentation |http://download.oracle.com/docs/cd/B14117_01/appdev.101/b10802/u_file.htm#996728]
    [Solution using Java|http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:439619916584]
    SS

  • How to create multiple instance on same database

    Hi ,
    I would like to know how to create multiple instance on same database . I know that some people use database configuration assistant to do this but i could not figure out how they did it.
    Any how if some one can help me with this and can give me links of this it would be great help for me.
    Thank you for reading my problem and helping me !
    Amil
    please if possible mail me on [email protected]

    How to create multiple instance?????Do you mean multiple instances on the same database, or multiple databases on the same machine ?
    I m new to this field....
    Willin to learn a lot about oracle....Then it wouldn't be bad reading a bit of Database Concepts

  • How to create multiple pages in the output file?

    hi, we have an application (C++) that generates PDF output. I've been asked to figure out how to create multiple copies of each page (uncollated). i.e. the output would be 4 copies of p 1 followed by 4 copies of p 2, etc. I'd like to do this without actually replicating each page if possible ... any ideas?

    Why not just put four copies of the same CosObj reference into the Pages array/tree?

  • How to create a record for table PLAF with order type 'NB'.

    How to create a record for table PLAF with order type 'NB'(standard purchase order).
    who can tell me the T-code or some usefull information?
    Thanks.

    Hi
    This will be updated automatically when generate planned orders thru MRP. (MD02)
    regards
    Srinivas

Maybe you are looking for

  • IPod nano works with USB 1.1 but not USB 2.0

    Anyone using an iPod nano that works with USB 1.1 but not with USB 2.0? I am using Windows XP and when installing the iPod software from CD it recognizes the iPod and am able to transfer songs using iTunes but when installing SP1 or SP2 to enable USB

  • Getting class not found error running java application using OIM libraries

    Hi, I have created a java application in which I access OIM libraries to fetch user list and then assign user roles. As i run the application it generates exception and program crashes. However, I am using the same libraries in OIM adapters and it is

  • Can't get TouchEvent to work, what is wrong with my code?

    Hello, I am trying to get a touch event to trigger.  Using my Motorola Droid 2 phone, I can get a MouseEvent to trigger, but I can't get a TouchEvent to trigger that would change text on screen. I am using an AIR For Android Template in Flash Pro CS5

  • Insert set of character in a string

    hi guys, I have created a string of length 19, i need to insert set of character and compare them if its right format or not.That is for barcode i need. i WANT MY PROGRAM TO GENERATE THIS FORMAT BARCODE. eg : INV40602007RE000155

  • I need immediate assistance please!!

    I was updating the software for my Nokia 6133, and when it was on step 2, which is the installation of the updated version, my computer lagged and it force-shut the updater. This is WHILE my phone connected to it, updating, and it said if your phone