Can I prevent duplicate values entry thru Forms Personalization

We use Oracle Project. While entering key Members on Project Form, we want to prevent users to enter multiple "Project Accountant" within the same project. So essentially there should be only one "Project Accountant" per project. I have sql for this
SELECT 'X'
FROM PA_PROJECT_PLAYERS
WHERE PROJECT_ID = 11494
AND PROJECT_ROLE_TYPE = '1001'
AND ((START_DATE_ACTIVE BETWEEN START_DATE_ACTIVE AND NVL(END_DATE_ACTIVE, START_DATE_ACTIVE + 1))
OR (END_DATE_ACTIVE BETWEEN START_DATE_ACTIVE AND NVL(END_DATE_ACTIVE, END_DATE_ACTIVE + 1))
OR (START_DATE_ACTIVE BETWEEN START_DATE_ACTIVE AND NVL(END_DATE_ACTIVE, START_DATE_ACTIVE + 1)))
AND (PROJECT_PARTY_ID IS NULL OR PROJECT_PARTY_ID != PROJECT_PARTY_ID) ;
But I am not able to figure out how to put this into Forms Personlization. Can someone help.
Thanks
Rakesh

Deekshitulu,
The seat assignment column in your table - is it part of the Primary Key on the table? If so, you can set the "Enforce Primary Key" property on your data block. More than likely, the seat assignment column is not part of your PK, so you will need to perform a check in your When-Validate-Item trigger on the Seat_Assignment column to check if the seat has already been assign to someone else. This is pretty basic stuff, so I'm guessing you are new to Oracle Forms or this is Classwork. Based on your example, I'd say it is class work, therefore, I'm not going to give you a detailed code sample. I'll just give you the basics and let you provide the details. Here goes...
-- When-Validate-Item
-- Check for duplicate seat assignment
DECLARE
   nDummy   NUMBER;
BEGIN
   BEGIN
      SELECT -- some type of count to see if the seat has been assigned already
        INTO nDummy
        FROM chair_assignments
       WHERE seat_number = :my_data_block.seat_number;
   EXCEPTION when no_data_found THEN
       -- Seat is not assigned.  What to do now?
       nDummy := 0;
   END;
   -- Check my Dummy Variable to see if the seat has an assignment record.
   IF nDummy > 0 THEN
      -- UhOh, my seat is already assigned.
      --RAISE and error to stop the form and prevent the double assignment
   END IF;
END;If this is not classwork, I apologize for the assumption and would be happy to elaborate on my answer. If this is classwork, please let me know and if you need me to elaborate on my answer - I'd be happy to. We don't mind helping people learn Oracle we just don't want to do your homework/class assignments for you. :-)
Hope this helps.
Craig...

Similar Messages

  • Prevent duplicate value being entered into a column

    How do we prevent user to enter duplicate value into one of the column of a multiple record block before we commit the form ?
    Can anybody help ?
    Thanks,
    Shu Wen

    Do you want the duplicate to be detected as soon as the item is validated ?
    If so, the only way I have found to do so is to maintain a copy of the contents of the block in a record group. Rather cumbersome and a few triggers needed, but I have one application where I had to do it. I have always found it restrictive that you cannot read values from other records without navigating to them. If anyone has found a better method I would be interested to hear.

  • How to raise an error message when duplicate value is entered in a tabular field column? Basically not allow duplicate value at the form level.

    Hi all,
    I have created a form with one data block MATURED_FD_DTL which looks like below:
    ACCT_FD_NO
    CUST_CODE
    FD_AMT
    FD_INT_BAL
    TDS
    CHQ_NO
    ADD_FD_AMT
    P_SAP_CODE
    P_TYPE
    CREATE TABLE MATURED_FD_DTL
      ACCT_FD_NO    VARCHAR2(17 BYTE)               NOT NULL,
      CUST_CODE     NUMBER(9),
      FD_AMT        NUMBER(15),
      FD_INT_BAL    NUMBER(15),
      TDS           NUMBER(15),
      CHQ_NO        NUMBER(10),
      ADD_FD_AMT    NUMBER(15),
      P_SAP_CODE    NUMBER(10),
      P_TYPE        VARCHAR2(1 BYTE)
    For MATURED_FD_DT.ACCT_FD_NO, Trigger: KEY_NEXT_ITEM, I have written the following code:
    DECLARE
    V1 NUMBER;
    V2 NUMBER;
    BEGIN
    V1:=:MATURED_FD_DTL.ACCT_FD_NO;
    MESSAGE('V1:'||V1);
    MESSAGE(' ');
    END;
         GO_ITEM('MATURED_FD_DTL.CUST_CODE');
    This is just a dummy code.
    When ever i enter the value in the field of ACCT_FD_NO, it pops up a message saying "V1:Value of ACCT_FD_NO",
    So i want to store that value .
    Compare them & if it is egual, it should pop up a message saying duplicate value is entered and must not allow to enter, at form_level.
    So how can I compare the ACCT_FD_NO value between FIRST_RECORD and NEXT_RECORD ??
    Help Me .
    Thank You.
    Oracle Forms 6i.
    Oracle 9i.

    Thank You HamidHelal.
    Actually before posting the code, I went through the first link you have mentioned. I tried also, it is quite tedious procedure, however i dint get the proper result, may be i have done some mistake. Anyways , can you tell me how do i check in database table, if a value exists OR IF VALUE FOUND & then message and raise form trigger failure; something like below.
    IF :MATURED_FD_DTL.ACCT_FD_NO EXISTS
    THEN MESSAGE('YOU HAVE ENTERED AN EXISTING OR DUPLICATE VALUE');
              MESSAGE(' ');
    RAISE FORM_TRIGGER_FAILURE;
    END;
    OR
    IF :MATURED_FD_DTL.ACCT_FD_NO FOUND
    THEN MESSAGE('YOU HAVE ENTERED AN EXISTING OR DUPLICATE VALUE');
              MESSAGE(' ');
    RAISE FORM_TRIGGER_FAILURE;
    END;
    Is there any equivalent in the form in oracle forms 6i?? Please let me know how do i do this??

  • HELP - i can't set field value in a form

    Hi,
    I created a form based on a stored procedure.
    I try to set a field value on this form( the name of the item in the wizard is 'P_GG') from the advanced PL/SQL SECTION in the wizard, and, for exact, in "... before displaying the page..." i wrote:
    p_session.set_value(
    p_block_name => 'DEFAULT',
    p_attribute_name => 'A_P_GG',
    p_value => '20');
    But when I run the form the field is blank
    Thank for everyone reply and help me.
    Simone Mancino

    Dmitry,
    thank u for your reply.
    I tried your solution, but there is another problem. I specified a default value for the form, using the syntax "#myfunction()".
    The first time I run the form, i get the correct value. But whenever i run the form again in the same session, I always get the FIRST value: it looks like the function is not evaluated again. For example, suppose the function is
    return to_char(SYSDATE, 'SS')
    (just to have a random dynamic value);
    you always get the value of the first run, even if you refresh the page.
    Regards
    Simone

  • How can we disable Block Level Trigge using Form Personalization

    Hi,
    I want to disable block level trigger(WHEN-NEW-RECORD-INSTANCE) using forms personalization at responsibility level.
    Can any one please give me the answer.
    it's urgent
    Thanks and Regards,
    Dhana

    No, Firefox is user choice rules over the "wants" of individual websites as far as disabling contextual menus and the keyboard commands.
    Placing a transparent image over the image will keep the less technical user from saving the main image. If they do try to save it all they'll get is the transparent image overlay.

  • Suggest the best method to find the duplicate values entry in the form

    Hi,
    Can u plz suggest a best logic for duplicate checking in forms while entering the data.
    for e.g when we enter empno,empname,sal etc.. details in a base table block,
    empname should not be duplicate. For this purpose for each entry of empname, I am using the logic in such a way that
    it will check from first record to last record in the loop. If entered empname already exists in the block it shows the error message.
    for this purpose I use the system variable system.cursor_record, Name_in function etc..
    But in the case of thousands or lacks of record in the form, Is this logic useful?? Plz suggest a best logic if you have?
    with thanks
    gms

    Hello,
    <p>Here is one solution</p>
    Francois

  • Page level validation to prevent duplicate data entry into the database

    Hello,
    Can anyone please help me out with this issue.
    I have a form with two items based on a table. I already have an item level validation to check for null. Now I would like to create a page level validation to check that duplicate data are not entered into the database. I would like to check the database when the user clicks on ‘Create’ button to ensure they are not inserting duplicate record. If data already exist, then show the error message and redirect them to another page. I am using apex 3.2
    Thanks

    Hi,
    Have you tried writing a PLSQL function to check this?
    I haven't tested this specifically, but something like this should work:
    1) Create a Page Level Validation
    2) Choose PLSQL for the method
    3) Choose Function Returning Boolean for the Type
    For the validation code, you could do something like this:
    DECLARE
        v_cnt number;
    BEGIN
        select count(*)
        into v_cnt
        from
        your_table
        where
        col1 = :P1_field1 AND
        col2 = :P2_field2;
        if v_cnt > 0 then return false;
        else return true;
        end if;
    END;If the query returns false, then your error message will be displayed.
    Not sure how you would go about redirecting after this page though. Maybe just allow the user to try again with another value (in case they made a mistake) or just press a 'cancel' button to finish trying to create a new record.
    Amanda.

  • How to avoid Duplicate values in Oracle forms

    Hello Everyone,
    I am new to Oracle forms, working on Oracle Applications : 12.1.2,
    Here I have a form Receiving Transactions,
    in that I have Lot_Number and quantity columns.
    The purchased items need to be stored in Lot number.
    If 100 quantities purchased then 100 quantities can be stored in single lot number
    i.e
    Lot_Number         Qty
      001                100or 100 quantities can be stored in different lot numbers.
    i.e
    Lot_Number         Qty
      001                50
      002                50(The qty may differ)but not like the following,
    Lot_Number          Qty
      001                 50
      001                 50.For second line,If they selected same lot number as First lot number,
    The error message has to be shown as "Lot number duplicated,Select Different Lot number or update the full qty in original line".
    Can anyone help me to solve this.
    Thank you.
    Regards,
    Gurujothi

    Hi François Degrelle,
    I added the following Plsql in the 'When-validate-Item' block,
    declare
    l_current_number varchar2(80);
    begin     
    l_current_number := :lot_entry.lot_number;
    first_record;
    loop
      if l_current_number = :lot_entry.lot_number then
         message ('Duplicate');
      end if;
      next_record;
    end loop;Its started to check from First record itself and giving the message 'Duplicate',
    How to check from second record?
    when the first record is entered it should not check when the second record is entered it should compare with the First record value and if it is same then it should give message as 'Duplicate'.
    Thank you.

  • How can I pass parameter value into first form?

    hello all
    I have one form called logon.fmx
    I have parameter in that form called "common_home".
    when I run that form browser I need to trasfer the value for parameter "common_home".
    how can I do this?
    From
    Chirag Patel

    Hi all
    1) I am used to config='myconfig' in my application to run the application from browser.
    2) in formsweb.cfg I have add one more parameter like as follows
    otherparams=common_home=c:\chirag\erp
    3) you can add n number of user defined parameter here.
    it is working fine.
    From
    Chirag Patel

  • Can't add new GRUB entries thru /etc/grub.d/40_custom on MacBook Pro

    I am using Arch Linux on my MacBook Pro. The main bootloader is rEFInd, which then loads GRUB (in EFI mode) which in turns loads Linux. Of course rEFInd can also load OS X directly, but I am experimenting because I need OS X to be loaded by GRUB: some buggy hardware requires "outb" commands before booting the OS, and loading OS X through GRUB seems like the most natural way of doing it.
    I am using the automatic script in /boot/grub.d/ to generate the bootloader configuration, so I use the following commands:
    grub-mkconfig > /boot/grub/grub.cfg
    grub-mkstandalone -o boot.efi -d /usr/lib/grub/x86_64-efi -O x86_64-efi --compress=xz /boot/grub/grub.cfg
    They generate a new configuration and to create a new EFI image, which is then copied on a blessed boot partition. I am sure that the changes I make to the configuration file are put into effect, because I can (for instance) modify the kernel parameters for the default image and see the modified entry on the GRUB menu.
    Now I am trying to add a new configuration entry, the usual way would be by modifying /etc/grub.d/40_custom. I add the following lines:
    menuentry 'OS X (on /dev/sda2)' {
    insmod hfsplus
    insmod part_gpt
    set root='hd0,gpt2'
    chainloader /System/Library/CoreServices/boot.efi
    which are added correctly to /boot/grub/grub.cfg after I run grub-mkconfig as shown above. I also generate boot.efi as shown above, too, and I copy it on the boot partition.
    However when I reboot I cannot see the new entry in the GRUB menu. Is there something I am overlooking? Is there some way of troubleshooting GRUB when it's reading the configuration file? I think it may not like the syntax of the new entry I added.
    Last edited by zakk (2014-12-04 20:35:17)

    You should point grub-mkconfig to "your_efi_system_partition"/grub/grub.cfg instead of boot/grub/grub.cfg

  • How can I display a value in a form field

    I have tried using the set_value_as_string and set_value functions functions in query buttons PL/SQL event handler .But then the value is not getting displayed in the field.
    Could I get any help on this ........

    solution removed, because you crossposted.
    Message was edited by:
    Navy_Coder

  • How to Prevent duplicates on Combination of Lookup columns in sharepoint 2010 using infopath 2010 form.

    Hi All,
    I have list with some Lookup columns like  City, Pin, and Text Column Name. All these are required columns.
    Now I want to prevent duplicates while submitting InfoPath form if a Combination of  City,Pin & Name. (like a Composite primary in Database is used.)
    Can some one help me on how to achieve this using InfoPath  2010 Rules, writing  rule in Xpath.
    Thanks in Advance.

    1. Add a secondary data connection to the list where the form will be submitted.
    2. Prior to submit via rules, set the query fields in the above connection: City, Pin & Name with values entered in the form. Query the data source and check if the result has values.
    3. Show error messages accordingly if exists else continue with Submit.
    This post is my own opinion and does not necessarily reflect the opinion or view of Slalom.

  • Prevent duplicate data

    I would like to make sure there are no duplicate data entries in my JSP that populates an Oracle database with a table called MainTable. MainTable has an Id field that is the primary key, ValData with a varchar data type, Fid and Fid2 are number data types. Fid and Fid2 are foreign key values that are taken from another table.
    Id   ValData   Fid   Fid2
    1    abc         34    2
    2    efg          23    34
    3    zeo         25    43Sometimes someone can enter duplicate data and the ValData, Fid and Fid2 will end up like this:
    Id   ValData   Fid   Fid2
    1    abc          34    2
    2    efg           23    34
    3    zeo          25    43
    4    zeo          25    43Is there anything in Java I can implement to prevent duplicate data entry in the above example?

    Thanks,
    It now works after I added unique constraints to each of the fields.
    Google results showed me that ORA-00001 is Oracle's Duplicate message and I added a condition in the SQLException Catch area and it catches all my Duplicate entry attempts and shows message to the user.
    Here is what I have and would like to know if this is an efficient way I am doing this??
    try
    // db stuff
    catch (SQLException sqle)
        String message = sqle.getMessage();  
        if (message.indexOf("ORA-00001") != -1)
            out.println("Duplicate Data entry.");  
        else
          out.println("some other ORA error");  
    }

  • Get the timestamp value in the form of array of 8 bytes, whileretrieving da

    3) How we can get the timestamp value in the form of array of 8 bytes, while retrieving the data?
    4.) How we can pass the 8 byte array to stored procedure? What will the data type of the parameter?

    duplicate post:
    timestamp value in the form of array of 8 bytes

  • How to prevent duplicate submission?

    Hello!
    I have a page for gathering some data:
    private function saveHander():void {
        // Gathering data into database.
    <mx:TextInput id="name" />
    <mx:TextInput id="age" />
    <s:Button id="Submit" label="Submit" click="saveHandler();" />
    When focus on submit button,I click at the button and press the space bar at the same time,saveHander function execute two times.
    How can I prevent duplicate submission? thanks!

    Assuming this is a form you are attempting to save, good UX practice is to disable the form once you begin local form validation (submit button clicked) prior to forming your data packet for save.
    Doing so will prevent the anomaly you are experiencing.
    In other cases where the above practice is not practical, you can setFocus to another component (off the submit button) because as long as the focus remains on the button, depressing the space bar will trigger the mouse event for the button. Research ADA compliance if you want more details.
    HTH. 

Maybe you are looking for

  • Boot Camp & Windows 7 -- "Standard VGA Graphics Adapter" (This is wrong.)

    Hello, I am hoping I can find some help here, I have purged the internet looking for a solution, all to no avail. Heres the situation: I have a 15" mac book pro unibody. 500 gb hdd 4 gb ram 9600m gt graphics Anyways, I decided to install windows 7 on

  • Adobe Flash Player 10.3.181.34 - Not Working?

    Hey, So I have windows 7, 64-bit operating system and I use Mozilla Firefox (32-bit) as my browser. I have yet to try other browsers and I have downloaded the 32-bit version for the use of the flash player. But almost any website that requires flash,

  • Why can't i find an iCloud icon on my computer or my devices

    why can't i find an iCloud icon on my computer or my devices

  • Nokia 5800 GPS Problem

    Hello,  i have an Nokia 5800, and i can´t use the gps with a satellite signal, only with the GPRS. someone can helpme. thanks a lot!!!!!!!!!!!! 

  • Local Purchase Order

    Dear Gurus,                    My SRM version is 5.0 and we are using ECS. when the shopping cart is created and ordered and the complete approvel process is execute successfully: how do i create a Local Purchase order or do i need to use some BADI t