Return amount of records after query multi-record block

Hello,
I would like to have a restriction in my multi-record form that counts the amount of returning records (after execute_query). If the amount is >= 1000 then I have to raise an error.
How can I implement this?
Best regards,
Ronny.

It most cases forms doesn't return all rows to the user in a batch unless the block property Query-all is set to yes. But if you have sum items based on that block, you have to set it to Yes. If you can turn this flag off and change the Query Array Size (block property) to 0 or something small (like 20), you dont have to worry about how many rows the query is going to return.
In you case, sounds like you want the user to put more constraints if rows returning > 1000 and you probably dont want the user to ever look those rows. You can do a
select count(*) from your_table
where --your critera
and rownum < 1001
before execute the query. But this select might take
a while if you table is very big in oracle 9i.
The easiest thing is to turn off the Query-All switch, let the forms handle the query and let the user decide whether to refine the query.

Similar Messages

  • Copy the Last Record queried to the new record in a Multi - Record Block

    Hi Team
    When i enter a new record in a Multi - Record Block the last record should get copied to the new record.
    Please help me.
    Thanks

    Hi
    pls use...
    DUPLICATE_RECORD;Amatu Allah

  • Single record in a multi record block

    How do I disable a single record in a multi record block keeping only the display option in Forms 4.5

    you can't in 4.5 you can do it in 6.0 with the set_item_instance_property.

  • Conditionally display an icon for each record in a multi record block

    Hi,
    I am using Forms 6i. Is there any way to conditionally display an icon for each record in a multi record block. The SET_ITEM_INSTANCE_PROPERTY builtin does not have many choices. Thanks for your help.

    Henry,
    I doubt that. You would have to replace the text item with an image item. This however can't be done for individual cells in a table but only for the whole column.
    On the web chances are that these could be handled with a custom PJC, but this solution doesn't work in client/server
    Frank

  • Creating new records while querying existing record

    Hi,
    I have one master - detail form.
    First i created 1 record. Request ID is the primary key. Now request id generated. For ex.: 10
    Request Id, date, requestor , location, status fields are in header block.
    In lines block, i hv some other fields.. and one field called 'Activity'.
    While creating first record, the activity will be 'New'.
    Then i'll query the record '10'.
    when i'm changing the activity 'New' into 'Upgrade', it should create new record with new request ID.
    How to do this?
    I hv written procedure that, i'm taking field values to local variables. Then assigning the local variable values to field values.
    It is not creating as new record. It overwriting the existing record with new values. Existing record is missing.
    Pl. give steps.
    Thanks
    Kavi

    Hi,
    Okk, you will have to do two things. Create two trigger on block level on which you want to do your changes.
    1. First trigger. (PRE-UPDATE)
    In pre-update trigger u will have to write the complete insert statement into the same table with new req id. like
    DECLARE
    vReqNo DATA_TYPE;
    BEGIN
    SELECT MAX(REQ_ID)
    INTO vReqNo
    FROM your_table;
    INSERT INTO your_table
    (req_no, fields....)
    VALUES
    (vReqNo, :forms_values);
    END;
    2. Create 2nd trigger on block level (ON-UPDATE)
    write in this trigger
    NULL;
    for viewing the inserted record. What u have to do is in ON-UPDATE after null; create one timer NO_REAPEAT.
    and in timer u will have to set the block property to req_id = generated_req_id_from_pre_update_trigger and
    execute_query;
    hope it will work...
    -Ammad

  • Re-sequencing records in a multi record block

    I have a multirecord block with sequence No field which is unique no and other fiels which is showing from the values which I have stored in a table say sequence No from 1 to 10 along with other fields.If I change the record which has the sequence No say 6 to become seq no 2 ,then the record with seq no 2 should become seq no 3 and the rec with seq no 3 should become seq no 4 and rec with seq no 4 should become seq no 5 and rec ord with seq no 5 should become seq no 6.This should automatically happen when the user changes say
    seq no 6 to seq no 2 .User may change any seqq no like this.
    We will provide 2 text box serialNo from and Serial No 2 and a button click should swap the records in between this two seq no and show it on the screen in the multi record block.Please help me to code this.
    Regards
    Jayshree Suresh

    User455091,
    1- You can add a non based checkbox item to your block. To resequence a record, you may have to check the record you want to change and then, check the position you want to change it for. Example: if you want to change the 6th to seq 2, you check the record 6 and check the record 2 right after (you can choose any logic to implement your sequence change. this is only an example).
    2- When you check the first record, set a global variable "seq_from" with the value of the sequence field (or :system.cursor_record if the block is ordered by this sequence)
    3- When you check the 2nd record, set a global variable "seq_to" and proceed to the resequence.
    4- Manage the change down and change up (if "seq_from">"seq_to" or "seq_from"<"seq_to")
    5- You have to change the values of all the record fields for all the records between seq_from and seq_to. by doing a loop between seq_from and seq_to. You may have to use previous_record or next_record depending on if it is a change_qown or a change_up.
    6- When the resequence is done, reset all the variables to blank, and don't forget your checkbox!
    This seems difficult, but only think about it. It is easier than what you expect. This method is more user-freindly but, just think about it....

  • Fetching the number of records in a multi-record block...

    Hi ,
    In Forms10g runtime-and in previous releases too- there is , as a message, the number of records fetched/inserted in a multi-line block such as Record:5/9. Is it possible to catch these two numbers (i mean 5 and 9 , or at least the number of records)...not only in query but in the insert mode as well...?????
    Many thanks ,
    Simon

    No, you can't capture that text, but you can write your own code to do the same thing.

  • Deleting selected record in a multi-record block

    I am using Form 6i.
    I have two multi-record block viz. BLK_A and BLK_B.
    BLK_A has record displayed property set to 4
    BLK_B has record displayed property set to 8
    Each block has checkbox item.
    BLK_A contains records retrieved from table after entering data in selection criteria.
    When checked on anyone checkbox of BLK_A, then it displays related information in BLK_B.
    But when I uncheck the checkbox of BLK_A, then how to delete records in BLK_B.
    Thanks in advance.
    Regards,
    Vikas

    No, absolutely not.
    I cannot use this method.
    Because if two checkbox is check in BLK_A, then records related to both record in BLK_A will display in BLK_B. If I uncheck any one checkbox of BLK_A, then only records related to that checkbox should be deleted.
    If I use your suggestion, then all data will be removed.
    Thanks and regards,
    Vikas

  • How to set default settings to display record count in multi record block

    Hi All
    Whenever I query my multi record block, I get 1/? as record count at the console in standard Oracle Applications. Is there any setting so that it displays 1/50 (in case total record queried is 50). I don't want to set query all property of block as I don't have any control in standard Apps forms.
    Thanks in advance
    Navdeep

    Check out the next_navigation_item option for the get_item_property procedure. If you use this you can do the process without having to navigate from one item to the next.
    You can do something like this (untested) to move and resize the items (other than the first in the block):
    PROCEDURE move_and_resize(p_item IN ITEM, p_width IN PLS_INTEGER) IS
      prev_item ITEM := Get_Item_Property(p_item, PREVIOUS_NAVIGATION_ITEM);
    BEGIN
      Set_Item_Property(p_item, WIDTH, Get_Item_Property(p_item, WIDTH) + p_width);
      Set_Item_Property(p_item, X_POS, Get_Item_Property(prev_item, WIDTH) +
                                       Get_Item_Property(prev_item, X_POS));
    END move_and_resize;
    move_and_resize(myitem, -30);

  • Get the first item value of previous record in a multi record block

    Hai,
    I have a multi record block with four items.I should get the first item value of the previous record so that I can increment its value in the current record.
    Thanks.........

    If you want a distinct value in each row or to be able to retrieve the records in the same order they were written then you should use a sequence.
    If you want to retrieve the records in the same order they were created in the block then you will need a diffferent solution to the one you outline here since a user could enter a new record between two others.
    I posted this a while back in response to someone who was using a sort_key item and resetting it for each row when a new record was inserted:
    If you make the sort_key bigger then you have much more room to insert new rows in between existing rows without having to reset all the sort_keys.
    Eg. you have rows with sort_keys of 129282000000000000 and 129283000000000000 (you can have more zeros if you want) and you want to insert a row in between. if you're using oracle forms then the user would have to click on the first of these rows and then do 'insert'. in your insert process you would store the sort keys of the current record and the one below, create a blank record in between and set the sort_key of that record to the average of the other two. you will be able to insert many new rows in between the original 2 before running out of space in the sort_key field.
    the method above is not sufficient, there are some other cases to consider:
    1) when the user is on the last record of the block then you will just create a new record with sort_key set to a greater number than the row before. you can have the sort_key defined as number(38) and to safely allow you to enter 1000 rows each new row would normally be 10E33 greater than the previous one.
    2) when the user is entering the first record then just set the sort_key to 10E33.
    3) on the off-chance that you do insert a great number of records and cannot insert another in between then you would need to alert the user, process the records so that the sort_keys are evenly spaced and requery the block. this processing could be scheduled nightly to make this eventuality even less likely.
    4) make sure the user cannot run the default 'clear_record' procedure. this would break my method as well as yours!
    James.

  • How to get the original record Number in Multi-Record Block

    Hello Everyone,
    I know how to find the duplicate item in the multi-Record block,
    For Ex:
    Line_Num            Item_Name             Quantity
    1                           AA                      10
    2                           BB                      20
    3                           AA Here 3rd record Item_name is duplicated, I can able to check and display the message that 'Item is duplicated' ,I found from [sheikyerbouti.developpez.com/duplicates/duplicates.htm] .
    but I want to show along with original line number i.e 1 when the item_name is entered .
    Here I want to check the original Line_Num and want to display the message
    'Item is duplicated,Update quantity in Original Line 1'
    Can anyone help me to get this?
    Thank You.
    Regards,
    Guru.

    Hi Francois,
    Actually I want to check and show the message when the item_name is entered i.e WHEN-VALIDATE-ITEM TRIGGER.
    I put the following code in WHEN-VALIDATE-ITEM TRIGGER
    Declare
         curnum number;
         dupnum number;
         cur_item varchar2(100);
         v_alert_no number;
         p_linerec varchar2(100);
    Begin
    curnum := TO_NUMBER(:System.Trigger_Record);
    cur_item := :Lines.Item_number;
    First_Record;
    p_linerec := :Lines.Item_number;
    LOOP
    If p_linerec = cur_item then
         dupnum := :Lines.Line_num;
         set_alert_property('ALERT_STOP',ALERT_MESSAGE_TEXT,
    'Duplicate Item Found,Update QTY in Original line number '||dupnum);
       V_ALERT_NO := show_alert('ALERT_STOP');
       :LINES.ITEM_NUMBER := NULL;
    :LINES.ITEM_DESCRIPTION:= NULL;
    :LINES.ITEM_REVISION:= NULL;
    :LINES.ITEM_CATEGORY:= NULL;
    elsIF (:System.Last_Record = 'TRUE') THEN
         Go_Record(curnum);
         EXIT;
      ELSE
         Next_Record;
      END IF;
    END LOOP;
    End; But I am getting the following error,
    FRM-40737:Illegal Restricted Procedure
    FIRST_RECORD in WHEN-VALIDATE-TRIGGERand then
    its showing for first line itself.
    Duplicate Item found.Update QTY in Original line number 1so I put the condition
    If :Lines.Line_num > 1 then --Only to check when the block having more than one record.but now it checking from second record and displaying,
    Duplicate Item found.Update QTY in Original line number 2 --(instead of Update QTY in Original line number 1)Can you tell me how can I change the above code for my requirement?
    Thank you.
    Edited by: Gurujothi on 27 Mar, 2013 5:20 PM

  • How I can Change records color in multi record block

    Hi,
    I am using Form 6i, No. of records displayed 15 in a block EMP, now at run time I want to see that employees who belong to dept No. 10 , their records color is RED.
    And employees who belong to dept No. 20 , their records color is BLUE
    And employees who belong to dept No. 30 , their records color is GREEN
    Pleased send me the solution on urgently basis. If possible send FMB file of this problem solution to me. E_Mail: [email protected]
    Best regards,
    Shahzad

    Hi,
    this shouldn't be a problem with use of VISUAL_ATTRIBUTES, post_query trigger and SET_ITEM_INSTANCE_PROPERTY built_in:
    steps:
    1) create VISUAL_ATTRIBUTES
    2) in post_query of block use Set_Item_Instance_Property built in
    SET_ITEM_INSTANCE_PROPERTY(item_id ITEM,
    record_number NUMBER,
    property NUMBER,
    value VARCHAR2);
    example from Forms documentation for use of set_item_instance_property is
    Set_Item_Instance_Property( cur_itm,
    CURRENT_RECORD,
    VISUAL_ATTRIBUTE,
    'My_Favorite_Named_Attribute');

  • Querying Multi-Record XML

    Hi,
    I have inserted the following XML document in to a table with an XMLType column:
    <?xml version="1.0" encoding="UTF-8"?>
    <PhotoImaging xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://xmlns.oracle.com/xdb/photoImaging.xsd">
         <EmpData>
              <VRN>1111</VRN>
              <Surname>Shah</Surname>
              <Forename>Sunil</Forename>
              <PayNo>1234</PayNo>
              <WarrantNo>1234</WarrantNo>
              <ImageFile>c:\sunil.jpg</ImageFile>
              <ImageDate>12-12-04</ImageDate>
         </EmpData>
         <EmpData>
              <VRN>2222</VRN>
              <Surname>Malde</Surname>
              <Forename>Kalpa</Forename>
              <PayNo>5678</PayNo>
              <WarrantNo>5678</WarrantNo>
              <ImageFile>c:\kalpa.jpg</ImageFile>
              <ImageDate>12-12-05</ImageDate>
         </EmpData>
    </PhotoImaging>
    This is just a simple XML document with 2 records.
    The problem I am having is when trying to query this document to retrieve, say, all the Surname's.
    I can use:
    select extractvalue(xml, 'PhotoImaging/EmpData/Surname') from mphr2_photo_xml
    This works well if the XML document only contains one record, but in my case the XML document will contain hundreds of records and 'extractValue' can only return one value.
    Does anyone know of a way to query this XML document and return all the Surname's??
    Thanks, Sunil

    It's OK. I got it from looking at some of the other threads.
    For information the SQL is as follows:
    select extractValue(value(q), '//Surname')
    from mphr2_photo_xml,
    table (xmlsequence(extract(xml, '/PhotoImaging/EmpData'))) q

  • How to print blank records after the detail records in a masterdetail report

    Hi,
    Developing a report for time and attendance record. In this report I am printing all the employees in a department, limiting the no. of records per page to 10.
    I need to insert blank lines at the end of all of the detail records in a page that has less than 10 employee records so that the no. of records displayed on a page can always be 10(these blank lines will facilitate the management to note down the temporary employees who worked for the department but are not part of the department).
    I am using a tabular form with group above layout.
    The report layout is as follows:
    Department : FINANCE & ADMINISTRATION
    Employee Name | Employee Number |
    1 Jim | 1234 | _________________
    2 John | 5678 |__________________
    3 blank
    4 blank
    5
    6
    7
    8
    9
    10 balnk
    Supervisor's Sign:______________________
    Note: the no. of blank lines should be inserted dynamically based on the no. of emp. records being printed on the page.
    Any help is greatly appreciated.
    Thanks in advance.
    Kavita.

    Your solution works when I am not limiting the no. of records per page for a department to 10 records and when I want to print blanks lines for the depts that has fewer than 10 employees in it.
    Exactly in my report I have several dept's that has more than 10 emp's. In such cases I'll be printing first 10 in one page and the rest in the next page. Now I want to dynamically print the blank lines in the second page depending on the no. of emp's on that page. I tried to acheive this by using a CS column that reset's at page level but, REPORTS is not letting me use CS column that reset's at page level in a format trigger. I also tried to copy the CS value into a parameter and or to a Place holder column and did not help.
    Any more work around ideas to acheive this?? please help.
    Thanks alot
    Kavita.
    Hi
    Create a column called Serial_No in ur emloyee query like this
    select 1 , empno ,ename from emp;
    Create a summary column on the serial column with the function SUM
    and resetting it to Page
    Display the column in the report by using the text color as white
    so it doesn't display in the report
    I think this should help u i believe
    Sri
    Hi,
    Developing a report for time and attendance record. In this report I am printing all the employees in a department, limiting the no. of records per page to 10.
    I need to insert blank lines at the end of all of the detail records in a page that has less than 10 employee records so that the no. of records displayed on a page can always be 10(these blank lines will facilitate the management to note down the temporary employees who worked for the department but are not part of the department).
    I am using a tabular form with group above layout.
    The report layout is as follows:
    Department : FINANCE & ADMINISTRATION
    Employee Name | Employee Number |
    1 Jim | 1234 | _________________
    2 John | 5678 |__________________
    3 blank
    4 blank
    5
    6
    7
    8
    9
    10 balnk
    Supervisor's Sign:______________________
    Note: the no. of blank lines should be inserted dynamically based on the no. of emp. records being printed on the page.
    Any help is greatly appreciated.
    Thanks in advance.
    Kavita.

  • Auto skip to the next record in a multi-record defined text item

    I know that by setting the autoskip property to true, this
    allows the cursor to navigate to the next item defined in a
    block without having to press return, tab or click w/a mouse
    into the next item. What I would like to do is emulate that
    behavior using a single multiple record text in a block. In
    other words, I want the form to navigate to the next record for
    that item automatically, without having to hit the down-arrow
    key or mouse-click to the next record or whatever.
    Anyone know if that's possible?

    hi
    you can try in this way. you can set block property 'navigation
    style' to 'change record'.

Maybe you are looking for

  • Getting windows domain login name into java application

    Hi, I am looking how can i get user name of windows logged in user. I want to display the user name in the welcome message of the application. The user will be logging into the domain. Please note that I need windows logged in client user name. Pleas

  • PX4-300d is blocked in startup with 95% for 2 days already ! HELP !

    Hi  My PX4-300d 4 disks 1 Tb , has 1 year and gave an alert about disk01 . Made a restart from EMC control panel ( normally this was solved this way in my old Iomega NAS) and now after power up a bar with 95% is presented on LCD and i cant get acess

  • How to use bulk collect into clause

    hi all, i have requirement like this i want to change the query by passing the different table names in oracle database 10gr2. like if i use first i pass the scott.emp table name select * from scott.emp; then i want pass scott.dept table name select

  • The order of elements in an array.

    Hi I have an array whose array.length is 3. I need to add a new element at the the first position in the array. For example the existing values in the array are 1,2,3. Now I need to add 10 in the first position so that the array looks like : 10,1,2,3

  • SQL*Loader-704 Error

    Hi, I'm trying to get a simple PHP page working on the pre-compiled HP-UX Apache Server(Itanium Build), that calls a Unix script which in turn submits a job. In this process SQL*Loader is called, and while it works just fine when I'm in the Unix prom