Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

A trigger to give a 10 per cent discount to a regular customer

3128080Dec 17 2015 — edited Dec 17 2015

Hi,

I am trying to create a trigger to give a discount of 10% of the field 'totalCost' in the bookings table, if the 'statusname' is regular in the Passengers table. Below is what I have come up with so far. But I know its wrong. Can you please help?

create or replace TRIGGER Ten_Percent_Discount

BEFORE UPDATE ON Bookings

FOR EACH ROW

BEGIN

UPDATE Bookings b

SET b.TotalCost = 0.10 * TotalCost

WHERE Passengers.StatusName = 'Regular';

END;

Thanks,

Fareedh

This post has been answered by PamNL on Dec 17 2015
Jump to Answer

Comments

  1. resize one table to required size
  2. us Ctrl+A to select all
  3. use Ctrl+mouse_click to deselect table created at step 1), and again use Ctrl+mouse_click to select it
  4. use menu Edit to resize other tables
    Having all tables with the same size is not that good - they have different number and types of elements. You need to play with level of details :
  5. create subvie
  6. put objects on it
  7. create display(s)
  8. set level of details - "Names Only" is the smallest presentation
  9. resize to vizible - in Layou menu
  10. do auto-layout, tune it manually if needed
    Display_1.png
Rajesh Manivannan

This helps Philip..I used menu Edit to resize other tables by selecting "Align left". Looks great now
Same way is there any short cut to allign the Foreign Key relationship labels? I tried selecting all relationship label in subview and tried to align towards left by selecting "Align Left", but its not responding. Please advise
Regards,
Rajesh

1 - 2
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jan 14 2016
Added on Dec 17 2015
23 comments
4,476 views