Use 'and' to connect two boolean expressions : Boolean « PL SQL Data Types « Oracle PL/SQL Tutorial

Oracle PL/SQL Tutorial
1. Introduction
2. Query Select
3. Set
4. Insert Update Delete
5. Sequences
6. Table
7. Table Joins
8. View
9. Index
10. SQL Data Types
11. Character String Functions
12. Aggregate Functions
13. Date Timestamp Functions
14. Numerical Math Functions
15. Conversion Functions
16. Analytical Functions
17. Miscellaneous Functions
18. Regular Expressions Functions
19. Statistical Functions
20. Linear Regression Functions
21. PL SQL Data Types
22. PL SQL Statements
23. PL SQL Operators
24. PL SQL Programming
25. Cursor
26. Collections
27. Function Procedure Packages
28. Trigger
29. SQL PLUS Session Environment
30. System Tables Data Dictionary
31. System Packages
32. Object Oriented
33. XML
34. Large Objects
35. Transaction
36. User Privilege
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Oracle PL/SQL Tutorial » PL SQL Data Types » Boolean 
21. 13. 6. Use 'and' to connect two boolean expressions
SQL>
SQL> SET ECHO ON
SQL> SET SERVEROUTPUT ON
SQL> DECLARE
  2    age   POSITIVE;
  3
  4    current_year  NATURAL;    --a year of 00 is valid.
  5    current_month POSITIVE;
  6    current_day   POSITIVE;
  7
  8    birth_year    NATURAL;    --a year of 00 is valid.
  9    birth_month   POSITIVE;
 10    birth_day     POSITIVE;
 11
 12  BEGIN
 13
 14    current_year := 2121;
 15    current_month := 12;
 16    current_day := 13;
 17
 18
 19    birth_year := 1224;
 20    birth_month := 12;
 21    birth_day := 12;
 22
 23    IF current_month > birth_month THEN
 24      age := current_year - birth_year;
 25    ELSIF (current_month = birth_monthand (current_day >= birth_dayTHEN
 26      age := current_year - birth_year;
 27    ELSE
 28      age := current_year - birth_year - 1;
 29    END IF;
 30  END;
 31  /


SQL>
21. 13. Boolean
21. 13. 1. BOOLEAN
21. 13. 2. Boolean literals
21. 13. 3. Boolean variables can be assigned either directly by using values TRUE, FALSE, or NULL or as the results of logical expressions
21. 13. 4. How to assign a TRUE value to a variable of type boolean
21. 13. 5. Use BOOLEAN type variable
21. 13. 6. Use 'and' to connect two boolean expressions
21. 13. 7. Demonstrates the effects of NULLs on Boolean expressions
21. 13. 8. Boolean type parameter
21. 13. 9. Exit when a boolean conditioin
21. 13. 10. Logic operator and boolean value
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.