471,319 Members | 1,600 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,319 software developers and data experts.

trigger compilation errror

19
what is wrong with this code? y it is coming with compilation error?

Expand|Select|Wrap|Line Numbers
  1. create or replace trigger insert_error before insert or update on trig 
  2.              for each row
  3.              declare
  4.                no1 trig.no%type;
  5.               begin
  6.               no1:=:new.no;
  7.               if no1<=100 then
  8.              raise_application_error(-2001,‘number less than 100 is not allowed');
  9.              end if ;
  10.              end;
  11.  
  12. Warning: Trigger created with compilation errors.
  13.  
  14.  
May 6 '08 #1
3 2902
amitpatel66
2,367 Expert 2GB
what is wrong with this code? y it is coming with compilation error?

[code]
create or replace trigger insert_error before insert or update on trig
for each row
declare
no1 trig.no%type;
begin
no1:=:new.no;
if no1<=100 then
raise_application_error(-2001,‘number less than 100 is not allowed');
end if ;
end;

Warning: Trigger created with compilation errors.

[code]
Post the error here for reference using the below command after running your code:

Expand|Select|Wrap|Line Numbers
  1.  
  2. SQL> show error
  3.  
  4.  
May 7 '08 #2
jaanutn
19
Post the error here for reference using the below command after running your code:

Expand|Select|Wrap|Line Numbers
  1.  
  2. SQL> show error
  3.  
  4.  

SQL> show error;
Errors for TRIGGER INSERT_ERROR:

LINE/COL ERROR
-------- -----------------------------------------------------------------
6/31 PLS-00103: Encountered the symbol "?" when expecting one of the
following:
( - + mod not null others <an identifier>
<a double-quoted delimited-identifier> <a bind variable> avg
count current exists max min prior sql stddev sum variance
execute cast trim forall
<a string literal with character set specification>
<a number> <a single-quoted SQL string>
May 7 '08 #3
debasisdas
8,127 Expert 4TB
Check your code and remove the character as mentioned in the error message.
May 7 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Darren | last post: by
6 posts views Thread by Scott CM | last post: by
reply views Thread by JohnO | last post: by
1 post views Thread by deepdata | last post: by
1 post views Thread by umesh049 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.