Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
blammo04
Starting Member
7 Posts |
Posted - 2009-11-19 : 11:37:17
|
| I am trying to use a trigger to generate a late fee from two dates. If the return date is passed the planned return date then I need to subtract those days and multiply by 100 and then UPDATE the latefee column with the new latefee amount charged.I keep getting a compilation error with this.....SQL> CREATE OR REPLACE TRIGGER latefree 2 BEFORE INSERT OR UPDATE OF actualreturn,plannedreturn ON charters 3 FOR EACH ROW 4 DECLARE late number(8,2); 5 BEGIN 6 IF(:new.actualreturn) > plannedreturn THEN 7 late=(actualreturn-plannedreturn)*100; 8 UPDATE Charters 9 SET latefee = late; 10 END IF; 11 END; 12 ; 13 /Warning: Trigger created with compilation errors. |
|
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2009-11-19 : 11:41:01
|
| This is a Microsoft SQL Server Forum, you may need to look elsewhere for help.www.dbforums.comJimEveryday I learn something that somebody else already knew |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2009-11-19 : 11:41:38
|
| You didn't answer my question in the other topic. Are you using Microsoft SQL Server or some other database platform? Your syntax isn't valid T-SQL which leads me to believe you aren't using Microsoft SQL Server. SQLTeam is for Microsoft SQL Server. Other technologies have their own web sites. Dbforums.com covers many different dbms platforms, so you may want to try there instead.Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/Subscribe to my blog"Let's begin with the premise that everything you've done up until this point is wrong." |
 |
|
|
blammo04
Starting Member
7 Posts |
Posted - 2009-11-19 : 11:50:23
|
| its oracle sql plus, sorry if i bothered you guys..... |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|
|