Example of control statements in Oracle

Source: Internet
Author: User
Declare Grade varchar2 (2 ); Begin Grade: = '& Grade' ; Case      When Grade = 'A'   Then Dbms_output.put_line ( 'Excellent' ); When Grade = 'B'   Then Dbms_output.put_line ( 'Excellent' ); When Grade = 'C'   Then Dbms_output.put_line ('Good' ); When Grade = 'D'   Then Dbms_output.put_line ( 'Average' ); When Grade = 'E'   Then Dbms_output.put_line ( 'Bad' ); Else Dbms_output.put_line ( 'No score' ); End   Case ; End ;/ Begin Loop If & Amp; marks> 60 Then Dbms_output.put_line ( 'The student passed' ); Exit ; End   If ; End Loop; End ;/ Declare Monthly_value number: = 0; daily_value number: = 0; Begin    While Monthly_value <= 4000 loop monthly_value: = daily_value * 31; daily_value: = daily_value + 10; dbms_output.put_line ( 'Daily sales volume :' | Daily_value ); End Loop; dbms_output.put_line ( 'Monthly sales volume :' | Monthly_value ); End ;
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.