Re: Newbie forms 3.0 question

From: pconnors on BIX <pconnors_at_BIX.com>
Date: 24 Mar 95 02:38:52 GMT
Message-ID: <pconnors.796012732_at_BIX.com>


ksilverstein_at_crs.stjude.org writes:

>I'm trying to develop an inventory tracking application using Oracle forms 3.0
>running under VMS. I have an inventory table that looks like:
>table inventory (
> barcode varchar2(30),
> amount number,
> location_id number).
 

>The barcode system uses the VMS mailbox facility for interprocess
>communication. I've written a user exit that gets the barcodes from the
>mailbox as they are scanned and returns the value to forms.
 

>I would like the form to display rows with the information about each item
>removed from inventory. My question is: must I use a block without a base
>table to do this and perform each row query in a trigger as the barcode is
>retrieved and then write my own ON_UPDATE trigger to update the inventory to
>reflect the removal of the item or is there some way to use the base table
>query/update triggers built into ORACLE that I'm missing?

You should be able to do a key-startup trigger that, in a loop, enters query mode, executes the user exit to fill the query criteria, then executes the query.

This would allow you to use a base table block.

My assumptions about the user exit are that it can feed you one barcode on demand, reject bad barcodes, and send a signal to your form which says "end of file".

trigger: key-startup
(navigate to the correct block)
declare
  signal char(1);
loop
  signal := get_barcode; --user exit.
  if signal = 0
    raise (no_more_barcode); -- user defined exception   end if
  if signal = 1

    null                      -- invalid barcode;
  end if;
  if signal = 2 then          -- good_barcode;
     :form.database_key := barcode;
     execute_query;

  end if;
exception
  when no_more_barcode then
    message "All barcode retrieved";
end

(As I review this, I notice that I forgot to declare the  following - and my mail editor is quite primitive)  barcode char(30) -- the barcode buffer
 no_more_barcode exception.

  Note that this is, at best, PL/SQL pseudo-code (I'm not at   work, but my Oracle system is), but it should give you a direction   (right or wrong - critiques welcome) to go with this.

   Good luck.
   (let us know how you finally do it)
   -pat connors Received on Fri Mar 24 1995 - 03:38:52 CET

Original text of this message