|
Re: trigger and function [message #196848 is a reply to message #196819] |
Sun, 08 October 2006 09:24 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
What does it mean, "separate function statement"? I must admit that I don't understand it ...
However, a suggestion: using 'Day' isn't the best idea - it depends on your NLS settings. Your trigger, for example, doesn't fire in Croatia - we don't have 'Sunday' here - it is 'Nedjelja'. Therefore, perhaps you should use a day number instead of day name: TO_CHAR(SYSDATE, 'D'), where 6 and 7 are weekend days.
[EDIT]
I forgot to mention: this will never fire on weekend - SYSDATE can never be Saturday AND Sunday - you, actually, need OR, not AND.
[Updated on: Sun, 08 October 2006 09:25] Report message to a moderator
|
|
|
|
Re: trigger and function [message #197454 is a reply to message #197446] |
Wed, 11 October 2006 05:25 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
So you'd like to have a function AND a trigger? What would you want trigger to do, and what should be function's task?
As I see it, this trigger is enough - a function would be unnecessary. Therefore, tweak the trigger code a little bit (not much; major guidelines from my point of view are in my last post) and it should be just fine.
|
|
|