09.01.2015 Views

PL/SQL User's Guide and Reference

PL/SQL User's Guide and Reference

PL/SQL User's Guide and Reference

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Support for Object-Oriented Programming............................................................................ 1-21<br />

Better Performance ..................................................................................................................... 1-21<br />

Higher Productivity.................................................................................................................... 1-22<br />

Full Portability............................................................................................................................. 1-23<br />

Tight Integration with <strong>SQL</strong> ....................................................................................................... 1-23<br />

Tight Security .............................................................................................................................. 1-23<br />

2 Fundamentals of <strong>PL</strong>/<strong>SQL</strong><br />

Character Set ........................................................................................................................................ 2-2<br />

Lexical Units......................................................................................................................................... 2-2<br />

Delimiters....................................................................................................................................... 2-3<br />

Identifiers ....................................................................................................................................... 2-4<br />

Literals ............................................................................................................................................ 2-7<br />

Comments.................................................................................................................................... 2-10<br />

Declarations ....................................................................................................................................... 2-11<br />

Using DEFAULT......................................................................................................................... 2-12<br />

Using NOT NULL....................................................................................................................... 2-13<br />

Using %TYPE .............................................................................................................................. 2-13<br />

Using %ROWTYPE..................................................................................................................... 2-14<br />

Restrictions on Declarations...................................................................................................... 2-17<br />

<strong>PL</strong>/<strong>SQL</strong> Naming Conventions........................................................................................................ 2-17<br />

Scope <strong>and</strong> Visibility of <strong>PL</strong>/<strong>SQL</strong> Identifiers ................................................................................. 2-19<br />

Variable Assignment ........................................................................................................................ 2-22<br />

Assigning Boolean Values ......................................................................................................... 2-22<br />

Assigning a <strong>SQL</strong> Query Result to a <strong>PL</strong>/<strong>SQL</strong> Variable.......................................................... 2-23<br />

<strong>PL</strong>/<strong>SQL</strong> Expressions <strong>and</strong> Comparisons ........................................................................................ 2-23<br />

Logical Operators........................................................................................................................ 2-25<br />

Boolean Expressions................................................................................................................... 2-28<br />

CASE Expressions....................................................................................................................... 2-31<br />

H<strong>and</strong>ling Null Values in Comparisons <strong>and</strong> Conditional Statements................................. 2-33<br />

Built-In Functions ............................................................................................................................. 2-35<br />

3 <strong>PL</strong>/<strong>SQL</strong> Datatypes<br />

Predefined Datatypes ......................................................................................................................... 3-2<br />

Number Types............................................................................................................................... 3-3<br />

iv

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!