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 -> Re: Problem with Trigger and function

Re: Problem with Trigger and function

From: Daniel Morgan <dmorgan_at_exesolutions.com>
Date: Thu, 29 Aug 2002 17:44:21 GMT
Message-ID: <3D6E5D5B.922385B@exesolutions.com>


Lensman wrote:

> 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)
>
> a) 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.
>
> b) 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

The following is written assuming you are a student, please correct my misunderstanding if that is not the case.

Do you really expect someone else to do your homework for you?

Do you expect that you will learn something, anything, if we save you from the heavy lifting required to learn the subject?

And finally, do you think any of us would want to work with you when you get out of school when you didn't put in the effort to learn this yourself?

You make an effort, post your code, and someone will gladly give you pointers if you run into a problem. But based on the above it appears the sum total of your effort consists of shrugging your shoulders and posting to a web site.

Daniel Morgan Received on Thu Aug 29 2002 - 12:44:21 CDT

Original text of this message

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