Abstract Data Types - PowerPoint PPT Presentation

1 / 10
About This Presentation
Title:

Abstract Data Types

Description:

You may DROP type or recreate the type using. CREATE OR REPLACE statement ... Operation delimiter. Assignment operator. Marina G. Erechtchoukova. 5 ... – PowerPoint PPT presentation

Number of Views:19
Avg rating:3.0/5.0
Slides: 11
Provided by: atkin2
Category:

less

Transcript and Presenter's Notes

Title: Abstract Data Types


1
Abstract Data Types
  • PL/SQL for Method Description

2
Getting Started
  • Change settings
  • SET SERVEROUTPUT ON
  • Specify CREATE TYPE AS OBJECT statement
  • Statement is ended by
  • Type / under SQLPLUS prompt to execute the
    statement

3
Getting Errors
  • If you get
  • WarningType created with compilation errors.
  • Under SQLPlus prompt type in
  • SQLgt Show errors
  • All errors are displayed
  • You may DROP type or recreate the type using
  • CREATE OR REPLACE statement

4
Basic Symbols in PL/SQL
5
Basic Structure of Method Implementation
  • IS
  • Declaration
  • BEGIN
  • Executable code
  • END
  • END

6
Declaration
  • Contains method private variables
  • Each variable has a name and type
  • It is possible to assign initial value
  • result integer 0

7
Method Arguments
  • Argument role
  • IN argument the value must be specified when
    the method is called
  • OUT argument returns the value
  • IN OUT argument does both passes the value to
    the methods and returns the value
  • Argument description
  • Name Role Type

8
Conditional Logic
  • IF condition (is true) THEN
  • BEGIN
  • END
  • ELSE
  • BEGIN
  • END
  • END IF

9
SELECT in PL/SQL
  • Similar to SELECT in SQLJ
  • Declare a variable var
  • SELECT something INTO var
  • FROM Table
  • WHERE qualification

10
Loops
  • The condition is checked at the beginning
  • WHILE (Xlt10) LOOP
  • XX1
  • END LOOP
  • Fixed number of iterations
  • FOR i IN 1100 LOOP
  • END LOOP
Write a Comment
User Comments (0)
About PowerShow.com