Oracle_ch4_Morrison

Oracle_ch4_Morrison - ORACLE 4: Introduction to PL/SQL...

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

View Full Document Right Arrow Icon
ORACLE – 4: Introduction to PL/SQL Jason C. H. Chen, Ph.D. Professor of MIS School of Business Administration Gonzaga University Spokane, WA 99258 chen@jepson.gonzaga.edu
Background image of page 1

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

View Full DocumentRight Arrow Icon
Business Database Systems (A Guide to Oracle 9i) - Dr. Chen TM Oracle-2 Lesson A Objectives After completing this lesson, you should be able to: f Learn the fundamentals of the PL/SQL programming language f Write and execute PL/SQL programs in SQL*Plus f Understand PL/SQL data type conversion functions f Manipulate character strings in PL/SQL programs f Learn how to debug PL/SQL programs
Background image of page 2
Business Database Systems (A Guide to Oracle 9i) - Dr. Chen TM Oracle-3 Procedural programming Language Uses detailed instructions Processes statements sequentially Combines SQL commands with procedural instructions Used to perform sequential processing using an Oracle database What is PL/SQL?
Background image of page 3

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

View Full DocumentRight Arrow Icon
Business Database Systems (A Guide to Oracle 9i) - Dr. Chen TM Oracle-4 Why PL/SQL? SQL ______ ORACLE (programming language components) ______ Components (reports, forms, graphics etc.) D.B.
Background image of page 4
Business Database Systems (A Guide to Oracle 9i) - Dr. Chen TM Oracle-5 Using SQL Commands in PL/SQL Programs Yes COMMIT, ROLLBACK, SAVEPOINT Organize DML commands into logical transactions Transaction control commands Yes SELECT, INSERT, UPDATE, DELETE Query or change the data in the database tables Data Manipulation Language ( DML ) No CREATE, ALTER, DROP, GRANT, REVOKE Create/change the database structure Date Definition Language ( DDL ) Can Be Used in PL/SQL Examples of Commands Purpose Category
Background image of page 5

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

View Full DocumentRight Arrow Icon
Business Database Systems (A Guide to Oracle 9i) - Dr. Chen TM Oracle-6 Fundamentals of PL/SQL u Full-featured programming language f Execute using Oracle 10 g utilities f SQL*Plus f Forms Builder f An interpreted language f Semicolon ends each command f Reserved words f Type in editor, execute in SQL*Plus
Background image of page 6
Business Database Systems (A Guide to Oracle 9i) - Dr. Chen TM Oracle-7 Table 4-1: PL/SQL command capitalization styles (p.191) s_first_name, faculty_id Lowercase Variable names student, fid Lowercase Database objects SELECT, INSERT Uppercase SQL commands VARCHAR2, NUMBER Uppercase Predefined data types COUNT, TO_DATE Uppercase Built-in functions BEGIN, DECLARE Uppercase Reserved Words Example Capitalization Item Type Student_F_Name, Faculty_ID Mixed case
Background image of page 7

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

View Full DocumentRight Arrow Icon
Business Database Systems (A Guide to Oracle 9i) - Dr. Chen TM Oracle-8 Identifiers and Variables : Rules for Names and Properties From 1 to 30 characters Only alphanumeric characters, and special characters ($ _ #) Must begin with a letter and can not contain blank spaces or hyphens And sure they cannot be reserved words (e.g., BEGIN)
Background image of page 8
Business Database Systems (A Guide to Oracle 9i) - Dr. Chen TM Oracle-9 Variables and Data Types u Variables f Used to store numbers, character strings, dates, and other data values f Avoid using keywords, table names and column names as variable names f Must be declared with data type before use: variable_name data_type_declaration ; e.g., current_s_id NUMBER(6);
Background image of page 9

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

View Full DocumentRight Arrow Icon
Business Database Systems (A Guide to Oracle 9i) - Dr. Chen
Background image of page 10
Image of page 11
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 67

Oracle_ch4_Morrison - ORACLE 4: Introduction to PL/SQL...

This preview shows document pages 1 - 11. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online