System.last record on Library

I have to convert this type of code from program unit into library. The problem is I can't pass ":system.last_record" as parameter because it must get its value while reading the block.
With these code in library, compiler flag bad bind variable error.
go_block('DETAILS');
first_record;
loop
--some codes
If :system.last_record = 'TRUE' then
     Exit;
Else
Next_record;
End If;
end loop;

you have to use NAME_IN ('SYSTEM.LAST_RECORD') instead of the :SYSTEM...

Similar Messages

  • Problem on forms for serial number generation with last record next_record.

    Hi Experts,
    currently i'm facing one problem like :
    i'm populating one receipt detail in Multi block , like when user key in one receipt number that time record should go in first record ,and if they key in second receipt number then record should go in second record . mean to say every time record go in last record ..but the problem is i want to generate Serial no correspondence to every last record ..
    here is my approch :
    cursor c1 is
    select * from table
    where cname =:blk_name.clm_name.
    Last record;
    next_record;
    for v1 in c1 loop
    processed record;
    next_record;
    end loop;
    last_record;
    go_block(___);
    first_record;
    :sno := system.cursor_record ;
    next_reocrd;
    end loop;
    first_record;
    And in block level i'm writing code for Serial number generation when user key in manual entry for receipt detail:
    :blk_name.coulumn_name := :system. cursor_record;
    so in this approach their is no problem it is working properly but the problem is that
    when user fetch one receipt automatically and then after he want to enter next record manually and he decided to go in detail block ,
    and once he reached in detail block that time block level trigger i firing .ans serial number 2 generated and then suddenly he came to know no i want to fetch next record automatically mean to say now user going again master block and fetching next receipt detail ,
    but the problem is when user leaving seccond sr no and going in master block and population next receipt detail that time cursor going on 3 record
    but logically have to replace the second Serial no and generate the again serial number 2 record population .mean to say its not refreshing last_record..
    so i'm appreciating is anyone if came accoross this type of issue please corrrect my code and send updated code ..plsssssssssssssssssssssssssssssss
    Thanks
    Abhishek
    [email protected]

    hi
    I put this below code on when_new_record_instance on block level..
    :blk_name.column_name :=system.cursor_record;
    so can you please help me.....
    Thanks
    Abhishek

  • Need Help On Oracle form side for serial no genretion for every last record

    Hi Experts,
    currently i'm facing one problem like :
    i'm populating one receipt detail in Multi block , like when user key in one receipt number that time record should go in first record ,and if they key in second receipt number then record should go in second record . mean to say every time record go in last record ..but the problem is i want to generate Serial no correspondence to every last record ..
    here is my approch :
    cursor c1 is
    select * from table
    where cname =:blk_name.clm_name.
    Last record;
    next_record;
    for v1 in c1 loop
    processed record;
    next_record;
    end loop;
    last_record;
    go_block(___);
    first_record;
    :sno := system.cursor_record ;
    next_reocrd;
    end loop;
    first_record;
    And in block level i'm writing code for Serial number generation when user key in manual entry for receipt detail:
    :blk_name.coulumn_name := :system. cursor_record;
    so in this approach their is no problem it is working properly but the problem is that
    when user fetch one receipt automatically and then after he want to enter next record manually and he decided to go in detail block ,
    and once he reached in detail block that time block level trigger i firing .ans serial number 2 generated and then suddenly he came to know no i want to fetch next record automatically mean to say now user going again master block and fetching next receipt detail ,
    but the problem is when user leaving seccond sr no and going in master block and population next receipt detail that time cursor going on 3 record
    but logically have to replace the second Serial no and generate the again serial number 2 record population .
    so i'm appreciating is anyone if came accoross this type of issue please corrrect my code and send updated code ..plsssssssssssssssssssssssssssssss
    Thanks
    Abhishek
    [email protected]

    Friend, If you forward this question in forms forums , It will be better for you.
    Abishek Go this link and post there friend.
    Link:Forms

  • First and Last Record

    Hi everybody,
    I have problem with first and last record.How can I specified that current record is first and last record.
    it means that is any statement exist that determine :System.first_record is equal to :System.last_record.
    It's very emergancy.
    Thanks for your attention and your help.
    /Shiva

    You can try this:
    if :system.cursor_record = '1' and :system.last_record = 'TRUE' then
    -- this is the only record in block
    end if;
    Hi everybody,
    I have problem with first and last record.How can I specified that current record is first and last record.
    it means that is any statement exist that determine :System.first_record is equal to :System.last_record.
    It's very emergancy.
    Thanks for your attention and your help.
    /Shiva

  • How i know when a EXECUTE_QUERY retrieved last record

    Hi...
    How i know when the EXECUTE QUERY retrieved the last record in a block ....?
    Exist a trigger after trigger POST-QUERY?
    Regards
    Hector Gabriel Ulloa Ligarius
    Santiago of Chile
    http://es.groups.yahoo.com/group/desarrolloOracle/

    Kevin, sorry
    But the :system.last_record not change the value during the execution of EXECUTE_QUERY.
    Only useful when the data was retrieved into blocks...not during..
    Other mode?
    Regards
    Hector Gabriel Ulloa Ligarius
    Santiago of Chile
    http://es.groups.yahoo.com/group/desarrolloOracle/

  • System First Record

    Hi all,
    begin
         FND_MESSAGE.SET_STRING('Pre Calculate');
         FND_MESSAGE.SHOW;
              go_block(':XX_DISCOUNT_MANAGER_V');
         FIRST_RECORD;
         WHILE :System.Last_Record <> 'TRUE' --OR :SYSTEM.FIRST_RECORD= 'TRUE')
              LOOP
              if :XX_DISCOUNT_MANAGER_V.DISCOUNT = 'Y' then
              :XX_DISCOUNT_MANAGER_V.OVERRIDE_UNIT_PRICE:=(((100-:XX_DISCOUNT_MANAGER_V.DISCOUNT_RATE)/100)*:XX_DISCOUNT_MANAGER_V.LIST_PRICE);
              :XX_DISCOUNT_MANAGER_V.EXTENDED_PRICE := (:XX_DISCOUNT_MANAGER_V.OVERRIDE_UNIT_PRICE)*(:XX_DISCOUNT_MANAGER_V.QUANTITY);
              :XX_DISCOUNT_MANAGER_V.NET_PRICE := :XX_DISCOUNT_MANAGER_V.EXTENDED_PRICE;
              end if;
              --(:XX_DISCOUNT_MANAGER_V.OVERRIDE_UNIT_PRICE)*(:XX_DISCOUNT_MANAGER_V.QUANTITY);
              --:XX_DISCOUNT_MANAGER_V.EXTENDED_PRICE := (:XX_DISCOUNT_MANAGER_V.OVERRIDE_UNIT_PRICE)*(:XX_DISCOUNT_MANAGER_V.QUANTITY);     
                        NEXT_RECORD;
                        IF :System.Last_Record = 'TRUE' THEN
              if :XX_DISCOUNT_MANAGER_V.DISCOUNT = 'Y' then
         :XX_DISCOUNT_MANAGER_V.OVERRIDE_UNIT_PRICE:=(((100-:XX_DISCOUNT_MANAGER_V.DISCOUNT_RATE)/100)*:XX_DISCOUNT_MANAGER_V.LIST_PRICE);
              :XX_DISCOUNT_MANAGER_V.EXTENDED_PRICE := (:XX_DISCOUNT_MANAGER_V.OVERRIDE_UNIT_PRICE)*(:XX_DISCOUNT_MANAGER_V.QUANTITY);
              :XX_DISCOUNT_MANAGER_V.NET_PRICE := :XX_DISCOUNT_MANAGER_V.EXTENDED_PRICE;
              --(:XX_DISCOUNT_MANAGER_V.OVERRIDE_UNIT_PRICE)*(:XX_DISCOUNT_MANAGER_V.QUANTITY);
              end if;          
                                  EXIT;
              END IF;     
         END LOOP;
         end;
    This is the code i have used ,if i have multiple records i can do this operation.If i have multiple records i can do the operations,if there is one record means i'm unable to do this operation.
    I also want the cursor should be in the slected record.Itis very urget can any one help me in this issue...
    Regards
    Siva

    Siva,
    I think this is what you want:
    begin
    FND_MESSAGE.SET_STRING('Pre Calculate');
    FND_MESSAGE.SHOW;
    go_block(':XX_DISCOUNT_MANAGER_V');
    FIRST_RECORD;
    WHILE :System.Last_Record <> 'TRUE' --OR :SYSTEM.FIRST_RECORD= 'TRUE')
    LOOP
    if :XX_DISCOUNT_MANAGER_V.DISCOUNT = 'Y' then
    :XX_DISCOUNT_MANAGER_V.OVERRIDE_UNIT_PRICE:=(((100-:XX_DISCOUNT_MANAGER_V.DISCOUNT_RATE)/100)*:XX_DISCOUNT_MANAGER_V.LIST_PRICE);
    :XX_DISCOUNT_MANAGER_V.EXTENDED_PRICE := (:XX_DISCOUNT_MANAGER_V.OVERRIDE_UNIT_PRICE)*(:XX_DISCOUNT_MANAGER_V.QUANTITY);
    :XX_DISCOUNT_MANAGER_V.NET_PRICE := :XX_DISCOUNT_MANAGER_V.EXTENDED_PRICE;
    end if;
    --(:XX_DISCOUNT_MANAGER_V.OVERRIDE_UNIT_PRICE)*(:XX_DISCOUNT_MANAGER_V.QUANTITY);
    --:XX_DISCOUNT_MANAGER_V.EXTENDED_PRICE := (:XX_DISCOUNT_MANAGER_V.OVERRIDE_UNIT_PRICE)*(:XX_DISCOUNT_MANAGER_V.QUANTITY);
    NEXT_RECORD;
    END LOOP;
    /* Process last record */
    if :XX_DISCOUNT_MANAGER_V.DISCOUNT = 'Y' then
    :XX_DISCOUNT_MANAGER_V.OVERRIDE_UNIT_PRICE:=(((100-:XX_DISCOUNT_MANAGER_V.DISCOUNT_RATE)/100)*:XX_DISCOUNT_MANAGER_V.LIST_PRICE);
    :XX_DISCOUNT_MANAGER_V.EXTENDED_PRICE := (:XX_DISCOUNT_MANAGER_V.OVERRIDE_UNIT_PRICE)*(:XX_DISCOUNT_MANAGER_V.QUANTITY);
    :XX_DISCOUNT_MANAGER_V.NET_PRICE := :XX_DISCOUNT_MANAGER_V.EXTENDED_PRICE;
    --(:XX_DISCOUNT_MANAGER_V.OVERRIDE_UNIT_PRICE)*(:XX_DISCOUNT_MANAGER_V.QUANTITY);
    end if;
    end;
    Only thing you should probably add is a check to see id the record is empty (no record in the block).
    Grtz
    Bram Schiltmans

  • Cursor Jumping to last record when query mode for Multi-record block.

    I have a multi-record block. the seq field has this validation to check that there should not be a gap
    in sequence for S_type and cer_dl field.The program unit is as below.
    PROCEDURE seq_validation IS
    --Validation to check that there is no gaps in sequence for S_TYPE and cer_dl fields
    l_value_to_check varchar2(100);
    l_seq_found number;
    l_curr_sequence number;
    l_new_value varchar2(100);
    l_found boolean:=FALSE;
    l_new_set boolean := FALSE; --s_type and cer_dl are different from previous set.
    begin
    if trim(:b1.s_type) is not null
    or trim(:b1.cer_dl) is not null
    then
    -- Program continues here only if all the items are not null
    -- Get information from record that needs to be validated
    l_value_to_check := trim(:b1.s_type) || ':'|| trim(:b1.cer_dl) ;
    l_curr_sequence := :sequence;
    if :SYSTEM.CURSOR_RECORD = '1' then
    ---to check sequence is entered as 1 in the first record
    message('Error:Sequence should start with 1');
    raise form_trigger_failure;
    end if;
    go_item('b1.XYZ');
    else
    FIRST_RECORD;
    while :SYSTEM.LAST_RECORD != 'TRUE'
    loop
    l_found := FALSE;
    l_new_value := trim(:b1.S_type) || ':'|| trim(:cer_dl) ;
    if l_new_value = l_value_to_check then --
    l_new_set:= FALSE;
    l_seq_found := :seq;
    if l_seq_found >= l_curr_sequence then
    go_item('b1.seq');
    l_new_set := FALSE;
    elsif l_seq_found < l_curr_sequence - 1 then
    go_item('b1.sequence');
    l_found := FALSE;
    elsif l_seq_found = l_curr_sequence - 1 then
    l_found:= TRUE;
    go_item('b1.xyz); --go to next item
    end if;
    else
    l_new_set := TRUE;
    end if;
    NEXT_RECORD;
    end loop;
    if l_new_set then
    go_item('b1.xyz'); -- go to next item
    else
    if not l_found then
    message('Error:Sequence should be in order.');
    go_item('b1.seq');
    raise form_trigger_failure;
    end if;
    end if;
    go_item('b1.xyz'); ---go to next item
    end if;
    end if;
    end;     
    In the insert mode its working fine(unless you gurus feel to change to make it more perfect.
    When I say enter-query and put 'IAS' in the s_type field and then do a execute query it brings all the records of 'IAS'.
    Now as I want to update the records, and when I navigate across field(s_type,cer_dl,Seq,xyz) using tab and move the cursor down on second
    record(IAS N 2 N), what happens is when I navigate to sequence field the cursor jumps to LAST RECORD( IAS Y 3 N ) of LAST field XYZ.
    I am putting the sample record
    s_type cer_dl seq xyz
    IAS N 1 N
    IAS N 2 N
    IAS N 3 N
    IAS N 4 N
    IAS Y 1 N
    IAS Y 2 N
    IAS Y 3 N
    The cursor moves to last record --IAS -Y -3-N when I tab across the second record.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    When I say enter-query and put 'IAS' in the s_type field...For your validation to work you must not allow users to enter records in the middle of a block, clear records from the block or query specific records. If you allow the users to enter a query then you are allowing 2 of the rules to be broken.

  • Last Record Navigation

    Hi
    When we use the last record navigation buton the system goes to max number of document, for example in sales order.
    is possible that the last record buton goes to the last document of the period indicator active?
    regards
    VS

    The functionality of the First, Prev, Next, Last buttongs are build into the core code of SBO and pressing last will always does to the highest number for that document.
    If you are on Add mode, like Gordon says..pressing the Prev button would take you to the number before the current one.
    Suda

  • Moving backward -last record to first

    Hi!
    How can we move bachward, last to first record as cursors are forward only in oracle
    Thnaks in advance
    Imran

    Raghu: You have :System.Cursor_Record and :System.Trigger_Record. Depending on what you are doing, one of them will equal 1 when you are at the first record in the block.
    Imran:
    I have used server-side stored procedure to do that. If you have a block of records the user has displayed (Example, names starting in the middle of the alphabet), and he wants to see the rows that come BEFORE the first record, this is what you do:
    Call the stored procedure, passing the key value of the first record in your block. It creates a cursor with a where clause: where key_val < parameter_value, and Order by key_val desc. Then open the cursor, and fetch some number of rows -- I use about 50, then close the cursor and pass the key value of the last record fetched back to the form.
    Then I set the where clause of the block to say Where key_val >= Value_From_stored_procedure. Execute_Query, then do a next_record until I find the record with the key value equal to (or greater than) the key value I passed to the stored procedure.
    Then loop forward with a Next_Record loop however many records are displayed in the block minus two. This leaves the block displayed with the record with the initial key value as the second row displayed, and the immediately prior record is at the top.
    I have implemented this type of process from the key-PrevRec trigger if :system.trigger_record = 1. Or you can put a small square button above the top of the scroll bar, so when clicked, it executes the same process.

  • System crashed and lost library, want to recover

    system crashed and lost library, want to recover

    Welcome to the Apple Discussions. I don't know how to fix the xml file or prevent it's damage except to keep a current backup copy of the domain.sites2 file. You can do that on an hourly basis with Time Machine or use a backup application like Synk Standard which can do incremental backup (i.e. copy just those new or changed files) at any time.
    As for separating the sites into their own domain files I use iWebSites to manage over 75 individual sites. It lets me create multiple sites and multiple domain files.
    If you have multiple sites in one domain file here's the workflow I used to split them into individual site files with iWebSites. Be sure to make a backup copy of your original Domain.sites files before starting the splitting process and move it to another location on your HD until you're satisfied the separation process is completed and what you want.
    This lets me edit several sites and only republish the one I want.
    There is a downside to this method if you're publishing to MobileMe. When publishing multiple sites to MMe from their own separate domain file the last published site will be the default site when using the default URL for that MMe account: http://web.me.com/MobileMeAccountName/. That could mess up any CNAME forwarding if you have a domain name pointed to your default MMe site.
    OT

  • Last record is not displaying

    Hi Experts,
    i just save one AP invoice document on just now and i click on last button, but the system showing the last record of 2009 financial year.
    how i can get the current year document ?
    Regards,
    Sanju M S

    HI Sanju
    Make this year series as Default. so when ever ur finding it will go to the last posted doc. which u have created a doc for this year....
    Giri

  • How to retrieve last record entered into database

    Hi all,
    I want to retrieve the last resord entered into a database table.
    I have a MS Access database.
    This code does not return the last record but its my nearest attempt to.
    Can anyone suggest the correct SQL or Solution.
    Help is greatly appriciated.
    Thanks.
    String str = "SELECT * FROM Missions WHERE Mission = (SELECT MAX(Mission) FROM MISSIONS)";
            ResultSet rs = null;
                String f1 = null, f2 = null, f3 = null, f4 = null;
                try{   
                    rs = statement.executeQuery(str);
                    txtMissionInformation.setText("");
                    int row = 0;
                    while(rs.next()){
                        f1 = rs.getString(1);
                        f2 = rs.getString(2);
                        f3 = rs.getString(3);
                        f4 = rs.getString(4);
                        System.out.println(f1 + " " + f2 + " "+f3+" "+f4);
                        txtMissionInformation.append(f1 + ", "+ f2 + ""+","+f3+","+f4);
                    System.out.println("Query Complete !");
                } catch(Exception e){
                    e.printStackTrace();
                }

    I fixed my problem, i aded an autonumber field to my database set it as primary key and called it ID. i then used the syntax from before and it worked.

  • Extract Last record

    I have a text file which is occasionally appended. Each
    record is separated by a carriage return. What I want to be able to
    do is select the last record in the text file.
    So assuming that the text file looked like this
    Dod
    Cat
    Bird
    Fish
    So after I have read the file with CFFIle and set a variable
    for the entire lits, how would I sextract the last entry
    Fish?

    If you have TAIL, you can use CFEXECUTE against the text
    file. For windows based systems, you can install MINGW and MSYS to
    get TAIL.
    Note: If you run into timeout issues, You may have to change
    the account that the CF service uses to log on with. There are
    security issues with this and it may not be suitable for a shared
    environment security wise.
    Reference:
    http://www.mingw.org/

  • How to get the last record??

    Hi, I now have to get only the last record from one table
    from MS Access.
    I was looking for the useful method from API, however,
    I cannot get it.
    How to get only the last record from one table ???
    Please help, thanks.

    In RDBMS, row order is really not relavent by iteself. Meaning there is no such thing as 'last record' unless it's in the context of a column (e.g. timeStamp).
    Of course, rows are inserted and stored in some natural order, but you cannot assume they'll come back the same way in a 'Select *' as they were entered.
    So, if you mean last row as in last inserted row, I would add a timestamp field that's set at insert, or use a autonumber column. Either way, have a column that will always contain the highest number or newest timestamp, and then you can build your where clause from that.
    For instance, in Access, I have an autonumbered field called 'fred', with other columns. If I want the last record, I simply use the following:
    select * from atable where fred in (SELECT max(fred) AS Max FROM atable);
    the 'where in' clause will filter to only those records in the subsequent select statment, which of course is only one, the max of the column fred.
    bRi

  • How to get the last record from the database

    I am using MS Access database and Swings as GUI. I want to get the last record of a particular column from the table and store it as a varaible.

    Hi
    To get Last record of resultset, you have pass some parameter in constructor of CreateStatement.In such case Resultset should be scrollable and Readonly
    Example
    objStatement=objCon.createStatement ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
    mwwResultSet=cwwStatement.executeQuery(mwwSqlQuery);
    while(mwwResultSet.next())
    if(mwwResultSet.isLast())
    //Fetch the required column record.
    String abc=mwwResultSet.getString(1);
    I think this will work. Try it.
    bye

Maybe you are looking for

  • Billing doc is not appearing :CRM_SRVBIL - Release Billing Documents

    Hello Experts, We are running the SAP CRM service process and we are also doing the billing in CRM itself. For one service confirmation we are facing the billing problem. The isue: We have completed the Confiremation and while we are doing the billin

  • A/W Vanished Completely??!!Help!!

    Erased and installed my eMac Power PC G4 back to 10.3.4 as per Apple Phone Tech.Worked my way back up to 10.3.9. By the proper Combo Updaters from the downloads here at Apple website through Safari.This eMac was bought in Aug.2004,born a month or so

  • Building the varchar string to return from a pl sql function

    i'm new with pl/sql and i'm having trouble trying to build the string that i want to return from a function that is inside a package. it seems my problem stems from the fact that i'm trying to incorporate a variable (varchar2) into the string to be r

  • Dynamic table with dynamic binding

    Hello, I'm really not sure if I can realize that kind of feature using a table : I've created a dynamic table that have a dynimac number of columns except two. I've setted the value of the table to a certain list to fill out the two static field I ne

  • Can't delete or move some messages

    After upgrading to Leopard, I checked my mail and got several hundred messages. At least half of them have the following properties: (1) they are blank when I open them (2) I cannot delete them (3) I cannot move them to another mailbox manually (4) M