Submit Search
Upload
PL/SQL Coding Guidelines - Part 2
•
Download as PPTX, PDF
•
0 likes
•
289 views
Larry Nung
Follow
PL/SQL Coding Guidelines - Part 2
Read less
Read more
Technology
Report
Share
Report
Share
1 of 29
Download now
Recommended
Ornithology_Leaflet_Highres
Ornithology_Leaflet_Highres
Matthew Hopkins
Virus y antivirus.
Virus y antivirus.
ximenadltorre
Discoveries 2016 Mining Conference
Discoveries 2016 Mining Conference
Douglas Coleman
Kampot
Kampot
lynda96
Ple 2016
Ple 2016
DIPLOMADO INNOVATIC META
sikuli final
sikuli final
Mangesh Bhapkar
Introductions
Introductions
jenwb
Tahir
Tahir
Tahir Kalyar
Recommended
Ornithology_Leaflet_Highres
Ornithology_Leaflet_Highres
Matthew Hopkins
Virus y antivirus.
Virus y antivirus.
ximenadltorre
Discoveries 2016 Mining Conference
Discoveries 2016 Mining Conference
Douglas Coleman
Kampot
Kampot
lynda96
Ple 2016
Ple 2016
DIPLOMADO INNOVATIC META
sikuli final
sikuli final
Mangesh Bhapkar
Introductions
Introductions
jenwb
Tahir
Tahir
Tahir Kalyar
Exposicion de la kinesiologia de la cara
Exposicion de la kinesiologia de la cara
stefany ojeda
Ender’s Game Presentation
Ender’s Game Presentation
Timotheezy
PL/SQL Coding Guidelines - Part 1
PL/SQL Coding Guidelines - Part 1
Larry Nung
Topshelf - An easy service hosting framework for building Windows services us...
Topshelf - An easy service hosting framework for building Windows services us...
Larry Nung
PL/SQL & SQL CODING GUIDELINES – Part 4
PL/SQL & SQL CODING GUIDELINES – Part 4
Larry Nung
PL/SQL & SQL CODING GUIDELINES – Part 5
PL/SQL & SQL CODING GUIDELINES – Part 5
Larry Nung
Oracle Database 12c Attack Vectors
Oracle Database 12c Attack Vectors
Martin Toshev
Electrical Engineering Interview Questions
Electrical Engineering Interview Questions
ashiesh0007
Ansible - simple it automation
Ansible - simple it automation
Larry Nung
sonarwhal - a linting tool for the web
sonarwhal - a linting tool for the web
Larry Nung
LiteDB - A .NET NoSQL Document Store in a single data file
LiteDB - A .NET NoSQL Document Store in a single data file
Larry Nung
PL/SQL & SQL CODING GUIDELINES – Part 8
PL/SQL & SQL CODING GUIDELINES – Part 8
Larry Nung
MessagePack - An efficient binary serialization format
MessagePack - An efficient binary serialization format
Larry Nung
PL/SQL & SQL CODING GUIDELINES – Part 7
PL/SQL & SQL CODING GUIDELINES – Part 7
Larry Nung
BenchmarkDotNet - Powerful .NET library for benchmarking
BenchmarkDotNet - Powerful .NET library for benchmarking
Larry Nung
PLSQL Coding Guidelines - Part 6
PLSQL Coding Guidelines - Part 6
Larry Nung
SonarQube - The leading platform for Continuous Code Quality
SonarQube - The leading platform for Continuous Code Quality
Larry Nung
Visual studio 2017
Visual studio 2017
Larry Nung
Web deploy command line
Web deploy command line
Larry Nung
Web deploy
Web deploy
Larry Nung
SikuliX
SikuliX
Larry Nung
Common.logging
Common.logging
Larry Nung
More Related Content
Viewers also liked
Exposicion de la kinesiologia de la cara
Exposicion de la kinesiologia de la cara
stefany ojeda
Ender’s Game Presentation
Ender’s Game Presentation
Timotheezy
PL/SQL Coding Guidelines - Part 1
PL/SQL Coding Guidelines - Part 1
Larry Nung
Topshelf - An easy service hosting framework for building Windows services us...
Topshelf - An easy service hosting framework for building Windows services us...
Larry Nung
PL/SQL & SQL CODING GUIDELINES – Part 4
PL/SQL & SQL CODING GUIDELINES – Part 4
Larry Nung
PL/SQL & SQL CODING GUIDELINES – Part 5
PL/SQL & SQL CODING GUIDELINES – Part 5
Larry Nung
Oracle Database 12c Attack Vectors
Oracle Database 12c Attack Vectors
Martin Toshev
Electrical Engineering Interview Questions
Electrical Engineering Interview Questions
ashiesh0007
Viewers also liked
(8)
Exposicion de la kinesiologia de la cara
Exposicion de la kinesiologia de la cara
Ender’s Game Presentation
Ender’s Game Presentation
PL/SQL Coding Guidelines - Part 1
PL/SQL Coding Guidelines - Part 1
Topshelf - An easy service hosting framework for building Windows services us...
Topshelf - An easy service hosting framework for building Windows services us...
PL/SQL & SQL CODING GUIDELINES – Part 4
PL/SQL & SQL CODING GUIDELINES – Part 4
PL/SQL & SQL CODING GUIDELINES – Part 5
PL/SQL & SQL CODING GUIDELINES – Part 5
Oracle Database 12c Attack Vectors
Oracle Database 12c Attack Vectors
Electrical Engineering Interview Questions
Electrical Engineering Interview Questions
More from Larry Nung
Ansible - simple it automation
Ansible - simple it automation
Larry Nung
sonarwhal - a linting tool for the web
sonarwhal - a linting tool for the web
Larry Nung
LiteDB - A .NET NoSQL Document Store in a single data file
LiteDB - A .NET NoSQL Document Store in a single data file
Larry Nung
PL/SQL & SQL CODING GUIDELINES – Part 8
PL/SQL & SQL CODING GUIDELINES – Part 8
Larry Nung
MessagePack - An efficient binary serialization format
MessagePack - An efficient binary serialization format
Larry Nung
PL/SQL & SQL CODING GUIDELINES – Part 7
PL/SQL & SQL CODING GUIDELINES – Part 7
Larry Nung
BenchmarkDotNet - Powerful .NET library for benchmarking
BenchmarkDotNet - Powerful .NET library for benchmarking
Larry Nung
PLSQL Coding Guidelines - Part 6
PLSQL Coding Guidelines - Part 6
Larry Nung
SonarQube - The leading platform for Continuous Code Quality
SonarQube - The leading platform for Continuous Code Quality
Larry Nung
Visual studio 2017
Visual studio 2017
Larry Nung
Web deploy command line
Web deploy command line
Larry Nung
Web deploy
Web deploy
Larry Nung
SikuliX
SikuliX
Larry Nung
Common.logging
Common.logging
Larry Nung
protobuf-net - Protocol Buffers library for idiomatic .NET
protobuf-net - Protocol Buffers library for idiomatic .NET
Larry Nung
Regular expression
Regular expression
Larry Nung
Fx.configuration
Fx.configuration
Larry Nung
StackExchange.redis
StackExchange.redis
Larry Nung
Disruptor
Disruptor
Larry Nung
GRUNT - The JavaScript Task Runner
GRUNT - The JavaScript Task Runner
Larry Nung
More from Larry Nung
(20)
Ansible - simple it automation
Ansible - simple it automation
sonarwhal - a linting tool for the web
sonarwhal - a linting tool for the web
LiteDB - A .NET NoSQL Document Store in a single data file
LiteDB - A .NET NoSQL Document Store in a single data file
PL/SQL & SQL CODING GUIDELINES – Part 8
PL/SQL & SQL CODING GUIDELINES – Part 8
MessagePack - An efficient binary serialization format
MessagePack - An efficient binary serialization format
PL/SQL & SQL CODING GUIDELINES – Part 7
PL/SQL & SQL CODING GUIDELINES – Part 7
BenchmarkDotNet - Powerful .NET library for benchmarking
BenchmarkDotNet - Powerful .NET library for benchmarking
PLSQL Coding Guidelines - Part 6
PLSQL Coding Guidelines - Part 6
SonarQube - The leading platform for Continuous Code Quality
SonarQube - The leading platform for Continuous Code Quality
Visual studio 2017
Visual studio 2017
Web deploy command line
Web deploy command line
Web deploy
Web deploy
SikuliX
SikuliX
Common.logging
Common.logging
protobuf-net - Protocol Buffers library for idiomatic .NET
protobuf-net - Protocol Buffers library for idiomatic .NET
Regular expression
Regular expression
Fx.configuration
Fx.configuration
StackExchange.redis
StackExchange.redis
Disruptor
Disruptor
GRUNT - The JavaScript Task Runner
GRUNT - The JavaScript Task Runner
PL/SQL Coding Guidelines - Part 2
1.
PL/SQL & SQL CODING
GUIDELINES – PART 2 Larry Nung
2.
AGENDA Variables & Types Reference Q
& A 2
3.
VARIABLES & TYPES General
4.
8. TRY TO
USE ANCHORED DECLARATIONS FOR VARIABLES, CONSTANTS AND TYPES.
5.
BAD DECLARE v_empName VARCHAR2(10); BEGIN … END;
6.
GOOD DECLARE v_empName emp.ename%TYPE; BEGIN … END;
7.
9.TRY TO HAVE
A SINGLE LOCATION TO DEFINE YOUR TYPES.
8.
10. TRY TO
USE SUBTYPES FOR CONSTRUCTS USED OFTEN IN YOUR APPLICATION.
9.
BAD DECLARE v_str VARCHAR2(4000); BEGIN … END;
10.
GOOD CREATE OR REPLACE
PACKAGE PKG_SUBTYPE AS SUBTYPE STRING_MAX IS VARCHAR2(4000); END PKG_SUBTYPE; DECLARE v_str PKG_SUBTYPE.STRING_MAX; BEGIN ... END;
11.
11. NEVER INITIALIZE
VARIABLES WITH NULL.
12.
BAD DECLARE v_str VARCHAR2(30) :=
null; BEGIN ... END;
13.
GOOD DECLARE v_str VARCHAR2(30); BEGIN ... END;
14.
12. AVOID COMPARISONS
WITH NULL VALUE, CONSIDER USING IS [NOT] NULL.
15.
BAD DECLARE v_str VARCHAR2(30); BEGIN if v_str
= null then … end if; END;
16.
GOOD DECLARE v_str VARCHAR2(30); BEGIN if v_str
is null then … end if; END;
17.
13. AVOID INITIALIZING
VARIABLES USING FUNCTIONS IN THE DECLARATION SECTION.
18.
BAD DECLARE l_company_name VARCHAR2(30) := util_pck.get_company_name(in_id
=> 47); BEGIN … END;
19.
GOOD DECLARE v_str VARCHAR2(30); BEGIN <<init>> BEGIN v_str :=
util_pck.get_company_name(inId => 47); EXCEPTION WHEN VALUE_ERROR THEN ... END init; END;
20.
14. NEVER OVERLOAD
DATA STRUCTURE USAGES.
21.
BAD <<main>> DECLARE v_str VARCHAR2(30); BEGIN <<sub>> DECLARE v_str VARCHAR2(4000)
; BEGIN … END sub; END main;
22.
15. NEVER USE
QUOTED IDENTIFIERS.
23.
BAD <<main>> DECLARE "v_str" VARCHAR2(30) ; BEGIN … END
main;
24.
16. AVOID USING
OVERLY SHORT NAMES FOR DECLARED OR IMPLICITLY DECLARED IDENTIFIERS.
25.
17. AVOID THE
USE OF ROWID OR UROWID
26.
REFERENCE 26
27.
REFERENCE Trivadis PL/SQL
& SQL Coding Guidelines Version 2.0 http://www.trivadis.com/sites/default/files/downloads/PL SQL_and_SQL_Coding_Guidelines_2_0_HiRes.pdf 27
28.
Q&A 28
29.
QUESTION & ANSWER 29
Download now