Home » SQL & PL/SQL » SQL & PL/SQL » mutating error problem
mutating error problem [message #267853] Sat, 15 September 2007 13:49 Go to next message
ashish2345
Messages: 50
Registered: September 2007
Member
Hi i tried following mutating error problem what i did
i


CREATE OR REPLACE FUNCTION calcnt
RETURN BOOLEAN
IS
vcnt number;
BEGIN
SELECT count(empno) into vcnt
from emp
where job='PRESIDENT';
return true;
EXCEPTION
when no_data_found then
return false;
end calcnt;
/
var fcnt number // declaring the bind variable




CREATE OR REPLACE TRIGGER onepres
BEFORE UPDATE OR INSERT of job
ON emp
FOR EACH ROW
DECLARE
cnt number;
BEGIN
cnt:=:fcnt;
if(cnt>1)
then
raise_application_error(-20987,'Only one president can be present');
end if;
end;
/
trigger not being created giving following error
LINE/COL ERROR
-------- --------------------------------------------------------
4/10 PLS-00049: bad bind variable 'FCNT'
Re: mutating error problem [message #267854 is a reply to message #267853] Sat, 15 September 2007 14:19 Go to previous messageGo to next message
BlackSwan
Messages: 25046
Registered: January 2009
Location: SoCal
Senior Member
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:2444907911913
Re: mutating error problem [message #267855 is a reply to message #267854] Sat, 15 September 2007 14:24 Go to previous messageGo to next message
ashish2345
Messages: 50
Registered: September 2007
Member
thanks but plz tell how to use them in trriger or how to make trriger with bind or without bind
Re: mutating error problem [message #267862 is a reply to message #267853] Sat, 15 September 2007 16:46 Go to previous messageGo to next message
BlackSwan
Messages: 25046
Registered: January 2009
Location: SoCal
Senior Member
Based upon you brief posting history, it appears you've been struggling mightily since starting your class a couple of weeks ago.

Too bad for us you don't read & follow the posting guidelines as stated in the #1 STICKY post at top of this forum.

You might want to consider Reading The Fine Manuals found at http://tahiti.oracle.com; including the PL/SQL Reference Manual.

http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14261/toc.htm
Re: mutating error problem [message #267878 is a reply to message #267853] Sat, 15 September 2007 23:48 Go to previous message
Barbara Boehmer
Messages: 8635
Registered: November 2002
Location: California, USA
Senior Member
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:7144179386439
Previous Topic: complex analyzing for this code
Next Topic: conversion
Goto Forum:
  


Current Time: Thu Dec 08 08:39:44 CST 2016

Total time taken to generate the page: 0.11840 seconds