473,513 Members | 2,654 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Compilation error in the following code

2 New Member
Hi,
can somebody tell me what is wrong with the following stored procedure code..

SQL> CREATE OR REPLACE PROCEDURE DEBIT_ACCOUNT(ACCT_ID IN NUMBER, DEBIT_AMOUNT OUT NUMBER)
2 IS
3 OLD_BAL_AMT NUMBER;
4 NEW_BAL_AMT NUMBER;
5 WITHDRAWN_AMT NUMBER;
6 BEGIN
7 SELECT BAL_AMT INTO OLD_BAL_AMT FROM ACCOUNTS
8 WHERE ACC_NO = ACCT_ID;
9 NEW_BAL_AMT := OLD_BAL_AMT - DEBIT_AMOUNT;
10 IF NEW_BAL_AMT < 0 THEN
11 RAISE E_WITHDRAWN;
12 ELSE
13 UPDATE ACCOUNTS SET BAL_AMT = NEW_BAL_AMT
14 WHERE ACC_NO = ACCT_ID;
15 END IF;
16 COMMIT;
17 EXCEPTION
18 WHEN E_WITHDRAWN THEN
19 -- HANDLE THE ERROR
20 END DEBIT_ACCOUNT;
21 /

Warning: Procedure created with compilation errors.

SQL> show error
Errors for PROCEDURE DEBIT_ACCOUNT:

LINE/COL ERROR
-------- -----------------------------------------------------------------
20/1 PLS-00103: Encountered the symbol "END" when expecting one of the
following:
begin declare exit for goto if loop mod null pragma raise
return select update while <an identifier>
<a double-quoted delimited-identifier> <a bind variable> <<
close current delete fetch lock insert open rollback
savepoint set sql execute commit forall
<a single-quoted SQL string>

Warm Regards,
Abhishek Vyas
Mar 1 '08 #1
1 1321
Stang02GT
1,208 Recognized Expert Top Contributor
The error message is telling you what is wrong with it.

20/1 PLS-00103: Encountered the symbol "END" when expecting one of the
following:
begin declare exit for goto if loop mod null pragma raise
return select update while <an identifier>
<a double-quoted delimited-identifier> <a bind variable> <<
close current delete fetch lock insert open rollback
savepoint set sql execute commit forall
<a single-quoted SQL string>

It's telling you that where you have "END" there should be something else...and it even tells you what else you can put there
Mar 3 '08 #2

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

Similar topics

6
2213
by: Joachim | last post by:
I made some project changes (which seems it doesn't help if I undo) which have created compilation error: " Server Error in '/PCSWebApp1' Application....
2
2802
by: Tommy Vercetti | last post by:
In Visual Studio .NET 2003, I do the following 1) File->New->Project 2) Visual C++ Projects->.NET->Windows Forms Application 3) Project->Add New Item->C++ File 4) Clear the new C++ file and...
2
1794
by: James Zhuo | last post by:
Hi all I've been getting the following compilation error. I should explain the background of the project that i am taking over. This is a project that has been developed by someone else a while...
0
1446
by: James Zhuo | last post by:
hi all I changed the name of the class LoginPage to a different name "LoginPageOne" But the same error gets generated with the Wiliam.Request.LoginPageOne. That pretty much leaves me clueless...
0
1508
by: Jie | last post by:
Does anyone know why I keep having the following error. I have to rebuild the solution every time I run it in design mode. thanks jie Server Error in '/ReapPortal' Application....
0
1264
by: John | last post by:
Hi, I've just rolled out a new version of an ASP.NET application. It runs fine on development and training servers, but on production get the following error when trying to access a page: ...
6
2868
by: Plat | last post by:
I've Googled this for a while, to no avail. Hopefully someone can help me. Maybe I'm using the wrong terminology. Here's the scoop! Let's say I've got a simple *.ASPX page that has a syntax...
3
1848
by: Alistair Lacy | last post by:
Hi I've enable impersonation on my ASP.NET site via the web.config file. When I access the web site using my credentials all works fine. However, when I set the userName and password attribute...
0
1725
by: Stimp | last post by:
I've created an aspx page called HistoryManage.aspx. The page works fine on my local machine but when I load it off the web I get the following strange error... Compilation Error...
1
2793
by: BSand0764 | last post by:
I'm getting an error that I can't seem to resolve. When I compile the Functor related logic in a test program, the files compile and execute properly (see Listing #1). However, when I...
0
7257
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7157
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7379
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7521
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4745
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3232
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3221
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
455
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.