20
© 2009 Quest Software, Inc. ALL RIGHTS RESERVED Toad Tips & Tricks for the PL/SQL Pro Tips & Tricks for the PL/SQL Professional Toad ® for Oracle

Plsql+tips+n+tricks+2011

Embed Size (px)

DESCRIPTION

Toad empowers the PL/SQL professional. Get more out of Toad!

Citation preview

Page 1: Plsql+tips+n+tricks+2011

© 2009 Quest Software, Inc. ALL RIGHTS RESERVED

Toad Tips & Tricks for the PL/SQL Pro

Tips & Tricks for the PL/SQL Professional

Toad® for Oracle

Page 2: Plsql+tips+n+tricks+2011

2

Editor 201

• Code Insight– Object name completion (CNTRL + Period)– Column Popup (Multi-Select!)– PL/SQL Completion

– Too ‘Mr. Clippy’ for yourtastes? Disable thefeature!

VS

Page 3: Plsql+tips+n+tricks+2011

3

Editor 201• SQL Recall

– Use Named SQL for super fast recall.– ALT + Up/Dn to scroll through history recall list

• Code Snippets– If..Then..Elsif..– Exceptions– Cursor For Loop– Your custom code

Page 4: Plsql+tips+n+tricks+2011

4

Split Editor

• Work with multiple sections of your file simultaneously– Left/Right– Top/Bottom

Page 5: Plsql+tips+n+tricks+2011

5

Editor 201• Make/Strip Code

– Translate Delphi, Java, C++, Perl, C#, VB, etc to SQL– Translate SQL to Delphi, Java, …– Write your own custom Code Transformation Templates

Page 6: Plsql+tips+n+tricks+2011

6

Editor 201

• Keyboard Shortcuts– Check your options!

• Customize Toolbars– Hate Toad’s 80 gazillion

buttons and toolbars? TURN THEM OFF

Page 7: Plsql+tips+n+tricks+2011

7

Editor 201• Debugger

– Conditional Breakpoints– Use Watches to change variable values and as breakpoints– Step into TYPE Body– Supports DML Triggers– Toad can now write your DBMS_OUTPUT instrumentation code for you!

Page 8: Plsql+tips+n+tricks+2011

8

External Debugging• Debug a session that is spawned from a remote

application or service.• Step thorough your code and view the data as it was

initialized somewhere else in the world.

• Your application’s session sets a DEBUG Flag with a named Identifier

• You tell Toad which session to grab. Toad automatically steps into the code.

Page 9: Plsql+tips+n+tricks+2011

9

Editor 201• Never build a DBMS_OUTPUT statement manually !

– Right-click – Output Statements• Find a matching END IF, END or ) using bracketing• Code Folding• Code Refactoring

Page 10: Plsql+tips+n+tricks+2011

10

Code Road Map – Document and Create Local Test/Development Environments – 1 Click!

• Diagram Views & PL/SQL Objects– Generate Test Data– Generate DDL Scripts– Build HTML Reports

Page 11: Plsql+tips+n+tricks+2011

11

PL/SQL Profiler (DBMS_ & Hierarchical Support)

• Find out which lines take longer to run than others.• Identify execution bottlenecks• Figure out what needs tuning

Integrated with the Editor for instant analysis.

Graphs for quicker identification.

Page 12: Plsql+tips+n+tricks+2011

12

PL/SQL Execution – View Collections• Return Values & Out Parameters for your PL/SQL – let Toad

build DMBS_OUPUT for you• Example – A 2 Dimensional PL/SQL Table Package Function

that returns a PL/SQL Table.

Page 13: Plsql+tips+n+tricks+2011

13

PL/SQL Execution – View REF Cursors• Does your PL/SQL return a REF Cursor? Let Toad put it

into a Data Grid for you.

Page 14: Plsql+tips+n+tricks+2011

14

3rd Party Source Code Control Integration

• CVS• MSFT TFS 2005, 2008, 2010• MSFT Visual Source Safe• Perforce• PVCS (Serena)• Subversion

Control files or additionally control objects in the database via Toad’s Team Coding Feature

Page 15: Plsql+tips+n+tricks+2011

15

CodeXpert – let Toad review your code before your peers laugh at you

• Analyzes your code against Best Practices rules developed by Steven Feuerstein, Bert Scalzo, and Quest’s Oracle experts.

Explains why your code is flagged and

gives advice for better implementations.

Can identify SQL that needs Optimized.

Page 16: Plsql+tips+n+tricks+2011

16

Ok, you’ve written some kick-butt PL/SQL, but does it work?• Quest’s latest PL/SQL tool automatically tests your

PL/SQL for correctness.

Step 1: Tell Code Tester what your program does in PLAIN ENGLISH

Page 17: Plsql+tips+n+tricks+2011

17

Code Tester for Oracle Writes the Test Code For You!

Step 2: Sit back and relax as Code Tester generates your test code.

Page 18: Plsql+tips+n+tricks+2011

18

Run your tests on demand to see what your programs DO and DO NOT accomplish.

Step 3: Analyze the results. RED = BAD. See the Expected VS Actual Results.

Page 19: Plsql+tips+n+tricks+2011

19

Test Performance/Scalability

• Your stored procedure runs OK for 1 user, how will it handle 10? 50? 100?

• Toad can answer that question, track response time to user load

Page 20: Plsql+tips+n+tricks+2011

© 2009 Quest Software, Inc. ALL RIGHTS RESERVED

Thank youThank you Questions?you