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: Lensman <Lensman.D_at_gmx.net>
Date: Fri, 30 Aug 2002 09:14:08 +0200
Message-ID: <3d6f1aaa_4@corp-news.newsgroups.com>


Dear Daniel,

no, I'm not a student but someone who got this problem on his desk while not being an expert in Oracle and SQL.

My main working area is building front-ends in php with a little knowledge how to perform a database query and even to insert or update data in the database - not more, not less.

I'm stuck with this task cause our database admin "deserted" his job and my chief is saying "Hey, you can query a database, so you can administrate it!" :-(

So I got lost with a half-finished warehouse-system for which I need the mentioned task!

Hope this is explanation enough!

Lensman

"Daniel Morgan" <dmorgan_at_exesolutions.com> schrieb im Newsbeitrag news:3D6E5D5B.922385B_at_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 Fri Aug 30 2002 - 02:14:08 CDT

Original text of this message

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