Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Problem with Trigger and function

Problem with Trigger and function

From: Lensman <Lensman.D_at_gmx.net>
Date: Thu, 29 Aug 2002 14:53:19 +0200
Message-ID: <3d6e18a8$1_1@corp-news.newsgroups.com>


Can some Oracle expert help me, please?

The task (two-parted) to be solved:
two tables (orderposition, storage)
in these the following columns (orderposition.quantity, orderposition.status, storage.stored, storage.reserved -> all number, orderposition.artnr = storage.artnr)

  1. this is the more easy part after inserting new data in orderposition, the orderposition.quantity should be added to storage.reserved (like 'storage.reserved + orderposition.quantity) and storage should be updated with this new value - all for orderposition.artnr = storage.artnr.
  2. this seems more tricky to me after updating data in orderposition old.quantity should be compared with new.quantity, if they differ a new variable (diff = old.quantity - new.quantity) should be created. then if orderposition.status is 'N' (new) diff should be subtracted from storage.reserved and the row updated with the new value if orderposition.status is 'D' (delivered) diff should be added to storage.stored and the row updated with the new value

Hope I didn't made too many mistakes in my description so that perhaps an oracle crack out there can help my with my problem cause I'm only beginner with databases (esp. Oracle)

Thx in advance

Lensman Received on Thu Aug 29 2002 - 07:53:19 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US