{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

ch02 - P L S Q L Oracle10g Developer PL/SQL Programming...

Info iconThis preview shows pages 1–15. Sign up to view the full content.

View Full Document Right Arrow Icon
P L / S Q L Oracle10 g Developer: PL/SQL Programming Chapter 2 Basic PL/SQL Block Structures
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
P L / S Q L Oracle10g Developer: PL/SQL Programming 2 Chapter Objectives After completing this lesson, you should be able to understand: Programming fundamentals The PL/SQL block How to define and declare variables How to initialize variables The NOT NULL and CONSTANT variable options
Background image of page 2
P L / S Q L Chapter Objectives (continued) After completing this lesson, you should be able to understand (continued): How to perform calculations with variables The use of SQL single-row functions in PL/SQL statements Decision structures: IF-THEN and CASE Looping actions SQL*Plus bind variables Oracle10g Developer: PL/SQL Programming 3
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
P L / S Q L Oracle10g Developer: PL/SQL Programming 4 Program Logic Flow Identify sequence of actions needed prior to coding Every program has a sequence of actions Identifying the needed actions prior to coding is important The initial layout of steps does not involve any coding
Background image of page 4
P L / S Q L Oracle10g Developer: PL/SQL Programming 5 Flowcharting - Search for Coffee Products
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
P L / S Q L Decision Structures Program typically include decision structures that outline different sequences of events depending on a question determined at run time. Oracle10g Developer: PL/SQL Programming 6
Background image of page 6
P L / S Q L Flowchart Use a flowchart to visually represent the sequence of actions Using a diamond shape to indicate decision process and a square shape for other actions Formal flowcharting includes a great varieties of symbols and standardized formatting. But it is not the intent of this class Oracle10g Developer: PL/SQL Programming 7
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
P L / S Q L Oracle10g Developer: PL/SQL Programming 8 Decision Structures
Background image of page 8
P L / S Q L Looping Structures Many programs use a looping structure to repeat actions Oracle10g Developer: PL/SQL Programming 9
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
P L / S Q L Oracle10g Developer: PL/SQL Programming 10 Looping Structures
Background image of page 10
P L / S Q L Quick Quiz 1. What type of structure do programmers use to repeat actions? Answer: Loops 2. What type of structure is used to determine what actions occur at run time? Answer: Decision structure 3. What method is used to graphically display the sequence of actions in a program? Answer: Flowcharting Oracle10g Developer: PL/SQL Programming 11
Background image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
P L / S Q L Oracle10g Developer: PL/SQL Programming 12 PL/SQL Block Questions What is a block? What are the different segments of a block? How does data get into a block? How are different data types handled?
Background image of page 12
P L / S Q L Anonymous Blocks Blocks of code that are not stored for reuse and, as far as the Oracle server is concerned, no longer exist after being executed. Oracle10g Developer: PL/SQL Programming 13
Background image of page 13

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
P L / S Q L Oracle10g Developer: PL/SQL Programming 14 PL/SQL Block Structure DECLARE – create variables, cursors, and types BEGIN – SQL, logic, loops, assignment statements EXCEPTION – error handling END – close the block A block is always closed with an END; statement.
Background image of page 14
Image of page 15
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}