How to write this trigger

king99

king99

@king99-bh2V1z Oct 23, 2024
Trrigers

😔😔😔😔😔😔😔😔😔

Hi ,

I am not much touch in database programming but have to include trigger for this following table in one of my subprograms so please can anyone suggest a solution for it
as I am days stuck on these for days and not able to get it .

customer(custno,custname,address)
order(orderno,total_cost,date_ordered,date_dispatched,date_paid,status)
orderline(orderno,prodno,quantity)
product(prodno,prodname,proddescr,unit_cost)

We have to write a rule/trigger to update total cost of an order when we change quantity in orderline table .

also we have another trigger to handle situation when product is removed from stock
it should follow two action as
1) update status field for any orders for that product to be seeking alternative products
2) Set the quantity values of orderline containing the product to null .

I would be thanful for the reply .

Replies

Welcome, guest

Join CrazyEngineers to reply, ask questions, and participate in conversations.

CrazyEngineers powered by Jatra Community Platform

  • slashfear

    slashfear

    @slashfear-tSWzpz Apr 18, 2011

    Hey king,

    Alright this is the second time I am asking you please specify the database your using because the way to create a trigger (syntax) differs from database to database, so specify the database on which your working on so that you can get a correct guidance or solution....

    By the way the above task can be easily done in SYBASE database I have done it previoulsy its easy.... I will tell you the logic how to do it if you can specify the database your working on......

    -Arvind
  • king99

    king99

    @king99-bh2V1z Apr 19, 2011

    Hi , I am using Oracle database , trigger is simple related to SQL , very simple database so trigger should be simple !!

    thanks for your response !!