<?xml version="1.0" encoding="UTF-8"?>
<rss version='2.0' xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Randy Fair</title>
    <description>digging coding</description>
    <link>https://randyfair.silvrback.com/feed</link>
    <atom:link href="https://randyfair.silvrback.com/feed" rel="self" type="application/rss+xml"/>
    <category domain="randyfair.silvrback.com">Content Management/Blog</category>
    <language>en-us</language>
      <pubDate>Mon, 12 Nov 2018 20:39:29 -0600</pubDate>
    <managingEditor>randyfair@gmail.com (Randy Fair)</managingEditor>
      <item>
        <guid>http://randyfair.com/jsp-sql-adhoc-datagrid#45743</guid>
          <pubDate>Mon, 12 Nov 2018 20:39:29 -0600</pubDate>
        <link>http://randyfair.com/jsp-sql-adhoc-datagrid</link>
        <title>JSP SQL Adhoc DataGrid </title>
        <description>Quick and Dirty</description>
        <content:encoded><![CDATA[<p>One of my &quot;Hello World&quot; web pages I always do when beginning a project is a quick and dirty <strong>datagrid</strong>.  Today&#39;s language of choice is <strong>JSP</strong> (Java Server Pages) and the back-end database is <strong>MySQL</strong>.<br>
Here&#39;s what the final output looks like: <br>
<img alt="Silvrback blog image" class="sb_float_center" src="https://silvrback.s3.amazonaws.com/uploads/23880a7a-de94-48bc-822d-284a5b68fec4/JSPAdhocPage.png" /></p>

<p>There are lot&#39;s of things we could add like clickable headers that sort the grid, edit links on each row, drill downs, row numbering and counts, etc.  But I called this Quick and Dirty for a reason!  Sheesh give a guy a break.  I&#39;ll share one of my &quot;fully functional&quot; data grids later.</p>

<p>Code Please:</p>
<div class="highlight"><pre><span></span><span class="k">&lt;%@</span><span class="n">page</span> <span class="n">import</span><span class="o">=</span> <span class="s">&quot;java.sql.Connection&quot;</span><span class="k">%&gt;</span>
<span class="k">&lt;%@</span><span class="n">page</span> <span class="n">import</span><span class="o">=</span> <span class="s">&quot;java.sql.Statement&quot;</span><span class="k">%&gt;</span>
<span class="k">&lt;%@</span><span class="n">page</span> <span class="n">import</span><span class="o">=</span> <span class="s">&quot;java.sql.ResultSet&quot;</span><span class="k">%&gt;</span>
<span class="k">&lt;%@</span><span class="n">page</span> <span class="n">import</span><span class="o">=</span> <span class="s">&quot;java.sql.ResultSetMetaData&quot;</span><span class="k">%&gt;</span>
<span class="k">&lt;%@</span><span class="n">page</span> <span class="n">import</span><span class="o">=</span> <span class="s">&quot;java.sql.DriverManager&quot;</span><span class="k">%&gt;</span>
<span class="cp">&lt;!DOCTYPE html&gt;</span>

<span class="nt">&lt;html</span> <span class="na">lang=</span><span class="s">&quot;en&quot;</span><span class="nt">&gt;</span>
    <span class="nt">&lt;head&gt;</span>
        <span class="nt">&lt;meta</span> <span class="na">charset=</span><span class="s">&quot;utf-8&quot;</span> <span class="nt">/&gt;</span>
        <span class="nt">&lt;title&gt;&lt;/title&gt;</span>
        <span class="nt">&lt;link</span> <span class="na">rel=</span><span class="s">&quot;stylesheet&quot;</span> <span class="na">href=</span><span class="s">&quot;normalize.css&quot;</span><span class="nt">&gt;</span>
        <span class="nt">&lt;link</span> <span class="na">rel=</span><span class="s">&quot;stylesheet&quot;</span> <span class="na">href=</span><span class="s">&quot;skeleton.css&quot;</span><span class="nt">&gt;</span>
        <span class="nt">&lt;style&gt;</span>
            #SQLAdhocBox    {width: 75%; height: 300px; margin-left: 12.5%; margin-top: 2%; margin-bottom: 2%;}
            #SQLAdhocText   {display: block; width: 100%; height: 100%; }
        <span class="nt">&lt;/style&gt;</span>
     <span class="nt">&lt;/head&gt;</span>
    <span class="nt">&lt;body&gt;</span>
        <span class="k">&lt;%</span> 
            <span class="n">String</span> <span class="n">query</span><span class="o">=</span><span class="n">request</span><span class="o">.</span><span class="na">getParameter</span><span class="o">(</span><span class="s">&quot;SQLAdhocText&quot;</span><span class="o">);</span>
            <span class="k">if</span> <span class="o">(</span><span class="n">query</span><span class="o">==</span><span class="s">&quot;&quot;</span><span class="o">)</span> <span class="o">{</span><span class="n">query</span> <span class="o">=</span> <span class="s">&quot;select * from users&quot;</span><span class="o">;}</span>
        <span class="k">%&gt;</span>
        <span class="nt">&lt;div</span> <span class="na">id=</span><span class="s">&quot;SQLAdhocBox&quot;</span><span class="nt">&gt;</span>
            <span class="nt">&lt;form</span> <span class="na">id=</span><span class="s">&quot;SQLAdhocForm&quot;</span> <span class="na">action=</span><span class="s">&quot;#&quot;</span><span class="nt">&gt;</span>
                SQL Statement: <span class="nt">&lt;br</span> <span class="nt">/&gt;</span>
                <span class="nt">&lt;textarea</span> <span class="na">id=</span><span class="s">&quot;SQLAdhocText&quot;</span> <span class="na">name=</span><span class="s">&quot;SQLAdhocText&quot;</span><span class="nt">&gt;</span><span class="k">&lt;%=</span><span class="n">query</span> <span class="k">%&gt;</span><span class="nt">&lt;/textarea&gt;</span>
                <span class="nt">&lt;input</span> <span class="na">type=</span><span class="s">&quot;submit&quot;</span> <span class="nt">/&gt;</span>
            <span class="nt">&lt;/form&gt;</span>
        <span class="nt">&lt;/div&gt;</span>
        <span class="nt">&lt;div</span> <span class="na">id=</span><span class="s">&quot;container&quot;</span><span class="nt">&gt;</span>
            <span class="nt">&lt;table</span> <span class="na">id=</span><span class="s">&quot;SQLAdhocTable&quot;</span><span class="nt">&gt;</span>
                <span class="nt">&lt;thead&gt;&lt;tr&gt;</span>
                <span class="k">&lt;%</span>
                <span class="k">try</span>
                <span class="o">{</span>
                    <span class="n">Class</span><span class="o">.</span><span class="na">forName</span><span class="o">(</span><span class="s">&quot;com.mysql.jdbc.Driver&quot;</span><span class="o">);</span>
                    <span class="n">String</span> <span class="n">url</span><span class="o">=</span><span class="s">&quot;jdbc:mysql://1.22.333.4444:3306/testdb&quot;</span><span class="o">;</span>
                    <span class="n">String</span> <span class="n">username</span><span class="o">=</span><span class="s">&quot;tester&quot;</span><span class="o">;</span>
                    <span class="n">String</span> <span class="n">password</span><span class="o">=</span><span class="s">&quot;retset&quot;</span><span class="o">;</span>
                    <span class="n">Connection</span> <span class="n">conn</span><span class="o">=</span><span class="n">DriverManager</span><span class="o">.</span><span class="na">getConnection</span><span class="o">(</span><span class="n">url</span><span class="o">,</span><span class="n">username</span><span class="o">,</span><span class="n">password</span><span class="o">);</span>
                    <span class="n">Statement</span> <span class="n">stmt</span><span class="o">=</span><span class="n">conn</span><span class="o">.</span><span class="na">createStatement</span><span class="o">();</span>
                    <span class="n">ResultSet</span> <span class="n">rs</span><span class="o">=</span><span class="n">stmt</span><span class="o">.</span><span class="na">executeQuery</span><span class="o">(</span><span class="n">query</span><span class="o">);</span>
                    <span class="n">ResultSetMetaData</span> <span class="n">metadata</span> <span class="o">=</span> <span class="n">rs</span><span class="o">.</span><span class="na">getMetaData</span><span class="o">();</span>
                    <span class="kt">int</span> <span class="n">columnCount</span> <span class="o">=</span> <span class="n">metadata</span><span class="o">.</span><span class="na">getColumnCount</span><span class="o">();</span>  

            <span class="c1">// Loop for all the columns and create column headers</span>
                    <span class="k">for</span> <span class="o">(</span><span class="kt">int</span> <span class="n">i</span> <span class="o">=</span> <span class="mi">1</span><span class="o">;</span> <span class="n">i</span> <span class="o">&lt;=</span> <span class="n">columnCount</span><span class="o">;</span> <span class="n">i</span><span class="o">++)</span> <span class="o">{</span> 
                    <span class="k">%&gt;</span>
                        <span class="nt">&lt;th&gt;</span><span class="k">&lt;%=</span><span class="n">metadata</span><span class="o">.</span><span class="na">getColumnName</span><span class="o">(</span><span class="n">i</span><span class="o">)</span><span class="k">%&gt;</span><span class="nt">&lt;/th&gt;</span>
                    <span class="k">&lt;%}</span> <span class="k">%&gt;</span>
                <span class="nt">&lt;/tr&gt;&lt;/thead&gt;</span>
                <span class="nt">&lt;tbody&gt;</span>
                    <span class="k">&lt;%</span>
            <span class="c1">// Loop for all the rows</span>
                    <span class="k">while</span><span class="o">(</span><span class="n">rs</span><span class="o">.</span><span class="na">next</span><span class="o">())</span>
                        <span class="o">{</span><span class="k">%&gt;</span>
                            <span class="nt">&lt;tr&gt;</span>
                            <span class="k">&lt;%</span>
                    <span class="c1">// Loop for all the columns and get the data</span>
                            <span class="k">for</span> <span class="o">(</span><span class="kt">int</span> <span class="n">i</span> <span class="o">=</span> <span class="mi">1</span><span class="o">;</span> <span class="n">i</span> <span class="o">&lt;=</span> <span class="n">columnCount</span><span class="o">;</span> <span class="n">i</span><span class="o">++)</span> <span class="o">{</span> <span class="k">%&gt;</span>
                                <span class="nt">&lt;td&gt;</span><span class="k">&lt;%=</span><span class="n">rs</span><span class="o">.</span><span class="na">getString</span><span class="o">(</span><span class="n">i</span><span class="o">)</span> <span class="k">%&gt;</span><span class="nt">&lt;/td&gt;</span>
                           <span class="k">&lt;%}%&gt;</span>
                            <span class="nt">&lt;/tr&gt;</span>
                        <span class="k">&lt;%}</span>
                        <span class="n">rs</span><span class="o">.</span><span class="na">close</span><span class="o">();</span> <span class="n">stmt</span><span class="o">.</span><span class="na">close</span><span class="o">();</span> <span class="n">conn</span><span class="o">.</span><span class="na">close</span><span class="o">();</span> 
                <span class="o">}</span>
                <span class="k">catch</span><span class="o">(</span><span class="n">Exception</span> <span class="n">e</span><span class="o">)</span> <span class="o">{</span> <span class="n">e</span><span class="o">.</span><span class="na">printStackTrace</span><span class="o">();}</span>
                <span class="k">%&gt;</span>
                <span class="nt">&lt;/tbody&gt;</span>
            <span class="nt">&lt;/table&gt;</span>
        <span class="nt">&lt;/div&gt;</span>
    <span class="nt">&lt;/body&gt;</span>
<span class="nt">&lt;/html&gt;</span>
</pre></div>
<p>I know, I know, I know...  You shouldn&#39;t put code in the .jsp file, it should be in a .java or class file.  You should have safety code, you should, &quot;blah blah blah.&quot;  I told you this was my *Quick and Dirty version!</p>
]]></content:encoded>
      </item>
      <item>
        <guid>http://randyfair.com/what-is-an-application-architect#45713</guid>
          <pubDate>Fri, 09 Nov 2018 09:22:34 -0600</pubDate>
        <link>http://randyfair.com/what-is-an-application-architect</link>
        <title>What does an Application Architect Do?</title>
        <description>And how do you do it?</description>
        <content:encoded><![CDATA[<p><iframe  text="Embed Code"  src='//www.youtube.com/embed/YwTyOAsP4lI' width="100%" height="315" align="center"> Embed Code </iframe><br>
Most folks say, &quot;Protect your IP.&quot; <em>Intellectual Property - not Internet Protocol!</em>  I&#39;m not going to preach , but I believe in sharing and giving generously (unless it&#39;s my wife, coffee or croissants).  So here&#39;s what I do and how I do it...</p>

<blockquote>
<p>I&#39;m a software architect.  Do you have to go to school?    Not always.  You just need to be intuitive and good with tech and code.</p>
</blockquote>

<p>Long starry eyed version: What I do is make your tech dreams come true.  How I do it, is by using discipline, creativity, skill, confidence and memory.  Yeah, I&#39;m that cool -and humble!  Let&#39;s break that down.</p>

<p><strong>Your tech dreams come at me in different ways.</strong>  Like - <em>An extra belly button.</em>  A desperate email or phone call.  A function doc replete with explicit objects, attributes and names (not from an adult store - c&#39;mon we&#39;re PG-13).  A brainstorming white board session where the C level guy says, &quot;I want to have a dashboard view of all our important stuff&quot; -C level guys always talk like that.  NO MATTER HOW THEY COME AT YOU - You cannot freeze like a crappy right-fielder praying that no-one actually hits to you - <a href="https://www.youtube.com/watch?v=knd4N1DbJqc">don&#39;t blow it Smalls!</a>  </p>

<p><strong>Discipline.</strong>  You also CANNOT jump on that project like a middle-aged fat man on a Thanksgiving sweet potato casserole with forks in both hands which is my first inclination to both of those. BUT First, let&#39;s find out what they really want.  I was told, they want A.  What they really want is A123.  Neither of us know what the 1-2-3 part is.  And I will never know what they actually want unless I chill for a minute, think about what they said, then ask a bagillion more questions (without boring them or pissing them off - <em>Note: you really need to read the room like <a href="https://www.youtube.com/watch?v=jSfd-8ZteHw">Daniel Negreanu</a>.  The better I am at this, the more money or credit I make.  Piratey voice: &quot;Tricky waters these, but rewards thar be!&quot;</em>  </p>

<p><img alt="Silvrback blog image" class="sb_float" src="https://silvrback.s3.amazonaws.com/uploads/c318d341-0b2a-4c7c-affb-20479ed51254/Alex_Trebek_right_speaks_to_CNNs_Larry_King.jpg" />  Think Larry King not Alex Trebek.  You know where you wanna go, but you let your guest get you there.  You&#39;re even willing to take unexpected paths.  But your questions are pretty much what you expected before you were hit with the project.  And you only ask the ones you don&#39;t already know the answers to.  </p>

<p>Here they are:</p>

<ul>
<li><strong>Who are your users?</strong>

<ul>
<li>How many people will actually interact with this?</li>
<li>How many will input?</li>
<li>How many will see it?</li>
<li>What are their day jobs and job titles?</li>
</ul></li>
<li><strong>What is your environment?</strong>

<ul>
<li>How much latitude and decision making authority do I have?</li>
<li>What tech stacks are allowed?</li>
<li>Version Control?</li>
<li>Sandbox, Development, and Production?</li>
<li>Online?  In-house? </li>
<li>Windows and/or Apple and/or Unix?</li>
<li>Hosted where?</li>
<li>Will this interact with other apps?</li>
<li>Does this have to be compliant with some government or industry regulation or standardization?</li>
</ul></li>
<li>** What is your data?**

<ul>
<li>What are your distinct groups of objects?</li>
<li>What do your objects do and how are they related to this project?</li>
<li>How much info do you need to know and how long do you care to know it?<br>
<em>Note:-This is the most important data question.</em>  This will tell you how many rows and how </li>
</ul></li>
<li>** Who will I be working with?**

<ul>
<li>Other programmers? - What are their skills or specialties?</li>
<li>Designers?</li>
<li>Key stake holders?</li>
<li>Users?</li>
</ul></li>
<li><strong>What is the Final product like?</strong>

<ul>
<li>An app?</li>
<li>An app that will have custom developments based on the client?</li>
<li>A report (be it paper, online, email, charts, etc.)</li>
<li>Will it need to be available to other apps? (Like an API or Web Service)</li>
</ul></li>
</ul>

<p><strong>Creativity.</strong>  Now comes the artsy fartsy part- sy.  Shutup.  I&#39;m a musician - not a great one, but not bad.  Every good developer has his  <em>feelings side,</em> and this is one of the important times to use it. Begin to brain-storm and envision the actual end-product.  Work backwards from there and see all the parts.  OK now I sound like Obi-Wan coming across Luke&#39;s visor.  Whatever, just picture a working model and how you might get there from a 500 foot view.  The trickier or more unique the problem, the harder this is and why we make the big bucks.  The key to this step is iteration.  This is the imaginative demo-ing phase.  Just like we do the actual demo and user testing pieces, is how we do this but the medium is either a white board or our mouths.  No I don&#39;t blow kisses at people, unlike my underwater MerMan son, I just voice what I&#39;m picturing to see how it resonates and then modify it based on my feedback.  </p>

<p><strong>Skill.</strong>  This is learned, practiced, fiddled with and at the heart of a coder.  It&#39;s frickin&#39; fun and  cool and what makes us who we are.  We code.  I&#39;m agnostic when it comes to a language and pretty much when it comes to everything else except ironically God.  I don&#39;t have any strong opinions about editors, syntax, object-oriented vs event driven, API or really anything.  I have the end in mind and whatever mandate I&#39;m working with.  If I get to choose - everything, then it will probably be a <a href="https://nodejs.org/en/about/">Node.js</a> app connecting to a SQL- Server back-end with a thin browser based front-end using very few if any frameworks or libraries and be able to consume and provide some RESTful APIs.   Sure I like C#, Java, REor wThe specific language I&#39;m working with at the time is not important, just that I&#39;m proficient at it.</p>

<p>The stuff below is just my notes to finish this article...<br>
* **Do you need a good designer?</p>

<ul>
<li>Business Logic Layer</li>
<li>Front End - multiple versions depending on the userType</li>
<li>Apps - multiple based on userType or deviceType or module</li>
<li>3rd party pieces - are there a lot?  are they with big names like ORACLE or MicroSoft? Are they dependent on a particular version?</li>
<li>How to logon</li>
<li>Branches per client</li>
<li>Overall diagram</li>
<li>Function Diagrams</li>
<li>Documentation</li>
<li>Tutorials</li>
<li>Collaboritive</li>
<li>Web Services or not</li>
<li>Selling pieces (like web services or generic apps, or by client or add-ons)</li>
<li>Current knowledge / familiarity of in-house personnel for usability and maintenance
-languages, platforms, user interfaces, report engines
-how easy is it to find programmers or will it be supported later</li>
<li>will this grow? or will it just fit in with other stuff you have or the client already has</li>
<li>Hard core tool or novelty?</li>
<li>Public Visibility </li>
</ul>
]]></content:encoded>
      </item>
      <item>
        <guid>http://randyfair.com/inline-view-update#45690</guid>
          <pubDate>Tue, 06 Nov 2018 21:17:28 -0600</pubDate>
        <link>http://randyfair.com/inline-view-update</link>
        <title>ORACLE Correlated Sub-query Updates</title>
        <description>Try Inline View Updates Instead</description>
        <content:encoded><![CDATA[<p><img alt="Silvrback blog image " src="https://silvrback.s3.amazonaws.com/uploads/6a4f3823-29b7-448a-993c-2018f2e9b29a/dt951117dhc0.gif" /><br>
If you&#39;re reading anything past the title of this article, then I assume you are looking for some seriously geeky stuff.  <em>By the way, you&#39;re sick and you need some sunshine...</em></p>

<p><strong>Table A Needs Table B&#39;s Data</strong><br>
Often we find ourselves (that is only us nerds) trying to update data in one table that is some sort of machination of another table&#39;s data.  If we are using big tables, each with more than 10 million rows, and we  are updating thousands of records, then we might first try a <br>
<strong>correlated sub-query update</strong> that looks something like this:</p>
<div class="highlight"><pre><span></span><span class="k">update</span> <span class="n">phone_book</span> <span class="n">a</span> 
    <span class="k">set</span> <span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">street</span><span class="p">,</span> <span class="n">street2</span><span class="p">,</span> <span class="n">city</span><span class="p">,</span> <span class="k">state</span><span class="p">,</span> <span class="n">zip</span><span class="p">)</span> <span class="o">=</span> 
        <span class="p">(</span><span class="k">select</span> <span class="n">b</span><span class="p">.</span><span class="n">name</span><span class="p">,</span> <span class="n">b</span><span class="p">.</span><span class="n">street</span><span class="p">,</span> <span class="n">b</span><span class="p">.</span><span class="n">street2</span><span class="p">,</span> <span class="n">b</span><span class="p">.</span><span class="n">city</span><span class="p">,</span> <span class="n">b</span><span class="p">.</span><span class="k">state</span><span class="p">,</span> <span class="n">b</span><span class="p">.</span><span class="n">zip</span> 
        <span class="k">from</span> <span class="n">new_phone_book</span> <span class="n">b</span> 
        <span class="k">where</span> <span class="n">a</span><span class="p">.</span><span class="n">pbid</span> <span class="o">=</span> <span class="n">b</span><span class="p">.</span><span class="n">pbid</span><span class="p">)</span>
<span class="k">where</span> <span class="n">a</span><span class="p">.</span><span class="n">pbid</span> <span class="k">in</span> <span class="p">(</span><span class="k">select</span> <span class="n">pbid</span> <span class="k">from</span> <span class="n">new_phone_book</span><span class="p">)</span>
</pre></div>
<p>I get that you looked this up already and found that the best way to do this is with a Correlated Sub-query.  And I also get, that you spent forever trying to find the best correlated sub-query syntax that would work, because it is awfully difficult to find anyone who knows squat about updating more than 1 column at a time from data from another table.  You may have even played with the where clause by taking it off or creating some new indices.</p>

<p>However, now that you created your lovely sub-query and have tried a million ways to run it, you are stuck because you tried to execute it an hour ago and it is now filling up your redo log space.</p>

<p><em>Quick note: go ahead and kill your update now.  It sucks and may never finish...  For help on how to find blocking sessions and how to kill them, see my Merc &#39;em blog</em></p>

<p><strong>Now for a better way.</strong>  Can you hear the birds singing and the soft wind blowing through the trees all signaling that the green meadows are just up ahead?  I call this next technique, an *Inline View Update.  Not very sexy or catchy, but dang, the code works a heck of a lot better!</p>
<div class="highlight"><pre><span></span><span class="c1">-- Inline View Update</span>
<span class="k">update</span> <span class="p">(</span>
        <span class="k">select</span> <span class="n">a</span><span class="p">.</span><span class="n">pbid</span><span class="p">,</span> <span class="n">a</span><span class="p">.</span><span class="n">name</span> <span class="k">as</span> <span class="n">aname</span><span class="p">,</span> <span class="n">a</span><span class="p">.</span><span class="n">street</span> <span class="k">as</span> <span class="n">astreet</span><span class="p">,</span> <span class="n">a</span><span class="p">.</span><span class="n">street2</span> <span class="k">as</span> <span class="n">astreet2</span><span class="p">,</span> 
            <span class="n">a</span><span class="p">.</span><span class="n">city</span> <span class="k">as</span> <span class="n">acity</span><span class="p">,</span> <span class="n">a</span><span class="p">.</span><span class="k">state</span> <span class="k">as</span> <span class="n">astate</span><span class="p">,</span> <span class="n">a</span><span class="p">.</span><span class="n">zip</span> <span class="k">as</span> <span class="n">azip</span><span class="p">,</span> 
                <span class="n">b</span><span class="p">.</span><span class="n">name</span> <span class="k">as</span> <span class="n">bname</span><span class="p">,</span> <span class="n">b</span><span class="p">.</span><span class="n">street</span> <span class="k">as</span> <span class="n">bstreet</span><span class="p">,</span> <span class="n">b</span><span class="p">.</span><span class="n">street2</span> <span class="k">as</span> <span class="n">bstreet2</span><span class="p">,</span> 
            <span class="n">b</span><span class="p">.</span><span class="n">city</span> <span class="k">as</span> <span class="n">bcity</span><span class="p">,</span> <span class="n">b</span><span class="p">.</span><span class="k">state</span> <span class="k">as</span> <span class="n">bstate</span><span class="p">,</span> <span class="n">b</span><span class="p">.</span><span class="n">zip</span> <span class="k">as</span> <span class="n">bzip</span>
    <span class="k">from</span> <span class="n">phone_book</span> <span class="n">a</span><span class="p">,</span> <span class="n">new_phone_book</span> <span class="n">b</span> 
    <span class="k">where</span> <span class="n">a</span><span class="p">.</span><span class="n">pbid</span> <span class="o">=</span> <span class="n">b</span><span class="p">.</span><span class="n">pbid</span>
<span class="p">)</span>
<span class="k">set</span> <span class="n">aname</span> <span class="o">=</span> <span class="n">bname</span><span class="p">,</span> <span class="n">astreet</span> <span class="o">=</span> <span class="n">bstreet</span><span class="p">,</span> <span class="n">astreet2</span> <span class="o">=</span> <span class="n">bstreet2</span><span class="p">,</span> <span class="n">acity</span> <span class="o">=</span> <span class="n">bcity</span><span class="p">,</span> <span class="n">astate</span> <span class="o">=</span> <span class="n">bstate</span><span class="p">,</span> <span class="n">azip</span> <span class="o">=</span> <span class="n">bzip</span>
</pre></div>
<p>Admittedly, the code looks super ugly compared to a nicely formatted correlated sub-query.  And the aliases are a pain to type, but who cares, it friggin works and fast.  It will outrun a home-schooled teenage groom on his wedding night and the other query above by exponential factors AND you won&#39;t have to fiddle with it.  Just do it, so you can get on with whatever you were trying to do before you found my stuff so dang helpful!  </p>

<p>As always, comment below or shoot me any questions on this.  Also note, this really only applies to <strong>ORACLE</strong> and I will be posting some SQL Server correlated update syntax later.  :)</p>

<p>Also note, even trying the new way of joining tables with <code>from phone_book a inner join new_phone_book b on a.pbid = b.pbid</code> works better with inline views.</p>
]]></content:encoded>
      </item>
  </channel>
</rss>