What's the error??

Hello All,
Could some one tell me what is the error in this procedure?
CREATE OR REPLACE PROCEDURE STUDENTS_COUNT AS
TOT NUMBER;
BEGIN
TOT:=0;
SELECT COUNT(*) INTO TOT FROM STUDENTS;
CASE
WHEN TOT = 0 THEN RAISE_APPLICATION_ERROR(-20001,'SORRY!NO STUDENTS FOUND');
WHEN TOT >= 1 AND TOT <= 5 THEN RAISE APPLICATION ERROR(-20001,'ONLY FEW STUDENTS');
WHEN TOT >6 THEN RAISE APPLICATION ERROR(-20001,'GOOD NO OF STUDENTS');
END CASE;
END ;
Thanks
Balaji

Hi,
First of all there in nothing much wrong in your procedure, Except the "When" clause should not be end up by line terminator ( i.e. ";" )
So the correct syntax is :-
CASE
WHEN TOT = 0 THEN RAISE_APPLICATION_ERROR(-20001,'SORRY!NO STUDENTS FOUND')
WHEN TOT >= 1 AND TOT <= 5 THEN RAISE APPLICATION ERROR(-20001,'ONLY FEW STUDENTS')
WHEN TOT >6 THEN RAISE APPLICATION ERROR(-20001,'GOOD NO OF STUDENTS')
END CASE;
More over if you are Using Oracle 8i then oracle does not support Case Expressions in PLSQL. Even SQLs with CASE expression can not be used in PLSQL. But Oracle 9i version do support the usage of CASE Expression in PLSQL.
Sp program your business logic which is supported by you current oracle version.
Regards
Ripudaman

Similar Messages

  • HT1491 Why do i keep getting the message 'Cannot connect to iTunes Store' when I have done every connection I can find? What does the error message (-1202) mean when I am on the iTunes site on my computer?

    Why do i keep getting the message 'Cannot connect to iTunes Store' when I have done every connection I can find? What does the error message (-1202) mean when I am on the iTunes site on my computer?

    Hi Velvalee,
    While there may not be specific information about that error, here is an article of steps for troubleshooting connectivity issues with the iTunes store:
    Can't connect to the iTunes Store
    http://support.apple.com/kb/ts1368
    If that article does not help, there is a link near the bottom for an additional article of advanced troubleshooting.
    Cheers!
    - Ari

  • What Speed could i get & what are the errors

    Hi Everyone.
       I have just joined B.T & yesterday was my last day of the 10 day period.
       Bin looking at my speed it hasnt gone up alot but i keep getting all these errors on the hub info so i would like to ask what are the errors please & does the speed look about right for me thanks Nick..
     Short time for connection as B.T reset the Hub its a v3.0a
    ADSL Line Status
    Connection Information
    Line state:
    Connected
    Connection time:
    1 days, 06:08:58
    Downstream:
    4.931 Mbps
    Upstream:
    1011 Kbps
    ADSL Settings
    VPI/VCI:
    0/38
    Type:
    PPPoA
    Modulation:
    G.992.3 Annex A
    Latency type:
    Interleaved
    Noise margin (Down/Up):
    5.5 dB / 5.8 dB
    Line attenuation (Down/Up):
    46.4 dB / 27.7 dB
    Output power (Down/Up):
    18.5 dBm / 12.6 dBm
    FEC Events (Down/Up):
    126408871 / 3607
    CRC Events (Down/Up):
    102820 / 739
    Loss of Framing (Local/Remote):
    0 / 0
    Loss of Signal (Local/Remote):
    0 / 0
    Loss of Power (Local/Remote):
    0 / 0
    HEC Events (Down/Up):
    91458 / 730
    Error Seconds (Local/Remote):
    32083 / 501

    Just enter your down attenuation here- http://www.kitz.co.uk/adsl/max_speed_calc.php  there are things you can do to reduce errors like connecting to the master socket see if there is a difference, checking your wiring and housing of the hub etc. A explanation of errors here-http://www.kitz.co.uk/adsl/linestats_errors.htm
    Mortgage Advisor 2000-2008
    Green Energy Advisor 2008-2010
    Charity Health Care Provider Advisor 2010-
    I'm alright Jack....

  • What does the error "Unable to lock the following files:" mean?

    What does the error "Unable to lock the following files:" mean? After the colon in this error message, a path to the .icml file is listed. We are using InDesign CS6 with InCopy CS6 (Mac), assignment-based workflow, on a shared server.
    Thanks,
    Gita M

    Sounds like a permissions issue on that server.
    Bob

  • HT2433 what does the error message that says " You are logged out because another computer is using this IP address." mean?

    what does the error message that says " You are logged out because another computer is using this IP address." mean?

    Some other piece of network ghardware on your home LAN (Local Area Network) is using the IP address your Mac is trying to use.
    Reboot both your modem and router, or the Modem/Router combo box you have, and all pieces of networking equipment, computers and printers, you have connected to your LAN.
    If you continue to get that error then it is a bug in OS X or you have your Mac set to a Static IP address that is being handed out by the routers DHCP server to some other device.

  • What is the error code mean? And how to solve it ?Please give your answer. Thanks

    What is the error code  mean? And how to solve it ?Please give your answer. Thanks
    Attachments:
    QQ截图20140403134626.png ‏59 KB

    duplicate post
    LabVIEW Champion . Do more with less code and in less time .

  • What is the error code -5010D

    what is the error code -5010D

    A little Googling seems to indicate a hard drive problem, which sounds right given the symptoms you're seeing. Make sure you've gotten a good backup of everything. The good news is hard drives are cheap and easy to install. You can look up the procedure for your machine at ifixit.com.

  • What is the error code:0x80020042?

    what is the error code:0x80020042?

    This Discussion may be able to offer some enlightenment...
    https://discussions.apple.com/message/11655160#11655160

  • Do you know what means the error -17502

    Do you know what means the error -17502

    Hi Victor,
    What is the version of teststand you're using? How did you first encounter this error? I am trying to replicating this error on my side and would like to know when does this error occur?
    Sometimes it is a possiblity that one of your registry keys located at HKEY_CURRENT_USER»SOFTWARE»NATIONAL INSTRUMENTS »TESTSTAND might have been corrupted. So deleting this folder should help getting rid of the error.
    But since this is an issue, could you post your exported registry keys, so that we can investigate a little further into the issue. To export the registry key entry, right click on TestStand at ( HKEY_CURRENT_USER»SOFTWARE»NATIONAL INSTRUMENTS »TESTSTAND) and select export. Please attach this file here so that we could further take a look at it.
    I hope to hear back from you soon.
    SijinK
    National Instruments.Message Edited by Support on 07-08-2005 11:47 AM

  • What will the error in calltransactionprogram in dat upload?

    hi all
    what will the error in calltransaction program in dat upload, when that flat file field are not match with the ,internel table fields. what are the common errors occured errors while data uploading by using  calltransaction methodfor a transaction.

    if you declare internal table as like quantity field then you will get short dump so you have declare internal table field as like char type.
    and if you mentioned wrong field name with respect screen field then you get valid error message state that
    field name is not input field.
    Thanks
    Seshu

  • What's the error code: 1661 during the IOS5 restore?

    what's the error code: 1661 during the IOS5 restore?

    What country are you in, and are you trying to use another country's store ?

  • . What is the error handling mechanism available in ODI ?

    What is the error handling mechanism available in ODI ?

    We have something called CKM in ODI. It provides option of Static control and Flow control.
    What you need to do is provide the proper constrains / validation rules on the source and target models. When you execute the interface , if any of the rule is violated , those rows goes to E$_ tables also called Error tables.
    Static control example :
    Before executing the interface , you can check the data health of your source model.
    Flow Control example :
    Thus for example you have 100 rows , out of which 10 rows violates the rule , then 90 rows will go to target table and 10 will go to error table. If you correct the values or modify the constraint and re execute the interface , those 10 rows will also go to target.
    Other than that if you mean Error handling in the package or load plan , you can use OK and KO appropriately and route the flow as per your requirement. This is all custom approach , which will vary from design to design.

  • Quickly!Quickly!Quickly!What is the error code mean? And how to solve it ?Please give your answer. Thanks

    What is the error code mean? Why is there an error?And how to solve it ?Please give your answer. Thanks!                                               
    ——1110340026
    Attachments:
    QQ图片20140403140655.jpg ‏108 KB

    Sannieboyyyy wrote:
    Could be me, but your VI is not working properly on the english version of LV. Can I suggest you to try programming in English in the future?
    Yes, it's you. The VI is working just fine, except for some cosmetic issues with the labeling. I don't think is is a valid suggestion to force somebody to program in a specific language, especially since LabVIEW supports all these languages.
    Here are the problems with the VI:
    If you don't want an amplitude of zero, you need to set the amplitude control to a nonzero value before running. Simple as that!. (You could also set the input range for the amplitude control to exclude zero or use a case structure to skip certain code if the amplitude is zero).
    You could also wire the error output to an indicator so it simply displays the errors, but keeps running.
    Your while loop is currently useless. You can delete it and the program function will not change. Use a stop button at the loop condition.
    Your while loop needs some timing so it runs at a reasonable rate. Either add a small wait or configure the signal generation to "simulate acquisition timing" instead of "run as fast as possible".
    LabVIEW Champion . Do more with less code and in less time .

  • HT201210 what is the error 12 in itunes ?

    what is the error 12 in itunes ?

    There is some troubleshooting for 0cE8 error codes on this page, which you could you see if it helps fix it : http://support.apple.com/kb/TS3221

  • What does the error code 0x80090318 mean connecting to IStore?

    What does the error code 0x80090318 mean connecting to IStore?

    I think the problem was using a WPA2 network rather than a WPA network. When I tried connecting to a WPA network, everything went fine.

Maybe you are looking for

  • Manual rebate condition exclusion not refreshed after redetermination of it

    Hi Experts. I am working with CRM 4.0. Lately, we realized there is an error occurring in the price deternination: The condition exclusion for manual rebate condition is not refreshed after redetermination of the product. There is missing a price val

  • GI - GR relationship tables.........?

    Dear all,    I want to track the status of STO ( from STO -GI-GR ) status in one report. From EKBE , I get the PO history, So I am fetching data upto GR from there. It gives the relationship between STO and GI , STO and GR etc. But I want to relate G

  • Reg:Using Two Table controls in one screen

    Dear All,      I created two tables in a screen such that both the table fields are of Input fields type .I created first table which will accept the inputs and below it I created another Table which is also of Input field type.But when  I execute th

  • Is it possible to downconvert from indesign CS3 to CS? (not CS2!)

    it is possible to CS2.. but one of editors only has CS and does not want to upgrade :-( want can be do?

  • Are networking problems all a matter of security settings?

    After attempting in every possible way to resolve the various networking and airport issues discussed in this forum, I seemingly resolved all of them by switching security from WPA/WPA2 to WEP. As soon as I reset my routers to reflect that, everythin