﻿<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Steven Feuerstein's Blog</title>
    <description>&lt;table cellspacing="1" cellpadding="1"&gt;
        &lt;tr&gt;
            &lt;td valign="top"&gt;&lt;img height="183" alt="" width="139" src="/Portals/0/Blog/blog-steven-feuerstein.png" /&gt;&lt;/td&gt;
            &lt;td valign="top"&gt;Steven Feuerstein is considered one of the world's leading experts on the Oracle PL/SQL language, having written ten books on PL/SQL (all published by O'Reilly Media, including Oracle PL/SQL Programming. Steven has been developing software since 1980, spent five years with Oracle (1987-1992) and has served as PL/SQL Evangelist for Quest Software since January 2001. He is also an Oracle ACE Director. He writes regularly for Oracle Magazine, which named him the PL/SQL Developer of the Year in both 2002 and 2006.
            &lt;p&gt;&amp;#160;Steven's blog provides advice and code that you can put to immediate use in your world of programming.&amp;#160;&lt;/p&gt;
            &lt;p&gt;&lt;font color="#003366" size="3"&gt;&lt;strong&gt;Recent postings on his  PL/SQL Obsession:&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
&lt;/table&gt;</description>
    <link>http://www.toadworld.com/BLOGS/tabid/67/BlogId/13/Default.aspx</link>
    <language>en-US</language>
    <managingEditor>Steven Feuerstein</managingEditor>
    <webMaster>webmaster@toadworld.com</webMaster>
    <pubDate>Thu, 18 Mar 2010 09:51:28 GMT</pubDate>
    <lastBuildDate>Thu, 18 Mar 2010 09:51:28 GMT</lastBuildDate>
    <docs>http://backend.userland.com/rss</docs>
    <generator>Blog RSS Generator Version 3.2.0.15477</generator>
    <item>
      <title>Automatic refactoring in PL/SQL tools – Part 2</title>
      <description>&lt;div&gt;In &lt;a href="http://www.toadworld.com/Default.aspx?tabid=67&amp;EntryID=321"&gt;part 1 of this series&lt;/a&gt;, I reviewed the automated refactoring features in SQL Developer. Now I will check out PL/SQL Developer (version 7.1.5)'s refactoring features.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;To access these features, I highlight some code in a procedure edit window and then choose Refactoring from the right click menu. I see these options:&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;
&lt;img height="134" alt="" width="432" src="http://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.com/Portals/0/blogimages/Steven Feuerstein/SF-Blog010509-1.gif" /&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;I explore each of these below.&lt;br /&gt;
 &lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&lt;font size="3"&gt;Rename item&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;If I highlight the name of identifier in its declaration section, the Rename item option is enabled:&lt;/div&gt;
&lt;div&gt; &lt;br /&gt;
&lt;img alt="" src="http://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.com/Portals/0/blogimages/Steven Feuerstein/SF-Blog010509-2.gif" /&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;I specified "abc" as the new name for this variable and PL/SQL Developer correctly substituted all instances of that identifier:&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;
&lt;img alt="" src="http://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.com/Portals/0/blogimages/Steven Feuerstein/SF-Blog010509-3.gif" /&gt; &lt;/div&gt;
&lt;div&gt; &lt;br /&gt;
What if I have another variable with the same name in a different scope? PL/SQL Developer does a nice job of recognizing that it should not change it:&lt;/div&gt;
&lt;div&gt; &lt;br /&gt;
&lt;img alt="" src="http://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.com/Portals/0/blogimages/Steven Feuerstein/SF-Blog010509-4.gif" /&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;Sadly, it's not yet working at genius level. If I include in the subprogram a reference to the outer l_cursor variable, it does not change that name:&lt;br /&gt;
&lt;br /&gt;
&lt;img alt="" src="http://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.com/Portals/0/blogimages/Steven Feuerstein/SF-Blog010509-5.gif" /&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;strong&gt;Conclusion:&lt;/strong&gt;  Works quite well, though it would be nice if I could highlight an identifier name anywhere in the program and have it do a rename (not only in the declaration statement for that variable). Could be a bit smarter, but for most "normal" scenarios, it should be fine.&lt;br /&gt;
 &lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&lt;font size="3"&gt;Extract procedure&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;This is one of the most important refactorings: take logic out of your executable section and "hide" it inside a local procedure – or in a schema-level procedure. So I highlighted a line of code and choose this option. I was then asked to provide the new procedure name:&lt;br /&gt;
&lt;br /&gt;
&lt;img alt="" src="http://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.com/Portals/0/blogimages/Steven Feuerstein/SF-Blog010509-6.gif" /&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;After providing that name and pressing OK, I see the following:&lt;br /&gt;
&lt;br /&gt;
&lt;img alt="" src="http://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.com/Portals/0/blogimages/Steven Feuerstein/SF-Blog010509-7.gif" /&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;Well...that didn't go very well. Notice that it grabbed a part of the next line (DBMS_SQL.PARSE), even though I didn't highlight it. Ugh. OK, I will do it again, with just the code from that single open_cursor line. The result looks much better; notice that the tool correctly extracted all local variables and arguments referenced in the code and now passes them in as arguments:&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;img alt="" src="http://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.com/Portals/0/blogimages/Steven Feuerstein/SF-Blog010509-8.gif" /&gt;&lt;br /&gt;
 &lt;/div&gt;
&lt;div&gt;There is one big problem, however: the code will not compile, because the subprogram was inserted &lt;em&gt;before&lt;/em&gt; the l_cursor declaration and that is invalid:&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;
&lt;img alt="" src="http://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.com/Portals/0/blogimages/Steven Feuerstein/SF-Blog010509-9.gif" /&gt; &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;Here's a nice touch, though: if your highlighted code references local variable that are used &lt;em&gt;only&lt;/em&gt; in that highlighted code, PL/SQL Developer will move the declaration for that variable out of the main program and into the local module. In other words, from this:&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;&lt;img alt="" src="http://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.com/Portals/0/blogimages/Steven Feuerstein/SF-Blog010509-10.gif" /&gt; &lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;to:&lt;br /&gt;
&lt;br /&gt;
&lt;img alt="" src="http://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.com/Portals/0/blogimages/Steven Feuerstein/SF-Blog010509-11.gif" /&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;strong&gt;Conclusion:&lt;/strong&gt;  Disappointing overall. It's got the right idea and has been pretty-well thought through, but has at least two fairly serious flaws. Also, SQL Developer offers the option to define locally or store as a separate subprogram, which PL/SQL Dev does not.&lt;br /&gt;
 &lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&lt;font size="3"&gt;Extract local constant&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;Here's what the help doc says about this one:&lt;br /&gt;
&lt;br /&gt;
"If a certain expression should be converted to a local constant, you can select it and provide the constant name. A local constant will be created within the current subprogram, of a type that is determined from the expression. All occurrences of the expression in the current subprogram will be replaced by the constant name."&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;All righty – let's try it out. I will create a constant for the call to the open_cursor function:&lt;br /&gt;
&lt;br /&gt;
&lt;img alt="" src="http://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.com/Portals/0/blogimages/Steven Feuerstein/SF-Blog010509-12.gif" /&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;And the result:&lt;br /&gt;
&lt;br /&gt;
&lt;img alt="" src="http://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.com/Portals/0/blogimages/Steven Feuerstein/SF-Blog010509-13.gif" /&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;PL/SQL Dev did a good job of &lt;em&gt;not&lt;/em&gt; including the ; from the highlighted text in the value assigned to the constant. It correctly replaced the call to the function with the named constant. It did &lt;em&gt;not&lt;/em&gt;, however, come up with the right datatype for the constant. Instead, it seems to have simply added up the number of characters in the selected text. That's just weird!&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;Next I will highlight the local variable and change it to a constant:&lt;/div&gt;
&lt;div&gt; &lt;br /&gt;
&lt;img alt="" src="http://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.com/Portals/0/blogimages/Steven Feuerstein/SF-Blog010509-14.gif" /&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;The result is not great:&lt;br /&gt;
&lt;br /&gt;
&lt;img alt="" src="http://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.com/Portals/0/blogimages/Steven Feuerstein/SF-Blog010509-15.gif" /&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;It seems to me that it should have left the original declaration of l_cursor alone. The result is code that will not compile.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;strong&gt;Conclusion:&lt;/strong&gt;  marginally useful refactoring.&lt;br /&gt;
 &lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&lt;font size="3"&gt;Extract global constant&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;PL/SQL Dev help tells us the following about this feature:&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;"If a certain expression should be converted to a global constant, you can select it and provide the constant name. A global constant will be created within the current package, of a type that is determined from the expression. All occurrences of the expression in the current package will be replaced by the constant name."&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;So what does this do? Well, if I use it inside my procedure, it acts the same as with a local constant extraction. I would have thought it should prompt me for the package name and either move the variable to that package or create a new package with that name.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;Next I tried in a package:&lt;br /&gt;
&lt;br /&gt;
&lt;img alt="" src="http://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.com/Portals/0/blogimages/Steven Feuerstein/SF-Blog010509-16.gif" /&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;and it did the right thing, sort of:&lt;br /&gt;
&lt;br /&gt;
&lt;img alt="" src="http://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.com/Portals/0/blogimages/Steven Feuerstein/SF-Blog010509-17.gif" /&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;It still does not work properly with datatypes, though. It just defines them as VARCHAR2 all the time.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;strong&gt;Conclusion:&lt;/strong&gt;  same as for local constant....minimally useful.&lt;br /&gt;
 &lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&lt;font size="3"&gt;Swap assignment&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;A very minor "refactoring". Use it to change an assignment of this form:&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;a := b;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;to&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;b := a;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;It's fairly smart. You don't have to highlight the entire assignment statement, just a part of it, and PL/SQL Dev will move everything on the right to the left.&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;strong&gt;Conclusion:&lt;/strong&gt;  not really a refactoring, but it could be a useful accelerator on occasion.&lt;br /&gt;
 &lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&lt;font size="3"&gt;Replace assignment with initialization&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;The help doc says:&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;"If a local variable assignment is purely for initialization, you can move it to the declaration of the variable. You can right-click on a statement or select multiple statements."&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;So I started with this code:&lt;/div&gt;
&lt;div&gt; &lt;br /&gt;
&lt;img alt="" src="http://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.com/Portals/0/blogimages/Steven Feuerstein/SF-Blog010509-18.gif" /&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;When I clicked on the variable name, the identifiers lit up:&lt;br /&gt;
&lt;br /&gt;
&lt;img alt="" src="http://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.com/Portals/0/blogimages/Steven Feuerstein/SF-Blog010509-19.gif" /&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;I then chose my refactoring option&lt;/div&gt;
&lt;div&gt; &lt;br /&gt;
&lt;img alt="" src="http://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.com/Portals/0/blogimages/Steven Feuerstein/SF-Blog010509-20.gif" /&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;and ended up with this:&lt;br /&gt;
&lt;br /&gt;
&lt;img alt="" src="http://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.comhttp://www.toadworld.com/Portals/0/blogimages/Steven Feuerstein/SF-Blog010509-21.gif" /&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;That's nice...though I have one concern and one desire:&lt;/div&gt;
&lt;ul type="disc"&gt;
    &lt;li&gt;Concern: the change is valid, but it could cause problems. When an exception raised in the declaration section, it cannot be handled within that block's exception section. The exception &lt;em&gt;always &lt;/em&gt;propagates unhandled to the outer block. So making this change could affect program behavior. &lt;br /&gt;
     &lt;/li&gt;
    &lt;li&gt;Desire: This would be even nicer if it was combined with the option to move the assignment to an initialization &lt;em&gt;procedure&lt;/em&gt; not simply to the declaration statement.&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;&lt;strong&gt;Conclusion:&lt;/strong&gt;  mildly useful, but sometimes &lt;em&gt;not desireable&lt;/em&gt; due to the way exception propagation works in PL/SQL.&lt;br /&gt;
 &lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&lt;font size="3"&gt;Overall Conclusion&lt;/font&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;Refactoring in PL/SQL Developer is minimal, but useful. It's done in a fairly smart way. Now if they would only give me a key stroke to pop up the refactoring menu, rather than having to make my way down through two levels of right click menu options.&lt;/div&gt;</description>
      <link>http://www.toadworld.com/BLOGS/tabid/67/EntryID/328/Default.aspx</link>
      <author>Steven Feuerstein</author>
      <comments>http://www.toadworld.com/BLOGS/tabid/67/EntryID/328/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.toadworld.com/Default.aspx?tabid=67&amp;EntryID=328</guid>
      <pubDate>Tue, 06 Jan 2009 16:30:00 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.toadworld.com/DesktopModules/Blog/Trackback.aspx?id=328</trackback:ping>
    </item>
  </channel>
</rss>