Re: duplicate_record solution sought, or would something else work ??

From: Andrew Tompkins <andrewto_at_kingfish.cse.tek.com>
Date: 1997/03/24
Message-ID: <ANDREWTO.97Mar24085525_at_kingfish.cse.tek.com>#1/1


In article <3331ba33.17120658_at_news.aud.alcatel.com>

   jens_at_deutschware.com (Jens U. Veigel) writes:

>
> Is it possible to sort of dynamically, I guess under the commit button
> to have a when button-pushed-trigger that says if item A or item B is
> only selected then do one record (a regular commit) if Item A and B is
> selected, then create one record with Item A (without item B) , and
> duplicate the entire record (without A, but B instead).
>

Try an ON_INSERT trigger that looks something like:

DECLARE BEGIN         IF <item A selected> THEN

		INSERT INTO <table-name>
		  ( <column-names to be inserted for item A )
		  VALUES ( <values to be inserted for item A );

	END IF;
	IF <item B selected> THEN

		INSERT INTO <table-name>
		  ( <column-names to be inserted for item B )
		  VALUES ( <values to be inserted for item B );

	END IF;

END; Values can be given as constants, form item names of the form :<block-name>.<item-name>, global variable names or local variable names to the program unit. The ON_INSERT trigger should be placed at the block level for the block containing the information to be inserted.

-- 
-------------------------------------------------------
| Andrew G. Tompkins    | #include <disclaimer.std.h> |
| Software Design Eng.  ------------------------------|
| Tektronix, Inc.                                     |
| Phone: (503) 627-5172      fax: (503) 627-5548      |
| email: Andrew.Tompkins_at_tek.com (work)               |
|        andytom_at_teleport.com (home)                  |
| http://www.teleport.com/~andytom/                   |
-------------------------------------------------------
Received on Mon Mar 24 1997 - 00:00:00 CET

Original text of this message