| ashish |
Posted: Jan 03, 2008 06:10:27 AM |
Total Post: 14
Joined: Dec, 2007
|
i have started learning trigger from complete referece oracle 9i(oracle press).
As the book says i write trigger but when i m trying to run it, it gives TRIGGER CREATED,COMPILATION ERROR.
i tried too much to remove compilation error. plz help me. |
|
|
Murtuja |
| Posted: Jan 03, 2008 06:49:48 AM | |
|
Total Post: 843
Joined: Jan, 2006
|
Can you plz post code here ?
|
|
|
|
|
Mohammed Taj |
| Posted: Jan 03, 2008 07:39:36 AM | |
|
Total Post: 746
Joined: Jul, 2007
|
Again run your trigger when you get complation error then put below command on sql prompt and post here output with code.
SQL>SHOW ERROR
|
|
|
|
|
Vish |
| Posted: Jan 03, 2008 01:05:01 PM | |
|
Total Post: 47
Joined: Jan, 2007
|
Make sure that table is there for which you have created Triggers.
Pl. post your code if possible
|
|
|
|
|
ashish |
| Posted: Jan 04, 2008 12:25:15 AM | |
|
Total Post: 14
Joined: Dec, 2007
|
i m putting code here, in witch i m geting trigger created with compilation error...
create or replace trigger secure_emp
before insert on employees
begin
if (To_char(sysdate,'Dy') in ('sat','sun')) or
(To_char(sysdate,'hh24:MI') Not between '08:00' and
'18:00')
Then raise_application_error( - 20500,'you may insert
into employees table only during business hours.');
end if;
end;
/
|
|
|
|
|
Nehru |
| Posted: Jan 04, 2008 07:55:52 AM | |
|
Total Post: 45
Joined: Jul, 2007
|
Hi,
Your Trigger seems to be right.
Better to see that Table Exist or not.
Your Code is:
create or replace trigger secure_emp
before insert on emp
begin
----dbms_output.put_line('Trigger is Working');
if ( UPPER(To_char(sysdate,'Dy')) in ('SAT','SUN')) or (To_char(sysdate,'hh24:MI') Not between '08:00' and '18:00') Then
raise_application_error( - 20500,'you may insert into employees table only during business hours.');
end if;
end;
/
any one try the above one.
Guys let me know if am wrong.
Thanks,
Nehru.
|
|
|
|
|
| Time Zone: EDT |
Send this thread to your friend |