Home » SQL & PL/SQL » SQL & PL/SQL » SQL Questions
SQL Questions [message #244] Thu, 31 January 2002 15:31 Go to next message
Hammamur
Messages: 1
Registered: January 2002
Junior Member
Hi, I have a few sql questions.

1) I want to update the field of one table after a user enters something in a another tabele. e.g.

In the Products table there is field called stock count. I want this field to be decremented after a field called quantity sold is updated in the sales order table.

2) How can you restrict/check that a user has enterd a valid id number. e.g.

I have a customer table, which has a key field called customer number. When sales order information is enterd in the sales order table, there is a customer number field whcih needs to be also entered. How can I check that a user has entered a customer that exists in the customer table?

Thank you very much.
Re: SQL Questions [message #251 is a reply to message #244] Fri, 01 February 2002 00:32 Go to previous message
Mike
Messages: 417
Registered: September 1998
Senior Member
You can do this using triggers.

To learn how triggers work have a look at:
http://technet.oracle.com/docs/products/oracle8i/doc_library/817_doc/appdev.817/a76939/adg13trg.htm
Previous Topic: Difficulty Framing a Query
Next Topic: nth record from a sorted output of a table
Goto Forum:
  


Current Time: Thu Jul 02 11:32:36 CDT 2020