Copyright	©	2018 Oracle	and/or	its	affiliates.	All	rights	reserved.		|
asktom.oracle.com
PL/SQL Guilty Pleasures
1
Steven	Feuerstein
Oracle	Developer	Advocate	for	PL/SQL
Oracle Corporation
Email:	steven.feuerstein@oracle.com
Twitter:	@sfonplsql
Blog:	stevenfeuersteinonplsql.blogspot.com
YouTube:	Practically	Perfect	PL/SQL
Copyright	©	2018 Oracle	and/or	its	affiliates.	All	rights	reserved.		|
2
Because	programming….
• should	feel	good.
Copyright	©	2018 Oracle	and/or	its	affiliates.	All	rights	reserved.		|
3
Guilty	Pleasure	(from	Denis)
• Implement	functions	and	procedures	which	expect	all	values	
for	their	parameters	(which	are	translated	to	attributes),	
which	leads	to	the	fact	that	consumer	should	think	about	the	
`lost	update`	problem.	But	consumers	are	so	lazy	that	it	
would	be	a	much	better	idea	to	implement	routines	in	a	way	
that	they	expect	only	the	changed	attributes,	in	this	case	the	
`lost	update`	problem	would	not	exist	for	the	consumers,	but	
the	routines	would	be	a	bit	more	complex.
Copyright	©	2018 Oracle	and/or	its	affiliates.	All	rights	reserved.		|
4
Guilty	Pleasure	(from	Denis)
• Not	think	a	lot	about	how	big	my	string	variables	are,	just	go	
for	varchar2(32767),	when	in	fact	it	is	a	much	better	to	
specify	the	needed	length,	or	even	use	an	anchoring	data	
type.
• Not	think	a	lot	about	how	small	my	string	variables	are,	just	
go	for	varchar2(32767),	when	in	fact	it	is	better	to	consider	
using	CLOBs	in	these	particular	case,	but,	c'mon,	varchars	are	
easier.
Copyright	©	2018 Oracle	and/or	its	affiliates.	All	rights	reserved.		|
5
Guilty	Pleasure	(from	Denis)
• Not	think	a	lot	and	just	go	for	dates,	because	they	are	easier	
that	timestamps.	In	fact,	it	is	always	not	enough	and	
timezones management	hell	appears	in	the	end	(at	least	this	
is	true	for	my	country).
Copyright	©	2018 Oracle	and/or	its	affiliates.	All	rights	reserved.		|
6
Guilty	Pleasure	(from	Denis)
• Use	magical	ad-hoc	literals	instead	of	constants.
• "I	will	need	it	only	this	time,	and	will	always	remember	what	
47	means!"
• "What	do	you	mean	will	I	remember	it	a	year	later?"
Copyright	©	2018 Oracle	and/or	its	affiliates.	All	rights	reserved.		|
7
Guilty	Pleasure	(from	Denis)
• And	my	favourite,	because	it	is	quite	difficult	to	catch	it	- do	
SQL	stuff	in	PL/SQL	and	PL/SQL	stuff	in	SQL.	It	is	really	good	
to	use	a	tool	for	the	stuff	it	was	made	for,	SQL	and	PL/SQL	
are	very	close,	but	still,	in	many	cases	a	task	could	be	solved	
in	a	much	more	efficient	way	in	particularly	SQL	(or	PL/SQL).
Copyright	©	2018 Oracle	and/or	its	affiliates.	All	rights	reserved.		|
8
My	(sort	of)	Guilty	Pleasures
• A	database	programming	language	to	work	with	data
– Making	SQL	easy,	making	dynamic	SQL	easy	and	fast
• Simplicity	and	readability
• Packages,	a.k.a.,	APIs
• No	need	to	make
• The	power	of	AUTHID
Copyright	©	2018 Oracle	and/or	its	affiliates.	All	rights	reserved.		|
9
Data	API	Language	for	Data
• Data	is	different	from	algorithms.
– And	humans	naturally	process	data	as	sets	and	patterns.
• That's	why	SQL	has	such	enduring	power	and	popularity.
• It	also	argues	for	an	intermediary	programming	language	
that	is	data/SQL-aware.
• Thank	you,	PL/SQL.
Copyright	©	2018 Oracle	and/or	its	affiliates.	All	rights	reserved.		|
10
Simplicity	and	Readability
• It's	true	that	PL/SQL	can't	compete	with	all	the	new	
approaches	and	capabilities	of	a	language	like	Python	or	
JavaScript.
• Whew.	I	am	so glad.
• PL/SQL	keeps	things	simple,	allows	you	to	write	code	that	is	
easy	to	read	and	maintain.
• And	keeps	you	focused	on	the	data.
Copyright	©	2018 Oracle	and/or	its	affiliates.	All	rights	reserved.		|
11
Packages,	a.k.a.,	APIs
• APIs	are	all	the	rage	– and	they	should	be.
• But	there's	nothing	new about	APIs.
• Package	specifications	have	offered	clean,	powerful	APIs	to	
data	and	business	rules	for	decades.
• Don't	write	apps	without	them!
Copyright	©	2018 Oracle	and/or	its	affiliates.	All	rights	reserved.		|
12
No	need	to	make
• An	"automatic	and	completely	reliable"	(Bryn)	equivalent	to	
make utilities.
• The database	performs	dependency	analysis	and	unit	
invalidation.
• Fine-grained	dependency	reduces	the	need	for	invalidation.
• Another	reason	to	use	%ROWTYPE	and	%TYPE!
Copyright	©	2018 Oracle	and/or	its	affiliates.	All	rights	reserved.		|
13
The	Power	of	AUTHID
• Easy	SQL	construction	and	execution	can	lead	to	easier	
insecure	code.
• AUTHID	offers	a	simple	mechanism	to	provide	tight	control	
over	data,	while	providing	access	to	data	APIs.
• Get	in	the	habit	of	including	AUTHID	DEFINER	to	your	
program	unit	headers.
– It'll	remind	you	of	the	feature	– and	its	other	form:	CURRENT_USER
Copyright	©	2018 Oracle	and/or	its	affiliates.	All	rights	reserved.		|
14
Question	on	AUTHID
• "If	I	use	all_OBJECTS instead	of	DBA_objects,	I	get	
ORA-00942	with	or	without	AUTHID	CURRENT_USER,	
what	gives?"
• Remember:	when	you	compile	a	stored	program	unit,	you	need	
directly	granted	privileges	to	resolve	references	to	objects.
• But….clearly	something	is	wrong	with	your	set	up.	Everyone has	
access	to	ALL_OBJECTS.
Copyright	©	2018 Oracle	and/or	its	affiliates.	All	rights	reserved.		|
asktom.oracle.com
More Questions?
Share your thoughts!
1

More Related Content

PDF
Oracle Application Express and PL/SQL: a world-class combo
PDF
Six simple steps to unit testing happiness
PPT
Database Developers: the most important developers on earth?
PDF
OLD APEX and PL/SQL
PDF
AskTOM Office Hours - Dynamic SQL in PL/SQL
PDF
AskTOM Office Hours on Database Triggers
PDF
Unit Testing Oracle PL/SQL Code: utPLSQL, Excel and More
PDF
Impact Analysis with PL/Scope
Oracle Application Express and PL/SQL: a world-class combo
Six simple steps to unit testing happiness
Database Developers: the most important developers on earth?
OLD APEX and PL/SQL
AskTOM Office Hours - Dynamic SQL in PL/SQL
AskTOM Office Hours on Database Triggers
Unit Testing Oracle PL/SQL Code: utPLSQL, Excel and More
Impact Analysis with PL/Scope

What's hot (20)

PDF
JSON and PL/SQL: A Match Made in Database
PPTX
Take Full Advantage of the Oracle PL/SQL Compiler
PDF
High Performance PL/SQL
PPTX
Social Media - Why a Database Person Should Care
PPTX
HTTP/2 in the Java Platform -- Java Champions call February 2016
PPTX
JSF 2.3 Adopt-a-JSR 10 Minute Infodeck
PDF
What's Coming in Java EE 8
PDF
Migration tales from java ee 5 to 7
PDF
MVC 1.0 / JSR 371
PDF
WebSocket in Enterprise Applications 2015
PDF
Java API for JSON Binding - Introduction and update
PDF
How to Thrive on REST/WebSocket-Based Microservices
PPTX
EE4J: Java EE & Jakarta EE JFR & JMC
PDF
Adopt-a-JSR for JSON Processing 1.1, JSR 374
PDF
JavaCro'15 - Java Certification – in theory and practice - Branko Mihaljević,...
PPTX
How To Learn Programming For Beginners | How To Start Coding | Learn Programm...
PDF
JavaCro'15 - Java EE 8 - An instant snapshot - David Delabassee
PDF
Java 11 OMG
PDF
JavaCro'15 - HUJAKing – Expansion of Java Community - Branko Mihaljević, Alek...
PDF
Java EE 7 from an HTML5 Perspective, JavaLand 2015
JSON and PL/SQL: A Match Made in Database
Take Full Advantage of the Oracle PL/SQL Compiler
High Performance PL/SQL
Social Media - Why a Database Person Should Care
HTTP/2 in the Java Platform -- Java Champions call February 2016
JSF 2.3 Adopt-a-JSR 10 Minute Infodeck
What's Coming in Java EE 8
Migration tales from java ee 5 to 7
MVC 1.0 / JSR 371
WebSocket in Enterprise Applications 2015
Java API for JSON Binding - Introduction and update
How to Thrive on REST/WebSocket-Based Microservices
EE4J: Java EE & Jakarta EE JFR & JMC
Adopt-a-JSR for JSON Processing 1.1, JSR 374
JavaCro'15 - Java Certification – in theory and practice - Branko Mihaljević,...
How To Learn Programming For Beginners | How To Start Coding | Learn Programm...
JavaCro'15 - Java EE 8 - An instant snapshot - David Delabassee
Java 11 OMG
JavaCro'15 - HUJAKing – Expansion of Java Community - Branko Mihaljević, Alek...
Java EE 7 from an HTML5 Perspective, JavaLand 2015
Ad

Similar to PL/SQL Guilty Pleasures (20)

PDF
Oracle PL/SQL 12c and 18c New Features + RADstack + Community Sites
PPTX
Serverless Kotlin
PPTX
What's New in Oracle SQL Developer for 2018
PDF
Ebr the key_to_online_application_upgrade at amis25
PPTX
Oracle WebLogic Server 12.2.1 Do More with Less
PDF
10 Building Blocks for Enterprise JavaScript
PDF
Satyapriya rajguru: Every day, in one way or another.
PDF
OOW16 - Maintenance Strategies for Oracle E-Business Suite [CON6725]
PDF
Session at Oredev 2016.
PDF
Slovenian Oracle User Group
PDF
Imworld.ro
PPTX
What is DevOps?
PDF
Slidedeck Datenanalysen auf Speed - Oracle R Enterprise (ORE) Demo - DOAG Big...
PPTX
Serverless patterns
PDF
Using Machine Learning to Debug complex Oracle RAC Issues
PPTX
OOW15 - Testing Oracle E-Business Suite Best Practices
PDF
Oracle super cluster for oracle e business suite
PPTX
SQL TUNING 101
PPTX
Automation in Jira for beginners
PDF
Goodbye, Bottlenecks: How Scale-Out and In-Memory Solve ETL
Oracle PL/SQL 12c and 18c New Features + RADstack + Community Sites
Serverless Kotlin
What's New in Oracle SQL Developer for 2018
Ebr the key_to_online_application_upgrade at amis25
Oracle WebLogic Server 12.2.1 Do More with Less
10 Building Blocks for Enterprise JavaScript
Satyapriya rajguru: Every day, in one way or another.
OOW16 - Maintenance Strategies for Oracle E-Business Suite [CON6725]
Session at Oredev 2016.
Slovenian Oracle User Group
Imworld.ro
What is DevOps?
Slidedeck Datenanalysen auf Speed - Oracle R Enterprise (ORE) Demo - DOAG Big...
Serverless patterns
Using Machine Learning to Debug complex Oracle RAC Issues
OOW15 - Testing Oracle E-Business Suite Best Practices
Oracle super cluster for oracle e business suite
SQL TUNING 101
Automation in Jira for beginners
Goodbye, Bottlenecks: How Scale-Out and In-Memory Solve ETL
Ad

More from Steven Feuerstein (8)

PDF
New(er) Stuff in PL/SQL
PDF
Speakers at Nov 2019 PL/SQL Office Hours session
PDF
New Stuff in the Oracle PL/SQL Language
PDF
Error Management Features of PL/SQL
PDF
All About PL/SQL Collections
PPTX
The Amazing and Elegant PL/SQL Function Result Cache
PPTX
Turbocharge SQL Performance in PL/SQL with Bulk Processing
PPTX
utPLSQL: Unit Testing for Oracle PL/SQL
New(er) Stuff in PL/SQL
Speakers at Nov 2019 PL/SQL Office Hours session
New Stuff in the Oracle PL/SQL Language
Error Management Features of PL/SQL
All About PL/SQL Collections
The Amazing and Elegant PL/SQL Function Result Cache
Turbocharge SQL Performance in PL/SQL with Bulk Processing
utPLSQL: Unit Testing for Oracle PL/SQL

Recently uploaded (20)

PPTX
Computer Software and OS of computer science of grade 11.pptx
PDF
Topaz Photo AI Crack New Download (Latest 2025)
PPTX
Computer Software - Technology and Livelihood Education
PDF
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
PDF
How to Make Money in the Metaverse_ Top Strategies for Beginners.pdf
PPTX
Monitoring Stack: Grafana, Loki & Promtail
PPTX
Tech Workshop Escape Room Tech Workshop
PDF
The Dynamic Duo Transforming Financial Accounting Systems Through Modern Expe...
PPTX
CNN LeNet5 Architecture: Neural Networks
PPTX
AMADEUS TRAVEL AGENT SOFTWARE | AMADEUS TICKETING SYSTEM
PPTX
Patient Appointment Booking in Odoo with online payment
PDF
MCP Security Tutorial - Beginner to Advanced
PPTX
Trending Python Topics for Data Visualization in 2025
PDF
AI Guide for Business Growth - Arna Softech
PDF
Autodesk AutoCAD Crack Free Download 2025
PPTX
assetexplorer- product-overview - presentation
PDF
How Tridens DevSecOps Ensures Compliance, Security, and Agility
PDF
AI/ML Infra Meetup | LLM Agents and Implementation Challenges
PDF
Time Tracking Features That Teams and Organizations Actually Need
PDF
Designing Intelligence for the Shop Floor.pdf
Computer Software and OS of computer science of grade 11.pptx
Topaz Photo AI Crack New Download (Latest 2025)
Computer Software - Technology and Livelihood Education
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
How to Make Money in the Metaverse_ Top Strategies for Beginners.pdf
Monitoring Stack: Grafana, Loki & Promtail
Tech Workshop Escape Room Tech Workshop
The Dynamic Duo Transforming Financial Accounting Systems Through Modern Expe...
CNN LeNet5 Architecture: Neural Networks
AMADEUS TRAVEL AGENT SOFTWARE | AMADEUS TICKETING SYSTEM
Patient Appointment Booking in Odoo with online payment
MCP Security Tutorial - Beginner to Advanced
Trending Python Topics for Data Visualization in 2025
AI Guide for Business Growth - Arna Softech
Autodesk AutoCAD Crack Free Download 2025
assetexplorer- product-overview - presentation
How Tridens DevSecOps Ensures Compliance, Security, and Agility
AI/ML Infra Meetup | LLM Agents and Implementation Challenges
Time Tracking Features That Teams and Organizations Actually Need
Designing Intelligence for the Shop Floor.pdf

PL/SQL Guilty Pleasures