Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2010

    Question Unanswered: Oracle Forms Trigger Problem

    Hi All

    I am newbie here. I have a little problem while developing Oracle Application.
    I am using Oracle Forms 6i Release 2 with Oracle Database 10g (10.2) on Windows XP Professinal.

    I am calculating ID for the Bank using following queries

    Select (max(nvl(Bank_ID, 0)+1) into :Bank_ID from Bank;

    It is working fine but it does not displays it or displays it wrongly
    in the Oracle Form field named "Bank_ID" type "Number",
    when I used it in the "WHEN NEW Record Instance" at Block Level.

    At Form Level, I have used "When New Form instance" trigger
    where I have used "Execute Query;" and "Last_Record;".

    When I have used the above conditions then it displays the New Record No e.g. 4 at the beginning of record e.g. 1 instead of displaying 1.

    All I want is to display this record no when I press the next record buton from the default menu bar, at this point it must populate the bank_id field with this new record no and go to next text field of form.

    Thanks in Advance.

    Kind Regards

  2. #2
    Join Date
    Jan 2004
    Croatia, Europe
    Provided Answers: 5
    "MAX + 1" might cause problems in multi-user environment, because two (or more) users might fetch the same value. If there's any kind of "uniqueness" (unique index, primary key) applied to the BANK_ID column, an error would be raised. Therefore, perhaps you could consider use of SEQUENCES instead.

    As of your question: WHEN-NEW-RECORD-INSTANCE trigger should, probably, be WHEN-CREATE-RECORD one.

  3. #3
    Join Date
    Sep 2010

    Thumbs up Oracle Forms Trigger Problem

    Dear LittleFoot (Lost Boy)

    Thanks Buddy for the When-Create-Record guidance/hint as I was
    confusing / messing it with when new record instance.

    As far as the MAX +1 is concerned, it is working fine as it is a single user application and there is not much records to handle.

    Once again Thanks

    Kind Regards

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts