DataBase Logic in Business Applications

Slides:



Advertisements
Similar presentations
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 1.
Advertisements

Copyright © 2004 Pearson Education, Inc.. Chapter 9 More SQL: Assertions, Views, and Programming Techniques.
AN INTRODUCTION TO PL/SQL Mehdi Azarmi 1. Introduction PL/SQL is Oracle's procedural language extension to SQL, the non-procedural relational database.
Chapter 3 : Relational Model
13.5 Representing Data Elements Fields, Records, Blocks Variable-length Data Modifying Records.
Fundamentals, Design, and Implementation, 9/e Chapter 16 Object-Oriented Database Processing.
Mid-term Class Review.
1 Introduction to databases concepts CCIS – IS department Level 4.
SAGE Computing Services Customised Oracle Training Workshops and Consulting Are you making the most of PL/SQL? Hints and tricks and things you may have.
Chapter Oracle Server An Oracle Server consists of an Oracle database (stored data, control and log files.) The Server will support SQL to define.
Database Technical Session By: Prof. Adarsh Patel.
Database Management System Lecture 4 The Relational Database Model- Introduction, Relational Database Concepts.
SQL Structured Query Language Programming Course.
What is a schema ? Schema is a collection of Database Objects. Schema Objects are logical structures created by users to contain, or reference, their data.
Collections Oracle Database PL/SQL 10g Programming Chapter 6.
SQL Fundamentals  SQL: Structured Query Language is a simple and powerful language used to create, access, and manipulate data and structure in the database.
Dynamic SQL Oracle Database PL/SQL 10g Programming Chapter 13.
1/14/2005Yan Huang - CSCI5330 Database Implementation – Storage and File Structure Storage and File Structure II Some of the slides are from slides of.
Chapter 16 Cursors and Exceptions. Chapter Objectives  Determine when an explicit cursor is required  Declare, open, and close an explicit cursor 
Oracle10g Developer: PL/SQL Programming1 Objectives SQL queries within PL/SQL Host or bind variables The %TYPE attribute Include queries and control structures.
Oracle11g: PL/SQL Programming Chapter 3 Handling Data in PL/SQL Blocks.
Mining real world data RDBMS and SQL. Index RDBMS introduction SQL (Structured Query language)
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI Dale Roberts, Lecturer Computer Science, IUPUI
Representing Block & Record Addresses
Introduction to File Processing with PHP. Review of Course Outcomes 1. Implement file reading and writing programs using PHP. 2. Identify file access.
Oracle 9i Collections. Composite types Several variables as single unit ◦ Records  Different datatype variables are combined here  Ex: All fields of.
Lecture # 24 Introduction to SQL Muhammad Emran Database Systems.
CS422 Principles of Database Systems Oracle PL/SQL Chengyu Sun California State University, Los Angeles.
Preface IIntroduction Course Objectives I-2 Oracle Complete Solution I-3 Course Agenda I-4 Tables Used in This Course I-5 The Order Entry Schema I-6 The.
Arrays and Collections
DataBase Logic in Business Applications
DataBase Logic in Business Applications
DataBase Logic in Business Applications
CS322: Database Systems PL/ SQL PL/SQL by Ivan Bayross.
Pl/SQL LANGUAGE MULITPLE CHOICE QUESTION SET-3
Module 11: File Structure
DataBase Logic in Business Applications
DataBase Logic in Business Applications
Collection in PL/SQL.
Database Management Systems 2
© 2014, Mike Murach & Associates, Inc.
© 2014, Mike Murach & Associates, Inc.
© 2014, Mike Murach & Associates, Inc.
Working with Composite Datatypes
Complex Data Types One very important measure of the “goodness” of a PL is the capability of its data types to model the problem space variables Design.
Database.
© 2014, Mike Murach & Associates, Inc.
Ch 3 Synonym.
Chapter 2 Handling Data in PL/SQL Blocks Oracle9i Developer:
Ch 3 Synonym.
© 2014, Mike Murach & Associates, Inc.
© 2014, Mike Murach & Associates, Inc.
© 2014, Mike Murach & Associates, Inc.
© 2014, Mike Murach & Associates, Inc.
PL/SQL week10.
Arrays ICS2O.
Ch 3 Synonym.
Lecture 30: Final Review Wednesday, December 6, 2000.
PL/SQL Declaring Variables.
© 2014, Mike Murach & Associates, Inc.
© 2014, Mike Murach & Associates, Inc.
Lecture 30: Final Review Wednesday, December 10, 2003.
Handling Data in PL/SQL Blocks
© 2014, Mike Murach & Associates, Inc.
Chapter 3 Synonym.
© 2014, Mike Murach & Associates, Inc.
Object – relational database
© 2014, Mike Murach & Associates, Inc.
Database Programming Using Oracle 11g
Database Programming Using Oracle 11g
Presentation transcript:

DataBase Logic in Business Applications Al.I. Cuza University of Iași Faculty of Economics and Business Administration Department of Accounting, Information Systems and Statistics DataBase Logic in Business Applications PL/SQL and Persistent Collections By Marin Fotache & Co.

Collections in Oracle Collections are a fundamental programming ingredient In Oracle, there are three types of collections Associative arrays (index-by tables) Nested tables Variable-length arrays (varrays) All of them can be used in PL/SQL blocks Only the last two can be used for defining persistent types that can be used in object and or table definition (see next slide) Can be used also for loading multiple records from tables (bulk processing)

Types of Oracle Collections Collection type Number of Elements Subscript Type Dense or Sparse Where Created Can Be Object Type Attribute Associative array (or index-by table) Unbounded String or integer Either Only in PL/SQL block No Nested table Integer Starts dense, can become sparse Either in PL/SQL block or at schema level Yes Variable-size array (varray) Bounded Always dense

Collection storage (in memory)

Associative Arrays (1)

Associative Arrays (2) http://www.tutorialspoint.com

Associative Arrays (3) https://oracle-base.com

Nested Table (1) http://www.tutorialspoint.com

Nested Table (2) http://www.tutorialspoint.com

Nested Table (3) https://oracle-base.com

Nested Table (4) https://oracle-base.com/articles/10g/plsql-enhancements-10g#nested_table_enhancements

Varray (1) http://www.tutorialspoint.com

Varray (2) http://www.tutorialspoint.com

Varray (3) http://www.dbstar.com

Varray (4) https://oracle-base.com

Main Collection Methods

Useful Resources on Oracle Collections PL/SQL Tutorial (TutorialsPoint) http://www.tutorialspoint.com/plsql/plsql_collections.htm Steven Feuerstein - Working with Collections, Oracle Magazine, July/August 2012, http://www.oracle.com/technetwork/issue- archive/2012/12-jul/o42plsql-1653077.html Steven Feuerstein - Bulk Processing with BULK COLLECT and FORALL, September/October 2012 http://www.oracle.com/technetwork/issue- archive/2012/12-sep/o52plsql-1709862.html Using PL/SQL Collections and Records https://docs.oracle.com/cd/B28359_01/appdev.111/b283 70/collections.htm

Useful Resources on Oracle Collections (cont.) Fotache et. 2003, Fotache 2009 (in Romanian) - uploaded on FEAA portal) sandip_bhadane - Oracle PL/SQL collections http://www.codeproject.com/Articles/164705/Or acle-PL-SQL-collections Purpose of using different types of PL/SQL collections in Oracle http://stackoverflow.com/questions/14934514/p urpose-of-using-different-types-of-pl-sql- collections-in-oracle

Video-tutorials on Oracle Collections Steven Feuerstein Oracle PL/SQL Best Practices: Bulk Processing https://www.youtube.com/watch?v=Zdpw9z05LWQ &index=87&list=PLmeVq-LGlaQ0_- X63joXw22VDDAafekGZ&spfreload=10 BULK COLLECT and FORALL-A PL/SQL Performance Booster https://www.youtube.com/watch?v=o_LGVrl- a3w&index=113&list=PLmeVq-LGlaQ0_- X63joXw22VDDAafekGZ PL/SQL Oracle BULK COLLECT tutorial https://www.youtube.com/watch?v=oEUINI- GYU4&index=29&list=PLmeVq-LGlaQ0_- X63joXw22VDDAafekGZ

Video-tutorials on Oracle Collections (cont.) See also video-tutorials from the playlist: https://www.youtube.com/playlist?list=PL32450 12E0631F7AE&spfreload=10 PLS-16: PL/SQL Index By Table PLS 15 PL SQL Nested Table (not in the playlist) https://www.youtube.com/watch?v=RFOEniVWU_ Q&spfreload=10 PLS-14: Pl/SQL VARRAY Composite Data Type PLS-12: PL/SQL Bulk Collect and Bulk Bind