Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

EXCEPTION WHEN NODATAFOUND

Status
Not open for further replies.

cfcProgrammer

Programmer
Mar 1, 2006
88
CA
Hello,

I am trying to use more than one exception in my exception handler but the Stored Procedure will not compile.

I am getting "PLS-00103: Encountered the symbol "WHEN" when expecting one of the following: * & = - + ; < / > at in is mod not rem <an exponent (**)> <> or != or ~= >= <= <> and or like between ||

I am sure it is something simple but being new to PL/SQL it's causing me some grief.. if anyone can help it would be greatly appreciated.

Code:
SELECT  D.CANCEL_DATE 
INTO V_CANCEL_DATE
FROM DRUG_CARD D, CASE C
WHERE D.CASE_ID = C.CASE_ID 
AND C.FILE_NO = P_FILE_NO
AND D.CANCEL_DATE = (SELECT MAX(CANCEL_DATE)
		     FROM DRUG_CARD D1,
		CASE C1
		WHERE D1.CASE_ID = C1.CASE_ID 
		AND C1.FILE_NO = P_FILE_NO);
EXCEPTION 
WHEN NODATAFOUND THEN
 P_PROCEED := 1	
WHEN OTHERS THEN
 INTRETVAL := -9000; --GENERAL DATABASE ERROR
 P_ERROR_CODE := SQLCODE;
 P_ERROR_DESC := SQLERRM;
 

You need a semi-colon here:

P_PROCEED := 1;

[3eyes]

----------------------------------------------------------------------------
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
 
OH MY GOSH!!!! You can just imagine what kind of Monday morning I am having... :) YIKES!!! Thank you and sorry for having you waste your time on something so simple...

tks again

I am now getting an error of ... nodatafound must be declared???
 
Please do not respond... this morning has been rather terrible... I think I am having a NO_DATA_FOUND error in my head... :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top