Modern Oracle Database Programming: Level Up Your Skill Set to Oracle’s Latest and Most Powerful Features in SQL, PL/SQL, and JSON 1st Edition Alex Nuijten instant download
Modern Oracle Database Programming: Level Up Your Skill Set to Oracle’s Latest and Most Powerful Features in SQL, PL/SQL, and JSON 1st Edition Alex Nuijten instant download
https://ebookmass.com/product/oracle-pl-sql-by-example-6th-edition-
benjamin-rosenzweig/
https://ebookmass.com/product/oca-oracle-database-sql-exam-guide-
exam-1z0-071-1st-edition-steve-ohearn/
https://ebookmass.com/product/oracle-database-programming-with-visual-
basic-net-concepts-designs-and-implementations-ying-bai/
Oracle 12c: SQL 3rd Edition, (Ebook PDF)
https://ebookmass.com/product/oracle-12c-sql-3rd-edition-ebook-pdf/
https://ebookmass.com/product/oracle-autonomous-database-for-
dummies-3rd-special-edition-lawrence-miller/
https://ebookmass.com/product/python-programming-and-sql-10-books-
in-1-supercharge-your-career-with-python-programming-and-sql-andrew-
reed/
https://ebookmass.com/product/pro-oracle-sql-development-best-
practices-for-writing-advanced-queries-2nd-edition-jon-heller/
Alex Nuijten and Patrick Barel
Patrick Barel
Almere, Flevoland, The Netherlands
This work is subject to copyright. All rights are solely and exclusively
licensed by the Publisher, whether the whole or part of the material is
concerned, specifically the rights of translation, reprinting, reuse of
illustrations, recitation, broadcasting, reproduction on microfilms or in
any other physical way, and transmission or information storage and
retrieval, electronic adaptation, computer software, or by similar or
dissimilar methodology now known or hereafter developed.
The publisher, the authors, and the editors are safe to assume that the
advice and information in this book are believed to be true and accurate
at the date of publication. Neither the publisher nor the authors or the
editors give a warranty, expressed or implied, with respect to the
material contained herein or for any errors or omissions that may have
been made. The publisher remains neutral with regard to jurisdictional
claims in published maps and institutional affiliations.
This Apress imprint is published by the registered company APress
Media, LLC, part of Springer Nature.
The registered company address is: 1 New York Plaza, New York, NY
10004, U.S.A.
Foreword
SQL is a powerful language. With a few lines, you can answer complex
questions.
PL/SQL includes many extensions to make SQL even easier to work
with. This tight integration makes these languages perfect for data
management.
Yet it can be unclear which SQL or PL/SQL features you should use
to solve a problem. The documentation for Oracle Database is huge.
Browsing through it in the hopes of finding the syntax or feature to help
you is an endless task.
Sadly, this means many applications have pages of code re-creating
features Oracle Database offers. Often this is because the developers
were unaware this functionality was available to them.
So, I’m thrilled to see Alex and Patrick write this book. They have a
long history of sharing their knowledge to help others use Oracle
Database. Their real-world experience and willingness to help others
understand Oracle SQL and PL/SQL have led both to the deserved
recognition of Oracle ACE Director. This makes them ideal candidates to
make this guide.
Reading this book will teach you how to use the more powerful
database options, many of which are unavailable on other platforms.
It’s filled with examples to show you how this SQL and PL/SQL
language features work. But most importantly, the scripts help
illustrate when and why you should use these options.
When working with any technology, I think you should know what
features it offers. Using inbuilt functionality saves you time and
simplifies your code. Alex and Patrick have done a great job showing
you how to do this.
I’ve learned a lot from them both over the years. I hope this book
helps you write better SQL and PL/SQL too.
—Chris Saxon, Oracle Developer Advocate
Introduction
When writing a book on database technology, you have to come up with
a data set to write your examples with. We could have used the
standard EMP and DEPT tables that have been available in the SCOTT
schema forever. Still, since this is a book on modern Oracle Database
programming, we wanted to use a different data set.
Because we are both fans of Formula 1 and Oracle is a big sponsor
of the Red Bull Racing team, which happens to be the team where our
countryman Max Verstappen is driving, we went looking for a Formula
1–related data set. Of course, not all examples in this book are related
to Max; many other drivers and results also play an important role.
The Ergast Developer API (https://ergast.com/mrd/) lets
you query all kinds of motor racing data and retrieve that in multiple
formats. This site also offers all the tables in a CSV format, so we
created an F1DATA schema where we could import the data. The
original data set was a MySQL database, so we had to make some minor
tweaks to the data model.
The source files for this book can be found on GitHub at
https://github.com/Apress/modern-oracle-database-
programming.
Part I: Advanced Basics
In the first part of the book, several topics are bundled together, which
should be in the toolbox of every Oracle Database developer. Frequently
we meet experienced developers unfamiliar with collections and bulk
operations, which have been around forever. The same is true for ANSI
joins, analytic functions, row pattern matching, or conditional
compilation.
Part II: Multiple Techniques and Languages
The second part of the book highlights the integration between SQL and
PL/SQL. Keeping context switches between the SQL and PL/SQL engine
to a minimum is always better for performance.
After the introduction of JSON into Oracle Database, it has taken
flight in functionality and performance. There is a lot to learn when
dealing with JSON in the database, and there are several chapters to get
a headstart.
Part III: Oracle-Provided Functionality
Out of the box, Oracle Database has a lot of functionality ready to use. In
the third part of this book, some of these functionalities play a central
role.
Even if APEX is not used for front-end development, it offers some
very useful packages that can be used in everyday database
development. Edition-based redefinition enables zero downtime
upgrades of your bespoke application. Getting data that is currently
based on a period where it is valid can be handled by the database
without having to write complicated SQL statements.
Copy the Pre-Authenticated Request URL and store it in a safe place. It will not be
shown again.
Copy the generated token and store it in a safe place. It will not be shown again.
Figure I-8 Generated token
CAPITULO XXII
CAPITULO XXIII
Rubião tinha vexame, por causa de Sophia; não sabia haver-se com
senhoras. Felizmente, lembrou-se da promessa que a si mesmo
fizera de ser forte e implacavel. Foi jantar. Abençoada resolução!
Onde acharia eguaes horas? Sophia era, em casa, muito melhor que
no trem de ferro. Lá vestia a capa, embora tivesse os olhos
descobertos; cá trazia á vista os olhos e o corpo, elegantemente
apertado em um vestido de cambraia, mostrando as mãos que eram
bonitas, e um principio de braço. Demais, aqui era a dona da casa,
fallava mais, desfazia-se em obsequios; Rubião desceu meio tonto.
CAPITULO XXV
CAPITULO XXVI
CAPITULO XXVII
CAPITULO XXVIII
CAPITULO XXX
CAPITULO XXXI
CAPITULO XXXII
CAPITULO XXXIII
Rubião viu-os ir, entrou, metteu-se na sala, e ainda uma vez leu o
bilhete de Sophia. Cada palavra d'essa pagina inesperada era um
mysterio; a assignatura uma capitulação. Sophia apenas; nenhum
outro nome da familia ou do casal. Verdadeira amiga era
evidentemente uma metaphora. Quanto ás primeiras palavras:
Mando-lhe estas fructinhas para o almoço respiravam a candidez de
uma alma boa e generosa. Rubião viu, sentiu, palpou todas essas
cousas pela unica força do instincto e deu por si beijando o papel,—
digo mal, beijando o nome, o nome dado na pia de baptismo,
repetido pela mãe, entregue ao marido como parte da escriptura
moral do casamento, e agora roubado a todas essas origens e
posses para lhe ser mandado a elle, no fim d'uma folha de papel...
Sophia! Sophia! Sophia!
CAPITULO XXXIV
—Por que veiu tão tarde? perguntou-lhe Sophia, logo que elle
appareceu á porta do jardim, em Santa Thereza.
—Depois do almoço, que acabou ás duas horas, estive arranjando
uns papeis. Mas não é tão tarde assim, continuou Rubião vendo o
relogio; são quatro horas e meia.
—Sempre é tarde para os amigos, replicou Sophia em ar de censura.
Rubião cahiu em si; mas não teve tempo de emendar a mão. Deante
delle, ao pé da casa, estavam sentadas em bancos de ferro umas
quatro senhoras, caladas, olhando para elle, curiosas; eram visitas
de Sophia que esperavam a vinda de um capitalista Rubião. Já
tinham ouvido fallar delle. Sophia foi apresental-o a ellas. Tres d'ellas
eram casadas, uma solteira, ou mais que solteira. Contava trinta e
nove annos, e uns olhos pretos, cansados de esperar. Era filha de
um major Siqueira, que d'ahi a alguns minutos appareceu no jardim.
—O nosso Palha já me tinha fallado em Vossa Excellencia, disse o
major depois de apresentado ao Rubião. Juro que é seu amigo ás
direitas. Contou-me o acaso que os ligou. Geralmente, as melhores
amizades são essas. Eu, em trinta e tantos, pouco antes da
Maioridade, tive um amigo, o melhor dos meus amigos daquelle
tempo, que conheci assim por um acaso, na botica do Bernardos,
por alcunha o João das pantorrilhas... Creio que usou d'ellas, em
rapaz, entre 1801 e 1812. O certo é que a alcunha ficou. A botica
era na rua de S. José, ao desembocar na da Misericordia... João das
pantorrilhas... Sabe que era um modo de engrossar a perna...
Bernardes era o nome delle, João Alves Bernardes... Tinha a botica
na rua de S. José. Conversava-se alli muito, á tarde, e á noite. Ia a
gente com o seu capote, e bengalão; alguns levavam lanterna. Eu
não; levava só o meu capote... Ia-se de capote; o Bernardes,—João
Alves Bernardes era o nome todo delle; era filho de Maricá, mas
criou-se aqui no Rio de Janeiro... João das pantorrilhas era a
alcunha; diziam que elle andára de pantorrilhas, em rapaz, e parece
que foi um dos petimetres da cidade. Nunca me esqueci: João das
pantorrilhas... Ia-se de capote...
A alma do Rubião bracejava debaixo deste aguaceiro de palavras;
mas, estava n'um becco sem sahida por um lado nem por outro.
Tudo muralhas. Nenhuma porta aberta, nenhum corredor, e a chuva
a cahir. Se pudesse olhar para as moças viria, ao menos, que era
objecto de curiosidade de todas, principalmente da filha do major, D.
Tonica; mas não podia; escutava, e o major chovia a cantaros. Foi o
Palha que lhe trouxe um guarda-chuva. Sophia tinha ido dizer ao
marido que o Rubião acabára de chegar; d'ahi a nada estava o Palha
no jardim, e saudava o amigo, dizendo-lhe que viera tarde. O major,
que explicava ainda uma vez a alcunha do boticario, abandonou a
presa, e foi ter com as moças; depois sahiu á rua.
CAPITULO XXXV
CAPITULO XXXVI
CAPITULO XXXVII
CAPITULO XXXVIII
CAPITULO XXXIX
CAPITULO XL
CAPITULO XLI
ebookmasss.com