Oracle Database 11g & PL/SQL

Similar documents
Oracle Database: Introduction to SQL Ed 2

Oracle Database 11g: SQL and PL/SQL Fundamentals

Table of Contents. PDF created with FinePrint pdffactory Pro trial version

Oracle Database: SQL and PL/SQL Fundamentals NEW

Oracle Database: SQL and PL/SQL Fundamentals Ed 2

Oracle Syllabus Course code-r10605 SQL

AO3 - Version: 2. Oracle Database 11g SQL

Oracle Database: Introduction to SQL

Oracle Database: Introduction to SQL

ORACLE: PL/SQL Programming

ORACLE TRAINING. ORACLE Training Course syllabus ORACLE SQL ORACLE PLSQL. Oracle SQL Training Syllabus

Oracle Database: Introduction to SQL/PLSQL Accelerated

Oracle Database: Introduction to SQL

Course Outline and Objectives: Database Programming with SQL

1 Writing Basic SQL SELECT Statements 2 Restricting and Sorting Data

Introduction to SQL/PLSQL Accelerated Ed 2

Lecture 08. Spring 2018 Borough of Manhattan Community College

Oracle SQL & PL SQL Course

A Unit of SequelGate Innovative Technologies Pvt. Ltd. All Training Sessions are Completely Practical & Real-time

Introduction to Computer Science and Business

Oracle Database 11g: Introduction to SQLRelease 2

Oracle Developer Track Course Contents. Mr. Sandeep M Shinde. Oracle Application Techno-Functional Consultant

PROCEDURAL DATABASE PROGRAMMING ( PL/SQL AND T-SQL)

SQL+PL/SQL. Introduction to SQL

EDUVITZ TECHNOLOGIES

Oracle Database: SQL and PL/SQL Fundamentals

Using SQL with SQL Developer 18.2

Oracle. SQL(Structured Query Language) Introduction of DBMS. Build In Function. Introduction of RDBMS. Grouping the Result of a Query

Using SQL with SQL Developer Part I

Using SQL with SQL Developer 18.2 Part I

5. Single-row function

Students Guide. Requirements of your homework

Database Programming with PL/SQL

Topics Fundamentals of PL/SQL, Integration with PROIV SuperLayer and use within Glovia

Index. Boolean expression, , Business rules enforcement. see Declarative constraints table with Oracle constraints and,

Oracle Database 12c SQL Fundamentals

MANAGING DATA(BASES) USING SQL (NON-PROCEDURAL SQL, X401.9)

Oracle Database 11g & PL/SQL

Oracle Database 10g: Introduction to SQL

Oracle 1Z Oracle Database SQL Expert. Download Full Version :

ORACLE DATABASE 12C INTRODUCTION

Introduction to Oracle9i: SQL

DB2 UDB: Application Programming

DB2 SQL Class Outline

Oracle 12C DBA Online Training. Course Modules of Oracle 12C DBA Online Training: 1 Oracle Database 12c: Introduction to SQL:

Oracle 1Z Oracle Database 11g: Advanced PL/SQL.

Creating and Managing Tables Schedule: Timing Topic

Database Foundations. 6-3 Data Definition Language (DDL) Copyright 2015, Oracle and/or its affiliates. All rights reserved.

Oracle Database: Program with PL/SQL

Oracle Database: Program with PL/SQL Ed 2

ORACLE DEV 11G CURRICULUM. Introduction to SQL

Aggregate Functions. Eng. Mohammed Alokshiya. Islamic University of Gaza. Faculty of Engineering. Computer Engineering Dept. Database Lab (ECOM 4113)

Using DDL Statements to Create and Manage Tables. Copyright 2004, Oracle. All rights reserved.

Oracle Database 12c R2: Program with PL/SQL Ed 2 Duration: 5 Days

PASSWORDS TREES AND HIERARCHIES. CS121: Relational Databases Fall 2017 Lecture 24

Conditionally control code flow (loops, control structures). Create stored procedures and functions.

Meet MariaDB Vicențiu Ciorbaru Software MariaDB Foundation * * 2017 MariaDB Foundation

Trees & Hierarchies in SQL. Joe Celko Copyright 2009

Lesson B Objectives IF/THEN. Chapter 4B: More Advanced PL/SQL Programming

Oracle SQL Course Content

Edition-Based Redefinition

Oracle PLSQL Training Syllabus

Nested Class Map Support for Zone-Based Policy Firewall

"Charting the Course... Oracle18c SQL (5 Day) Course Summary

Oracle Database 10g: SQL Fundamentals I

Table of Contents. Oracle SQL PL/SQL Training Courses

Oracle Database: SQL and PL/SQL Fundamentals NEW

Oracle Database: SQL and PL/SQL Fundamentals NEW

IBM DB2 UDB V7.1 Family Fundamentals.

Oracle Database 11g: SQL Fundamentals I

SQL language. Jaroslav Porubän, Miroslav Biňas, Milan Nosáľ (c)

ETL TESTING TRAINING

Oracle Database 11g: Program with PL/SQL Release 2

What Are Group Functions? Reporting Aggregated Data Using the Group Functions. Objectives. Types of Group Functions

Oracle Database 12c: Program with PL/SQL Duration: 5 Days Method: Instructor-Led

Introduction p. 1 The Logical and Physical View of Tables p. 1 Database Types p. 4 NULLs p. 6 DDL and DML Statements p. 7 Column and Table Constraint

SQL Interview Questions

Oracle Database 11g: Program with PL/SQL

Sql Server Syllabus. Overview

Oracle - Oracle Database: Program with PL/SQL Ed 2

Certification Exam Preparation Seminar: Oracle Database SQL

SEF DATABASE FOUNDATION ON ORACLE COURSE CURRICULUM

Indexes (continued) Customer table with record numbers. Source: Concepts of Database Management

OVERVIEW OF THE TYPES OF PL/SQL BLOCKS:

IZ0-144Oracle 11g PL/SQL Certification (OCA) training

1Z Z0-146-Oracle Database 11g: Advanced PL/SQL Exam Summary Syllabus Questions

Business Analytics. SQL PL SQL [Oracle 10 g] P r i n c e S e t h i w w w. x l m a c r o. w e b s. c o m

normalization are being violated o Apply the rule of Third Normal Form to resolve a violation in the model

Real Application Security Administration

Overview of supported syntax Janus Software All Rights Reserved

Solved MCQ on fundamental of DBMS. Set-1

Oracle PL/SQL - 12c & 11g [Basic PL/SQL & Advanced PL/SQL]

ORACLE PL/SQL DATABASE COURSE

PART I Core Ideas and Elements of PL/SQL Performance Tuning

Contents I Introduction 1 Introduction to PL/SQL iii

PROCEDURAL DATABASE PROGRAMMING ( PL/SQL AND T-SQL)

Oracle SQL Developer. Oracle TimesTen In-Memory Database Support User's Guide Release 4.0 E

Oracle Compare Two Database Tables Sql Query List All

Using DDL Statements to Create and Manage Tables. Copyright 2004, Oracle. All rights reserved.

Creating and Working with JSON in Oracle Database

Transcription:

Oracle Database 11g & PL/SQL Tips and Tricks Marcelo Vinícius Cysneiros Aragão marcelovca90@inatel.br

Data Manipulation DB Link Insert as Select Cursor Associative Array Exception Handling The usual way SQLCODE and SQLERRM Saving and Retrieving Topics Hierarchical Queries Keywords Example Tips and Tricks Modular Parallelization Function within Procedure NVL and NVL2 COALESCE and NULLIF Regular Expression Substring 2/23

Data Manipulation 3/23

Data Manipulation: DB Link The following statement defines a shared public database link named remote that refers to the database specified by the service name remote: This database link allows user hr on the local database to update a table on the remote database (assuming hr has appropriate privileges): 4/23

Data Manipulation: Insert as Select With INSERT... SELECT, you can quickly insert many rows into a table from one or many tables. Question: How do I make sure that I do not enter the same client information again? 5/23

Data Manipulation: Cursor 6/23

Data Manipulation: Cursor 7/23

Data Manipulation: Associative Array 8/23

Data Manipulation: Associative Array 9/23

Exception Handling 10/23

Data Manipulation: The usual way 11/23

Data Manipulation: SQLCODE and SQLERRM 12/23

Data Manipulation: Saving and Retrieving 13/23

Hierarchical Queries 14/23

Hierarquical Queries: Keywords If a table contains hierarchical data, then you can select rows in a hierarchical order using the hierarchical query clause: START WITH specifies the root row(s) of the hierarchy. CONNECT BY specifies the relationship between parent rows and child rows of the hierarchy. In a hierarchical query, one expression in condition must be qualified with the PRIOR operator to refer to the parent row. The LEVEL pseudocolumn is used to show parent and child rows The SIBLINGS keyword is used to preserve ordering within the hierarchy. 15/23

Hierarquical Queries: Example 16/23

Tips and Tricks 17/23

Tips and Tricks: Modular Parallelization If we call MOD_PROCESS_EMPLOYEES(2, 0), only the records with even IDs will be processed. If we call MOD_PROCESS_EMPLOYEES(2, 1), only the records with odd IDs will be processed. 18/23

Tips and Tricks: Function within Procedure 19/23

Tips and Tricks: NVL and NVL2 The NVL function allows you to replace null values with a default value. If the value in the first parameter is null, the function returns the value in the second parameter. If the first parameter is any value other than null, it is returned unchanged. The NVL2 function accepts three parameters. If the first parameter value is not null it returns the value in the second parameter. If the first parameter value is null, it returns the third parameter. 20/23

Tips and Tricks: COALESCE and NULLIF The COALESCE accepts two or more parameters and returns the first nonnull value in a list. If all parameters contain null values, it returns null. The NULLIF accepts two parameters and returns null if both parameters are equal. If they are not equal, the first parameter value is returned. 21/23

Tips and Tricks: Regular Expression Substring The function REGEXP_SUBSTR is useful if you need the contents of a match string but not its position in the source string. The function returns the string as VARCHAR2 or CLOB data in the same character set as source_string. 22/23

Tips and Tricks: Regular Expression Substring Output: 1one1 2two2 3three3 23/23