Home » SQL & PL/SQL » SQL & PL/SQL » ORA-00942: table or view does not exist: v$locked_object used in Fucntion
icon5.gif  ORA-00942: table or view does not exist: v$locked_object used in Fucntion [message #232764] Mon, 23 April 2007 04:04 Go to next message
tapaskmanna
Messages: 98
Registered: January 2007
Location: Cyprus,Nicosia
Member

The Query execute in sql prompt but it is giving error, while putting the query in function.
-----------------------------------------------------------------

CREATE OR REPLACE FUNCTION Check_Lock_Mode
(AtAbleName VARCHAR2)
RETURN BOOLEAN
IS
Flocked_Mode NUMBER;
-- Gather the information of your object i.e. table which is locked or not

BEGIN
SELECT COUNT(Locked_Mode)
INTO Flocked_Mode
FROM v$Locked_Object a,
User_Objects b
WHERE a.Object_Id = b.Object_Id
AND Upper(b.Object_Name) = AtAbleName;

IF Flocked_Mode > 0 THEN
-- Object Found is Locked

RETURN True;
ELSE
-- Object Found is Not Locked

RETURN False;
END IF;
EXCEPTION
WHEN No_Data_Found THEN
RETURN False;
END Check_Lock_Mode;
--------------------------------------------------------------
Compilation errors for FUNCTION SCOTT.CHECK_LOCK_MODE

Error: PL/SQL: ORA-00942: table or view does not exist
Line: 10
Text: select Count(locked_mode) into flocked_mode from v$locked_object a,user_objects b

Error: PL/SQL: SQL Statement ignored
Line: 10
Text: select Count(locked_mode) into flocked_mode from v$locked_object a,user_objects b

Re: ORA-00942: table or view does not exist: v$locked_object used in Fucntion [message #232768 is a reply to message #232764] Mon, 23 April 2007 04:09 Go to previous messageGo to next message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
Read this: http://asktom.oracle.com/tkyte/Misc/RolesAndProcedures.html

MHE
Re: ORA-00942: table or view does not exist: v$locked_object used in Fucntion [message #232946 is a reply to message #232764] Tue, 24 April 2007 04:01 Go to previous message
seraphstream
Messages: 8
Registered: March 2007
Junior Member
For this oracle errors you can see also:

All Oracle Errors Messages

bye
Previous Topic: Grant Privileges on schema
Next Topic: insert and update in single query
Goto Forum:
  


Current Time: Thu Dec 08 00:30:37 CST 2016

Total time taken to generate the page: 0.07206 seconds