The Code-Bin
Links
Home
Add your code!
All Listings
About
Latest Entry
Featured Scripts
Author's Website
Latest Entries
FFMPEG Thumbnail Scr...
PHP, 0.8KB
Jul. 29, 10:24pm
John
Z80 Assembler, 190 bytes
Feb. 17, 3:36am
John
Z80 Assembler, 176 bytes
Sep. 13, 2:19am
John
Z80 Assembler, 77 bytes
Sep. 13, 2:18am
John
Z80 Assembler, 209 bytes
Sep. 13, 2:17am
untitled SQL Code
Posted by: SQL | April 15, 2010 @ 9:52am
SQL Code
[
Download
]
Writing a trigger that basicly every time a sale is over 100 it gives a 10% discount, but I keep getting errors and hit a wall basicly , any help appeciated :) {code} create or replace trigger Date_Constraint_Trigger before insert on Sales_book FOR EACH ROW declare discount exception; begin if (:new.Scost > 100 ) then raise discount; end if; exception when discount then UPDATE Set Sales_book.Scost = Sales_book.Scost * .9; dbms_output.put_line('Discount Added.'); when others then rollback work; end; {code}
Syntax Highlighting
[
Open in new window
]
Author Comments
SQL
Rating
4.71 / 8
58 Votes
http://codebin.yi.org/590
page generated in 0.00 seconds