Re: Trigger Problem, Forms 9i
Date: 20 Mar 2004 03:28:31 -0800
Message-ID: <32fe19ad.0403200328.196b7d9c_at_posting.google.com>
"Johnasc" <news_at_news.net> wrote in message news:<bKK6c.542$_r2.9_at_newsfep3-gui.server.ntli.net>...
> Hi all,
>
> We are running Oracle forms at my University and we have a lot of
> configuration problems which vary from machine to machine. I cannot get the
> trigger below tro run (the form loads, the trigger does nothing and no error
> is displayed). I would appreciate it if someone could tell me if the problem
> lies with my trigger code or elsewhere:
>
> The aim is to populate a listbox at runtime with the result set of a query:
>
> [ ... ]
> -- Populate the record group with records from the database
> error_code := Populate_Group(record_group_id);
>
> -- If the query succeeded
> IF error_code <> 0 THEN
>
> -- Clear the list of its current items, if any
> CLEAR_LIST('PROJECTNO');
>
> -- Close any open queries before populating the list
> ABORT_QUERY();
>
> -- Populate the list with the record group
> POPULATE_LIST('PROJECTNO', record_group_id);
>
> END IF;
>
> END;
>
> Thanks in advance,
>
> Johnasc
My docu (Forms 5) says:
.----------------------------------------------------------- : POPULATE_GROUP_WITH_QUERY built-in : : Populates a record group with the given query. The record group is : cleared and rows that are fetched replace any existing rows in the : record group. : : If the SELECT statement fails, Form Builder returns an ORACLE error: number. If the query is successful, this built-in returns 0 (zero). :
'-----------------------------------------------------------
So your code needs to be the other way round
- If the query succeeded
IF error_code = 0
THEN
- Populate the list .. ... ELSE ... some error handling code END IF;
Hint: Try to trace your Execution-Flow in the triggers
Either with a debugger (maybe tough in a 3 Tier application) or add some Messages to the code:
Message('Executing "if error_code = 0" part');
- and a second time to force the message poping up Message('Executing "if error_code = 0" part');
HTH, Rolf Received on Sat Mar 20 2004 - 12:28:31 CET