Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2008
    Posts
    33

    Unanswered: oracle 10.2.0.1 List of Values

    greetings to all,
    i really need some assistance with creating a list of values for a oracle form. i need to find out this. lets say u have a form used to insert employee details and u create a list of values for employee number. when populating the form, is it possible to fill in other information like employee name and title by selecting just the employee number from the list of values? any assistance or advice i could get would be appreciated.
    thanks in advance

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    There are a few options.

    One is to select all information within the Record Group's query (LoV is based on that record group). I guess that it makes sense to display those values in LoV (because, users love to see names, addresses etc. and not only employee's numbers). Something like this:
    Code:
    select empno, ename, address, tel_num
    from emp
    where ...
    In LoV, map all those values to block items. It doesn't matter if some of them are not database items.

    There's also an option to select and map certain values to block items, but not display them (as those information aren't interesting to users). In that case, set those LoV item's size to 0 (zero).

    Another way to populate block items based on employee number fetched from a LoV is in the WHEN-VALIDATE-ITEM trigger on employee number item. Simply
    Code:
    select ename, address, tel_num
      into :blk.ename, :blk.address, :blk.tel_num
    from emp
    where ename = :blk.ename
    The same query should then be used in a POST-QUERY block trigger for all non-database items that are to be populated when users query the database (pressing the <Execute query> key).

    That's it, I guess.

  3. #3
    Join Date
    Oct 2008
    Posts
    33

    Thumbs up

    wow..thanks alot..i got it to work using the first method..u rule man!!
    i have another question though..consider a situation where i have a table called Subject with two records example Dance and Drama. when either of these records are chosen is it possible to have a field in another table called Faculity automatically changed to Performing Arts? i hope you understand what i am trying to achieve. am not sure if the second method u proposed is a solution..plz advise..thanks in advance

  4. #4
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    I'm not sure I understand the question ... not the second part of it, actually.

    OK, it is easy to create a LoV which will offer values from the "Subject" table. User selects "Dance", for example.

    What would you want to do now? What does change field in the "Faculty" table to "Performing arts" mean? What is "change"? Update? If so, does it mean that the "Faculty" table contains only one record?

    Because, yes - you can update a table. You'd do that in WHEN-VALIDATE-ITEM trigger, for example. After validating selected value, you'd
    Code:
    update faculty set
      some_field = 'Performing arts'
      where <some_condition>
    However, as I've already said, I don't quite understand the question. Could you explain it once again, please?

Posting Permissions

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