<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>MacLochlainns Weblog</title>
	<atom:link href="http://blog.mclaughlinsoftware.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.mclaughlinsoftware.com</link>
	<description>Michael McLaughlin&#039;s Technical Blog</description>
	<lastBuildDate>Thu, 17 May 2012 06:04:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Browser Enslavement?</title>
		<link>http://blog.mclaughlinsoftware.com/2012/05/11/browser-enslavement/</link>
		<comments>http://blog.mclaughlinsoftware.com/2012/05/11/browser-enslavement/#comments</comments>
		<pubDate>Sat, 12 May 2012 03:34:54 +0000</pubDate>
		<dc:creator>maclochlainn</dc:creator>
				<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Google Chrome]]></category>
		<category><![CDATA[Microsoft Windows 8]]></category>
		<category><![CDATA[Safari]]></category>

		<guid isPermaLink="false">http://blog.mclaughlinsoftware.com/?p=5893</guid>
		<description><![CDATA[Escape from New York, a cult classic, has Snake (Kurt Russell) rescue the President from Manhattan, which in this dystopian film’s theme is a prison. Windows 8 seems like a new dystopian version of Windows where only Microsoft’s browser works to perform real browser activities. Gone is the European Union’s antitrust suit. Why? Oh, yes, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.coinstudy.com/image-files/2-cent-coin-value-top.gif"><img style="margin-right:10px" src="http://www.coinstudy.com/image-files/2-cent-coin-value-top.gif" alt="" title="TwoCents" width="70" height="70" class="alignleft" /></a><a href="http://en.wikipedia.org/wiki/Escape_from_New_York"><em>Escape from New York</em></a>, a cult classic, has Snake (Kurt Russell) rescue the President from Manhattan, which in this dystopian film’s theme is a prison. <a href="http://windows.microsoft.com/en-US/windows-8/consumer-preview">Windows 8</a> seems like a new dystopian version of Windows where only Microsoft’s browser works to perform real browser activities.</p>
<p>Gone is the European Union’s antitrust suit. Why? Oh, yes, <a href="http://www.foxnews.com/scitech/2009/12/16/europe-drops-charges-browser-lawsuit-microsoft/">Microsoft promised to provide options to users of its platform</a>. Gone that! Will the European Union retake the mantle of the Avengers and free us from the mantle of Microsoft’s attempt to play Loki in compelling users back to their browser? </p>
<p>An excerpt from <a href="http://www.computerworld.com/s/article/9227056/Mozilla_accuses_Microsoft_of_anticompetitive_behavior_with_Windows_RT">Greg Keizer’s ComputerWorld piece</a>:</p>
<p style="margin-left:20px;margin-right:20px">&#8220;Windows on ARM [the former name for Windows RT] prohibits any browser except for Internet Explorer from running in the privileged &#8216;Windows Classic&#8217; environment,&#8221; said Anderson. &#8220;In practice, this means that only Internet Explorer will be able to perform many of the advanced computing functions vital to modern browsers in terms of speed, stability, and security to which users have grown accustomed.&#8221;</p>
<p>While I’ve used Microsoft Excel since version 3 – sent to me for review by Microsoft along with my first non-Mac mouse in 1990 – their browser is something to avoid. It’s the first thing that I disable when installing a new Windows’ instance, by substituting Mozilla’s Firefox.</p>
<p>My question is: Will all those accounts and finance folks who drive Microsoft Office sales because of Excel’s VBA features really drink the Kool-Aid and buy into this new generation of browser tyranny? Let’s hope they don’t! Maybe they’ll take a closer look at OpenOffice 3. <img src='http://blog.mclaughlinsoftware.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>However, I strongly doubt they’ll surrender their VBA driven models unless OpenOffice provides something similar. Let’s face it. Microsoft Excel’s VBA feature is probably one of the smartest thing Microsoft ever marketed because it’s seals the deal for the Microsoft cash cow &#8211; the Microsoft Office Suite.</p>
<p>Disclaimer: I’m primarily a Mac OS X, Linux, and Unix user, but like it or not, the reach of the Windows’ desktop is omnipresent in our lives; and let’s face it: Windows 8 will continue to be the most frequent choice for corporate desktops. It’s also the platform for Microsoft SQL Server. Therefore, it’s critical for us to rise up and shout for browser freedom – Firefox, Chrome, Safari, and the little guys too!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mclaughlinsoftware.com/2012/05/11/browser-enslavement/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Value or Reference?</title>
		<link>http://blog.mclaughlinsoftware.com/2012/05/10/value-or-reference/</link>
		<comments>http://blog.mclaughlinsoftware.com/2012/05/10/value-or-reference/#comments</comments>
		<pubDate>Thu, 10 May 2012 07:48:05 +0000</pubDate>
		<dc:creator>maclochlainn</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[SQL/PSM]]></category>
		<category><![CDATA[Stored Procedures]]></category>

		<guid isPermaLink="false">http://blog.mclaughlinsoftware.com/?p=5871</guid>
		<description><![CDATA[In class today, we reviewed pass-by-value (IN-only mode) parameters and pass-by-reference (INOUT and OUT mode) parameters for stored procedures. The analogy that finally seemed to hit home for the students was linking the modes to the story of Alice in Wonderland. Here&#8217;s the analogy and below is the code to support it: &#8220;A pass-by-value parameter [...]]]></description>
			<content:encoded><![CDATA[<p><a class="alignright" href="http://www.amazon.com/gp/product/B001HN694K/ref=as_li_tf_il?ie=UTF8&#038;tag=macloc-20&#038;linkCode=as2&#038;camp=1789&#038;creative=9325&#038;creativeASIN=B001HN694K"><img border="0" src="http://ws.assoc-amazon.com/widgets/q?_encoding=UTF8&#038;Format=_SL110_&#038;ASIN=B001HN694K&#038;MarketPlace=US&#038;ID=AsinImage&#038;WS=1&#038;tag=macloc-20&#038;ServiceVersion=20070822" ></a>In class today, we reviewed pass-by-value (<code>IN</code>-only mode) parameters and pass-by-reference (<code>INOUT</code> and <code>OUT</code> mode) parameters for stored procedures. The analogy that finally seemed to hit home for the students was linking the modes to the story of Alice in Wonderland.</p>
<p>Here&#8217;s the analogy and below is the code to support it:</p>
<p><span style="margin-left:30px"><em>&#8220;A pass-by-value parameter in a procedure is like sending an immutable copy of Alice into the rabbit hole, which means she can&#8217;t shrink, grow, or learn throughout the story; whereas, a pass-by-reference parameter in a procedure is like sending Alice into the rabbit hole where she can shrink, grow, fight the Jabberwocky, and learn things that make her life better when she exits the rabbit hole &#8211; consistent with the storyline of Alice&#8217;s revisit to Wonderland.&#8221;</em></span></p>
<p>The example code creates a stored procedure that accepts two parameters &#8211; one pass-by-value and one pass-by-reference. Inside the procedure there&#8217;s a local variable and a reassignment of value to the pass-by-reference parameter. It&#8217;s in this <code>wonderland</code> procedure (by the way don&#8217;t forget to manage the <code>DELIMITER</code> value when you test it):</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
</pre></td><td class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">PROCEDURE</span> wonderland
<span style="color: #66cc66;">&#40;</span> <span style="color: #993333; font-weight: bold;">IN</span>     pv_value_param  <span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">20</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">INOUT</span>  pv_ref_param    <span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">20</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #993333; font-weight: bold;">BEGIN</span>
&nbsp;
  <span style="color: #808080; font-style: italic;">/* Declare a variable. */</span>
  <span style="color: #993333; font-weight: bold;">DECLARE</span> lv_value_param  <span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">20</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
  <span style="color: #808080; font-style: italic;">/* Query the local variable and reference parameter before changing values. */</span> 
  <span style="color: #993333; font-weight: bold;">SELECT</span>   <span style="color: #ff0000;">'On Entry'</span> <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #ff0000;">&quot;Where&quot;</span>
  <span style="color: #66cc66;">,</span>        pv_value_param <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #ff0000;">&quot;Value Parameter&quot;</span>
  <span style="color: #66cc66;">,</span>        pv_ref_param <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #ff0000;">&quot;Reference Parameter&quot;</span>
  <span style="color: #66cc66;">,</span>        IFNULL<span style="color: #66cc66;">&#40;</span>lv_value_param<span style="color: #66cc66;">,</span><span style="color: #ff0000;">'     '</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #ff0000;">&quot;Local Variable&quot;</span>;
&nbsp;
  <span style="color: #808080; font-style: italic;">/* Assign a lowercase value parameter to a local variable. */</span>
  <span style="color: #993333; font-weight: bold;">SET</span> lv_value_param :<span style="color: #66cc66;">=</span> <span style="color: #993333; font-weight: bold;">LOWER</span><span style="color: #66cc66;">&#40;</span>pv_value_param<span style="color: #66cc66;">&#41;</span>;  
&nbsp;
  <span style="color: #808080; font-style: italic;">/* Assign a uppercase reference parameter value to the reference parameter. */</span>
  <span style="color: #993333; font-weight: bold;">SET</span> pv_ref_param :<span style="color: #66cc66;">=</span> <span style="color: #993333; font-weight: bold;">UPPER</span><span style="color: #66cc66;">&#40;</span>pv_ref_param<span style="color: #66cc66;">&#41;</span>;
&nbsp;
  <span style="color: #808080; font-style: italic;">/* Query the local variable and reference parameter after changing values. */</span> 
  <span style="color: #993333; font-weight: bold;">SELECT</span>   <span style="color: #ff0000;">'On Exit '</span> <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #ff0000;">&quot;Where&quot;</span>
  <span style="color: #66cc66;">,</span>        pv_value_param <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #ff0000;">&quot;Value Parameter&quot;</span>
  <span style="color: #66cc66;">,</span>        pv_ref_param <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #ff0000;">&quot;Reference Parameter&quot;</span>
  <span style="color: #66cc66;">,</span>        IFNULL<span style="color: #66cc66;">&#40;</span>lv_value_param<span style="color: #66cc66;">,</span><span style="color: #ff0000;">'     '</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #ff0000;">&quot;Local Variable&quot;</span>;
&nbsp;
<span style="color: #993333; font-weight: bold;">END</span>;
$$</pre></td></tr></table></div>

<p>A <code>tester</code> procedure than tests how the pass-by-value and pass-by-reference modes of operation differ. It&#8217;s here:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
</pre></td><td class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">PROCEDURE</span> tester
<span style="color: #66cc66;">&#40;</span> <span style="color: #993333; font-weight: bold;">IN</span>  pv_value_param  <span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">20</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">IN</span>  pv_ref_param    <span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">20</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #993333; font-weight: bold;">BEGIN</span>
&nbsp;
  <span style="color: #808080; font-style: italic;">/* Query the local and reference parameters. */</span> 
  <span style="color: #993333; font-weight: bold;">SELECT</span>   <span style="color: #ff0000;">'Before  '</span> <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #ff0000;">&quot;Where&quot;</span>
  <span style="color: #66cc66;">,</span>        pv_value_param <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #ff0000;">&quot;Value Parameter&quot;</span>
  <span style="color: #66cc66;">,</span>        pv_ref_param <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #ff0000;">&quot;Reference Parameter&quot;</span>;
&nbsp;
  <span style="color: #808080; font-style: italic;">/* Call the wonderland procedure that changes the pass-by-reference parameter. */</span>
  <span style="color: #993333; font-weight: bold;">CALL</span> wonderland<span style="color: #66cc66;">&#40;</span>pv_value_param<span style="color: #66cc66;">,</span> pv_ref_param<span style="color: #66cc66;">&#41;</span>;
&nbsp;
  <span style="color: #808080; font-style: italic;">/* Query the local and reference parameters. */</span> 
  <span style="color: #993333; font-weight: bold;">SELECT</span>   <span style="color: #ff0000;">'After   '</span> <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #ff0000;">&quot;Where&quot;</span>
  <span style="color: #66cc66;">,</span>        pv_value_param <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #ff0000;">&quot;Value Parameter&quot;</span>
  <span style="color: #66cc66;">,</span>        pv_ref_param <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #ff0000;">&quot;Reference Parameter&quot;</span>;
&nbsp;
<span style="color: #993333; font-weight: bold;">END</span>;
$$</pre></td></tr></table></div>

<p>You call the <code>tester</code> program with this syntax:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">CALL</span> tester<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'Alice'</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">'Alice'</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>The test case returns the following values:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">+----------+-----------------+---------------------+
| Where    | Value Parameter | Reference Parameter |
+----------+-----------------+---------------------+
| Before   | Alice           | Alice               |
+----------+-----------------+---------------------+
1 row in set (0.00 sec)
&nbsp;
+----------+-----------------+---------------------+----------------+
| Where    | Value Parameter | Reference Parameter | Local Variable |
+----------+-----------------+---------------------+----------------+
| On Entry | Alice           | Alice               |                |
+----------+-----------------+---------------------+----------------+
1 row in set (0.02 sec)
&nbsp;
+----------+-----------------+---------------------+----------------+
| Where    | Value Parameter | Reference Parameter | Local Variable |
+----------+-----------------+---------------------+----------------+
| On Exit  | Alice           | ALICE               | alice          |
+----------+-----------------+---------------------+----------------+
1 row in set (0.02 sec)
&nbsp;
+----------+-----------------+---------------------+
| Where    | Value Parameter | Reference Parameter |
+----------+-----------------+---------------------+
| After    | Alice           | ALICE               |
+----------+-----------------+---------------------+
1 row in set (0.03 sec)</pre></div></div>

<p>Basically, Alice inside the <code>pv_ref_param</code> parameter grows to uppercase during the trip through the <code>wonderland</code> procedure, while Alice inside the <code>pv_value_param</code> remains unchanged. If it didn&#8217;t help you learn a principle, maybe it gave you a laugh on how to view the travels of <code>IN</code>-only and <code>INOUT</code> parameters. <img src='http://blog.mclaughlinsoftware.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  </p>
<p><strong>NOTE:</strong> Line 12 in the <code>alice</code> procedure is impossible with an immutable variable because the value of a call parameter to an immutable <code>IN</code>-only formal parameter shouldn&#8217;t allow the call parameter value to change during the execution of the program. This means that MySQL <code>IN</code>-only mode parameter values actually hold a mutable copy of the call parameter and the call parameter can be either a variable or literal value. The parameter value is discarded at the completion of procedure. This is more easily demonstrated with this <code>assignment</code> procedure:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
</pre></td><td class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">PROCEDURE</span> assignment
<span style="color: #66cc66;">&#40;</span> <span style="color: #993333; font-weight: bold;">IN</span>  pv_value_param  <span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">20</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #993333; font-weight: bold;">BEGIN</span>
&nbsp;
  <span style="color: #808080; font-style: italic;">/* Query the local and reference parameters. */</span> 
  <span style="color: #993333; font-weight: bold;">SELECT</span>   <span style="color: #ff0000;">'Before  '</span> <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #ff0000;">&quot;Where&quot;</span>
  <span style="color: #66cc66;">,</span>        pv_value_param <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #ff0000;">&quot;Value Parameter&quot;</span>;
&nbsp;
  <span style="color: #808080; font-style: italic;">/* Call the wonderland procedure that changes the pass-by-reference parameter. */</span>
  <span style="color: #993333; font-weight: bold;">SET</span> pv_value_param :<span style="color: #66cc66;">=</span> <span style="color: #993333; font-weight: bold;">UPPER</span><span style="color: #66cc66;">&#40;</span>pv_value_param<span style="color: #66cc66;">&#41;</span>;
&nbsp;
  <span style="color: #808080; font-style: italic;">/* Query the local and reference parameters. */</span> 
  <span style="color: #993333; font-weight: bold;">SELECT</span>   <span style="color: #ff0000;">'After   '</span> <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #ff0000;">&quot;Where&quot;</span>
  <span style="color: #66cc66;">,</span>        pv_value_param <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #ff0000;">&quot;Value Parameter&quot;</span>;
&nbsp;
<span style="color: #993333; font-weight: bold;">END</span>;
$$</pre></td></tr></table></div>

<p>Therefore a call like this prints an uppercase <code>INBOUND</code> string inside the program but can return nothing to the calling scope since the call parameter is a string literal.</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SET</span> @sv_session <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'inbound'</span>;
<span style="color: #993333; font-weight: bold;">CALL</span> assignment<span style="color: #66cc66;">&#40;</span>@sv_session<span style="color: #66cc66;">&#41;</span>;
<span style="color: #993333; font-weight: bold;">SELECT</span> @sv_test <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #ff0000;">&quot;Current Value&quot;</span>;</pre></div></div>

<p>The query displays:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">+---------------+
| Current Value |
+---------------+
| inbound       |
+---------------+</pre></div></div>

<p>I hope this helps.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mclaughlinsoftware.com/2012/05/10/value-or-reference/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Display Errors with Zend</title>
		<link>http://blog.mclaughlinsoftware.com/2012/05/04/display-errors-with-zend/</link>
		<comments>http://blog.mclaughlinsoftware.com/2012/05/04/display-errors-with-zend/#comments</comments>
		<pubDate>Fri, 04 May 2012 06:15:26 +0000</pubDate>
		<dc:creator>maclochlainn</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Zend]]></category>

		<guid isPermaLink="false">http://blog.mclaughlinsoftware.com/?p=5836</guid>
		<description><![CDATA[Someone asked how to display errors in the HTML output when they test PHP scripts with the Zend Server CE. Here are the two screen shots that help you enable the display of error and warning messages in your HTML display. Click the Server Setup tab and then click the Error Handling and Logging choice. [...]]]></description>
			<content:encoded><![CDATA[<p>Someone asked how to display errors in the HTML output when they test PHP scripts with the Zend Server CE. Here are the two screen shots that help you enable the display of error and warning messages in your HTML display.</p>
<ol start="1">
<li>Click the <em>Server Setup</em> tab and then click the <em>Error Handling and Logging</em> choice.</li>
</ol>
<p><a href="http://blog.mclaughlinsoftware.com/wp-content/uploads/2012/05/ZendErrorHandling01.png"><img src="http://blog.mclaughlinsoftware.com/wp-content/uploads/2012/05/ZendErrorHandling01-300x184.png" alt="" title="ZendErrorHandling01" width="300" height="184" class="aligncenter size-medium wp-image-5837" /></a></p>
<ol start="2">
<li>Click the <em>On</em> radio button for <em>Display errors</em> and then restart PHP at the bottom right corner.</li>
</ol>
<p><a href="http://blog.mclaughlinsoftware.com/wp-content/uploads/2012/05/ZendErrorHandling02.png"><img src="http://blog.mclaughlinsoftware.com/wp-content/uploads/2012/05/ZendErrorHandling02-300x184.png" alt="" title="ZendErrorHandling02" width="300" height="184" class="aligncenter size-medium wp-image-5839" /></a></p>
<p>Hope this helps people looking for the navigation.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mclaughlinsoftware.com/2012/05/04/display-errors-with-zend/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Zend CE has a Worm?</title>
		<link>http://blog.mclaughlinsoftware.com/2012/04/29/zend-ce-has-a-worm/</link>
		<comments>http://blog.mclaughlinsoftware.com/2012/04/29/zend-ce-has-a-worm/#comments</comments>
		<pubDate>Sun, 29 Apr 2012 08:40:38 +0000</pubDate>
		<dc:creator>maclochlainn</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[WAMP]]></category>
		<category><![CDATA[Windows7]]></category>
		<category><![CDATA[Zend]]></category>

		<guid isPermaLink="false">http://blog.mclaughlinsoftware.com/?p=5802</guid>
		<description><![CDATA[After updating the AVGFree virus definitions, I was surprised to find that Zend CE (Community Edition) 4.0.6 had a reported worm in the JavaServer.exe file. There was greater surprise when Zend CE 5.3.9 (5.6.0-SP1) also had the same reported worm. This is the message identifying the worm (click on it to see a full size [...]]]></description>
			<content:encoded><![CDATA[<p>After updating the AVGFree virus definitions, I was surprised to find that Zend CE (Community Edition) 4.0.6 had a reported worm in the <code>JavaServer.exe</code> file. There was greater surprise when Zend CE 5.3.9 (5.6.0-SP1) also had the same reported worm.</p>
<p>This is the message identifying the worm (click on it to see a full size image), and you can read about this particular worm on the <a href="http://home.mcafee.com/virusinfo/virusprofile.aspx?key=1027775">Mcafee site</a> or the <a href="http://www.avgthreatlabs.com/webthreats/info/win---dh">AVG threat labs site</a>:</p>
<p><a href="http://blog.mclaughlinsoftware.com/wp-content/uploads/2012/04/ZendServerWorm.png"><img src="http://blog.mclaughlinsoftware.com/wp-content/uploads/2012/04/ZendServerWorm-300x147.png" alt="" title="ZendServerWorm" width="300" height="147" class="aligncenter size-medium wp-image-5803" /></a></p>
<p>If you check AVGFree&#8217;s page, the actual infection isn&#8217;t a stated variant, but it appears the heuristics are a bit aggressive.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">File Name: C:\Program Files (x86)\Zend\ZendServer\bin\JavaServer.exe
Infection: Win32/DH.FF860061{00000000-00080000-00000000}</pre></div></div>

<p>Unless you have the full version of AVGFree or another security program to try and fix the file, you can only quarantine the file. Quarantine or removal disables Zend CE from working. It begs the question: &#8220;How does Zend release a core file with a worm?&#8221; or <strong><em>&#8220;Is AVGFree reporting a false positive?&#8221;</em></strong></p>
<p><strong>Update: <span style="color:blue"><em>AVGFree was providing a false positive.</em></span></strong> In addition to the checks by Zeev at Zend, I created a new test instance with Norton 360 and it likewise found no virus/worm in Zend&#8217;s <code>JavaServer.exe</code> file. Hopefully the post will prevent others from spending more than a Google search to sort it out.</p>
<p>Since I use AVGFree on all my Windows 7 VM test instances, it seemed logical to illustrate how to work around this current false positive and annoying quarantining of the core <code>JavaServer.exe</code> file from the Zend Server. There are two sets of tasks, the first requires removing the file from quarantine and the second eliminates future scans from quarantining the file again.</p>
<p style="font-size:115%"><strong>Remove the file from the Virus Vault</strong></p>
<ol start="1">
<li>Launch AVGFree and navigate to the <em>History</em> menu option and choose the <em>Virus Vault</em> option, as shown below.</li>
</ol>
<p style="clear:both">
<p><a href="http://blog.mclaughlinsoftware.com/wp-content/uploads/2012/04/AVGFreeHistory01.png"><img src="http://blog.mclaughlinsoftware.com/wp-content/uploads/2012/04/AVGFreeHistory01.png" alt="" title="AVGFreeHistory01" width="350" height="175" class="aligncenter size-full wp-image-5824" /></a></p>
<ol start="2">
<li>Click the <em>Virus Vault</em> option in the list of the <em>History</em>, which displays the following screen. Click the <em>Infection</em> row and then click the <em>Restore</em> button to remove the file from the virus vault.</li>
</ol>
<p style="clear:both">
<p><a href="http://blog.mclaughlinsoftware.com/wp-content/uploads/2012/04/AVGFreeHistory02.png"><img src="http://blog.mclaughlinsoftware.com/wp-content/uploads/2012/04/AVGFreeHistory02-300x218.png" alt="" title="AVGFreeHistory02" width="300" height="218" class="aligncenter size-medium wp-image-5830" /></a></p>
<ol start="3">
<li>A confirmation dialog opens and you click the <em>Yes</em> button to proceed.</li>
</ol>
<p style="clear:both">
<p><a href="http://blog.mclaughlinsoftware.com/wp-content/uploads/2012/04/AVGFreeHistory03.png"><img src="http://blog.mclaughlinsoftware.com/wp-content/uploads/2012/04/AVGFreeHistory03-300x101.png" alt="" title="AVGFreeHistory03" width="300" height="101" class="aligncenter size-medium wp-image-5828" /></a></p>
<ol start="4">
<li>The <em>Infection</em> row is gone When you&#8217;re returned to the <em>History</em> dialog. Click the <em>Close</em> button to complete this task.</li>
</ol>
<p style="clear:both">
<p><a href="http://blog.mclaughlinsoftware.com/wp-content/uploads/2012/04/AVGFreeHistory04.png"><img src="http://blog.mclaughlinsoftware.com/wp-content/uploads/2012/04/AVGFreeHistory04-300x218.png" alt="" title="AVGFreeHistory04" width="300" height="218" class="aligncenter size-medium wp-image-5829" /></a></p>
<p style="font-size:115%"><strong>Exclude the file from future scans</strong></p>
<ol start="1">
<li>Select the <em>Tools</em> menu option and choose the <em>Advanced settings &#8230;</em> option, as shown below.</li>
</ol>
<p style="clear:both">
<p><a href="http://blog.mclaughlinsoftware.com/wp-content/uploads/2012/04/AVGFreeTools01.png"><img src="http://blog.mclaughlinsoftware.com/wp-content/uploads/2012/04/AVGFreeTools01.png" alt="" title="AVGFreeTools01" width="400" height="205" class="aligncenter size-full wp-image-5825" /></a></p>
<ol start="2">
<li>Click the <em>Excluded files</em> option in the list of the <em>History</em>, which displays the following screen. Click the <em>Add</em> button to select the file for exclusion. Click the <em>Apply</em> button to effect the change and the <em>OK</em> button to complete the change.</li>
</ol>
<p style="clear:both">
<p><a href="http://blog.mclaughlinsoftware.com/wp-content/uploads/2012/04/AVGFreeTools02.png"><img src="http://blog.mclaughlinsoftware.com/wp-content/uploads/2012/04/AVGFreeTools02-300x218.png" alt="" title="AVGFreeTools02" width="300" height="218" class="aligncenter size-medium wp-image-5827" /></a></p>
<p>All I can say, one the AVGFree false positive was annoying and it&#8217;s dark at 3 a.m. and light the next day. <img src='http://blog.mclaughlinsoftware.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Thanks to those who knew or surmised it was AVGFree&#8217;s heuristics and took the time to add a comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mclaughlinsoftware.com/2012/04/29/zend-ce-has-a-worm/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Collaborate 2012 &#8211; Day 4</title>
		<link>http://blog.mclaughlinsoftware.com/2012/04/26/collaborate-2012-day-4/</link>
		<comments>http://blog.mclaughlinsoftware.com/2012/04/26/collaborate-2012-day-4/#comments</comments>
		<pubDate>Thu, 26 Apr 2012 19:19:31 +0000</pubDate>
		<dc:creator>maclochlainn</dc:creator>
				<category><![CDATA[Collaborate Conference]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://blog.mclaughlinsoftware.com/?p=5795</guid>
		<description><![CDATA[Last day of Collaborate 2012 and Scott Spendolini, Sumneva, gave a great presentation on APEX. Only caught the beginning Jan Visser&#8217;s Perl presentation because of the distance to the Luxor from the Mandalay South Conference Center and anticipated queuing time for checkout. We can now look forward to Collaborate 2013 in Denver, Colorado. Back to [...]]]></description>
			<content:encoded><![CDATA[<p>Last day of Collaborate 2012 and Scott Spendolini, Sumneva, gave a great presentation on APEX. Only caught the beginning Jan Visser&#8217;s Perl presentation because of the distance to the Luxor from the Mandalay South Conference Center and anticipated queuing time for checkout.</p>
<p>We can now look forward to Collaborate 2013 in Denver, Colorado.</p>
<p>Back to observing and working with code, here&#8217;s a nice article from MacWorld on how you <a href="http://www.macworld.com/article/1166529/replace_idisk_with_your_own_net_disk.html#lsrc.twt_macworld">set up a WebDAV on the Mac</a>. While I&#8217;m mentioning Mac OS X and development, there&#8217;s still no firm upgrade window for the <em>missing</em> text editing tool &#8211; <a href="http://macromates.com/">TextMate</a>, and <a href="http://www.macworld.com/article/1166547/wwdc_2012_tickets_sell_out_in_two_hours.html#lsrc.twt_macworld">WWDC 2012</a> tickets sold out in two hours.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mclaughlinsoftware.com/2012/04/26/collaborate-2012-day-4/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Collaborate 2012 &#8211; Day 3</title>
		<link>http://blog.mclaughlinsoftware.com/2012/04/26/collaborate-2012-day-3/</link>
		<comments>http://blog.mclaughlinsoftware.com/2012/04/26/collaborate-2012-day-3/#comments</comments>
		<pubDate>Thu, 26 Apr 2012 06:31:01 +0000</pubDate>
		<dc:creator>maclochlainn</dc:creator>
				<category><![CDATA[Collaborate Conference]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.mclaughlinsoftware.com/?p=5775</guid>
		<description><![CDATA[Virtualization is important and Dave Welch from the House of Brick gave a great presentation of experiences with VMWare and Tier 1 databases. It was a comprehensive presentation, but the white paper was easier to follow. The slides were complete but the volume of information was a lot for an hour presentation. Well worth the [...]]]></description>
			<content:encoded><![CDATA[<p>Virtualization is important and Dave Welch from the <a href="http://www.houseofbrick.com/">House of Brick</a> gave a great presentation of experiences with VMWare and Tier 1 databases. It was a comprehensive presentation, but the white paper was easier to follow. The slides were complete but the volume of information was a lot for an hour presentation. Well worth the time though.</p>
<p><a href="http://www.utoug.org">Utah Oracle User Group (UTOUG)</a> announced a call for Fall Symposium papers today. The Fall Symposium will be in Salt Lake City on 9/6/2012. If you&#8217;re interested in presenting on Oracle or MySQL, the call for presentations will be open until 6/15/2012.</p>
<p><a href='http://blog.mclaughlinsoftware.com/wp-content/uploads/2012/04/Collaborate2012Band.mov'><img src="http://blog.mclaughlinsoftware.com/wp-content/uploads/2012/04/Collaborate2012Band-300x167.png" alt="" title="Collaborate2012Band" width="300" height="167" class="alignright size-medium wp-image-5779" /></a>The conference party was tonight, and it provided some nice orderves and pizza. The theme was a return to 1980s music, and some folks really dressed their parts. You can listen to a short snapshot of the band by clicking the image to launch a small video segment.</p>
<p>I&#8217;m looking forward to the APEX Behind the Scenes presentation at 8:30 a.m. tomorrow. When the conference is over, I won&#8217;t miss the smoke filled air that we walk through from the Luxor to the Mandalay. It&#8217;s really amazing that the complex is more than a mile in length. It runs from the Luxor to the Mandalay South Conference Center.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mclaughlinsoftware.com/2012/04/26/collaborate-2012-day-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://blog.mclaughlinsoftware.com/wp-content/uploads/2012/04/Collaborate2012Band.mov" length="1471203" type="video/quicktime" />
		</item>
		<item>
		<title>Collaborate 2012 &#8211; Day 2</title>
		<link>http://blog.mclaughlinsoftware.com/2012/04/25/collaboration-201-day-2/</link>
		<comments>http://blog.mclaughlinsoftware.com/2012/04/25/collaboration-201-day-2/#comments</comments>
		<pubDate>Wed, 25 Apr 2012 07:52:02 +0000</pubDate>
		<dc:creator>maclochlainn</dc:creator>
				<category><![CDATA[Collaborate Conference]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://blog.mclaughlinsoftware.com/?p=5762</guid>
		<description><![CDATA[It seems the Titanic is everywhere, even inside the pyramid of the Luxor hotel. While the Luxor is within the Mandalay Bay complex, it&#8217;s about a half mile walk to the conference and a half mile back. We go by the Mandalay Conference Center&#8217;s aquarium. We thought it might be interesting but at $18 an [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.mclaughlinsoftware.com/wp-content/uploads/2012/04/titanic.jpg"><img style="margin-right:15px" src="http://blog.mclaughlinsoftware.com/wp-content/uploads/2012/04/titanic-225x300.jpg" alt="" title="titanic" width="225" height="300" class="alignleft size-medium wp-image-5763" /></a>It seems the Titanic is everywhere, even inside the pyramid of the Luxor hotel. While the Luxor is within the Mandalay Bay complex, it&#8217;s about a half mile walk to the conference and a half mile back. We go by the Mandalay Conference Center&#8217;s aquarium. We thought it might be interesting but at $18 an admission, we opted to pass on it. It&#8217;s amazing to have an aquarium in the desert, but it&#8217;s probably not as nice as the Monterey Bay aquarium.</p>
<p>It was interesting to start the day listening to Rich Niemiec on partitioning tables and using Exadata in Oracle. The NoSQL (Not Only SQL) presentations were interesting, as was the upgrading of Oracle 11gR2 in an E-Business Suite environment presentation. Then, I finished the day with what&#8217;s new with the Oracle VM Server.</p>
<p>Checking out the exhibit hall I managed to get a signed copy of Rich Niemiec&#8217;s <a href="http://www.amazon.com/Oracle-Database-Release-Performance-Techniques/dp/0071780262/ref=sr_1_fkmr0_1?ie=UTF8&#038;qid=1335338633&#038;sr=8-1-fkmr0">Oracle Database 11g Release 2 Performance Tuning Tips &#038; Techniques</a> and a copy of <a href="http://www.amazon.com/MongoDB-Definitive-Guide-Kristina-Chodorow/dp/1449381561/ref=sr_1_1?s=books&#038;ie=UTF8&#038;qid=1335338984&#038;sr=1-1">MongoDB The Definitive Guide</a>.  </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mclaughlinsoftware.com/2012/04/25/collaboration-201-day-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Collaborate 2012 &#8211; Day 1</title>
		<link>http://blog.mclaughlinsoftware.com/2012/04/24/collaborate-2012-day-1/</link>
		<comments>http://blog.mclaughlinsoftware.com/2012/04/24/collaborate-2012-day-1/#comments</comments>
		<pubDate>Tue, 24 Apr 2012 07:47:22 +0000</pubDate>
		<dc:creator>maclochlainn</dc:creator>
				<category><![CDATA[Collaborate Conference]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://blog.mclaughlinsoftware.com/?p=5745</guid>
		<description><![CDATA[Collaborate 2012 started on Sunday but for me I began on Monday. I enjoyed Bob Burgess, SalesForce, presentation on shell scripting for MySQL Administration today. It preceded my presentation in the same room, which I thought was an interesting coincidence since we got our conference credentials together. I presented on portable SQL between Oracle and [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.mclaughlinsoftware.com/wp-content/uploads/2012/04/photo.jpg"><img style="margin-right:15px" src="http://blog.mclaughlinsoftware.com/wp-content/uploads/2012/04/photo-224x300.jpg" alt="" title="photo" width="224" height="300" class="alignleft size-medium wp-image-5746" /></a>Collaborate 2012 started on Sunday but for me I began on Monday. I enjoyed Bob Burgess, SalesForce, presentation on shell scripting for MySQL Administration today. It preceded my presentation in the same room, which I thought was an interesting coincidence since we got our conference credentials together.</p>
<p>I presented on portable SQL between Oracle and MySQL. The presentation went well. Before I took questions, I got to ask them because I had three copies of my new Oracle Press book to give away: <a href="http://www.amazon.com/Oracle-Database-MySQL-Developer-Handbook/dp/0071768858/ref=as_li_wdgt_js_ex?&#038;linkCode=wey&#038;tag=macloc-20">Oracle Database 11g and MySQL 5.6 Developer Handbook</a>. Handing out the books served as a nice ice breaker for the audience to ask questions about the presentation.</p>
<p>My favorite question was, &#8220;Will Oracle continue to improve MySQL?&#8221; My answer to that is always simple because Oracle&#8217;s support for MySQL has and continues to be great, &#8220;Oracle only spends money on winners and that means MySQL wins.&#8221; Oracle product management was in attendance and they re-enforced Oracle&#8217;s commitment to MySQL. </p>
<p>At 6 p.m., the Exhibit Hall opened and I checked it out. Cisco hired <a href="www.artisansentertainment.com">Kathy Bailey</a> to draw caricatures, and she drew mine as you can see at the left. I&#8217;m looking forward to more presentations tomorrow.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mclaughlinsoftware.com/2012/04/24/collaborate-2012-day-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle Within Group</title>
		<link>http://blog.mclaughlinsoftware.com/2012/04/07/oracle-11gr2-within-group/</link>
		<comments>http://blog.mclaughlinsoftware.com/2012/04/07/oracle-11gr2-within-group/#comments</comments>
		<pubDate>Sat, 07 Apr 2012 21:49:46 +0000</pubDate>
		<dc:creator>maclochlainn</dc:creator>
				<category><![CDATA[Analytical function]]></category>
		<category><![CDATA[Oracle 11g]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://blog.mclaughlinsoftware.com/?p=5732</guid>
		<description><![CDATA[Somebody asked me for a useful example of Oracle 11gR2&#8242;s new analytical LISTAGG function that uses a WITHIN GROUP syntax. They&#8217;d noticed an update to the askTom that showed how to use it. This post shows how to list values without a displayed aggregation column and how to use a JOIN and GROUP BY clause [...]]]></description>
			<content:encoded><![CDATA[<p>Somebody asked me for a useful example of Oracle 11gR2&#8242;s new analytical <span style="font-style:courier">LISTAGG</a> function that uses a WITHIN GROUP syntax. They&#8217;d noticed an update to the <a href="http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:2196162600402"><em>ask</em>Tom</a> that showed how to use it. This post shows how to list values without a displayed aggregation column and how to use a <span style="font-style:courier">JOIN</span> and <span style="font-style:courier">GROUP BY</span> clause with the new analytical feature.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre></td><td class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">COLUMN</span> list      FORMAT A10
<span style="color: #993333; font-weight: bold;">COLUMN</span> last_name FORMAT A10
<span style="color: #993333; font-weight: bold;">COLUMN</span> names     FORMAT A42
<span style="color: #993333; font-weight: bold;">COLUMN</span> members   FORMAT <span style="color: #cc66cc;">9</span><span style="color: #66cc66;">,</span><span style="color: #cc66cc;">990</span>
&nbsp;
&nbsp;
<span style="color: #993333; font-weight: bold;">SELECT</span>   m<span style="color: #66cc66;">.</span>account_number <span style="color: #993333; font-weight: bold;">AS</span> account
<span style="color: #66cc66;">,</span>        c<span style="color: #66cc66;">.</span>last_name <span style="color: #993333; font-weight: bold;">AS</span> last_name
<span style="color: #66cc66;">,</span>        LISTAGG<span style="color: #66cc66;">&#40;</span>c<span style="color: #66cc66;">.</span>first_name<span style="color: #66cc66;">||</span>DECODE<span style="color: #66cc66;">&#40;</span>c<span style="color: #66cc66;">.</span>middle_name<span style="color: #66cc66;">,</span><span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span><span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">' '</span><span style="color: #66cc66;">||</span>SUBSTR<span style="color: #66cc66;">&#40;</span>c<span style="color: #66cc66;">.</span>middle_name<span style="color: #66cc66;">,</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">||</span><span style="color: #ff0000;">'.'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">', '</span><span style="color: #66cc66;">&#41;</span>
           <span style="color: #993333; font-weight: bold;">WITHIN</span> <span style="color: #993333; font-weight: bold;">GROUP</span> <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">ORDER</span> <span style="color: #993333; font-weight: bold;">BY</span> <span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> names
<span style="color: #66cc66;">,</span>        <span style="color: #993333; font-weight: bold;">COUNT</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">*</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> members
<span style="color: #993333; font-weight: bold;">FROM</span>     contact c <span style="color: #993333; font-weight: bold;">INNER</span> <span style="color: #993333; font-weight: bold;">JOIN</span> member m <span style="color: #993333; font-weight: bold;">USING</span> <span style="color: #66cc66;">&#40;</span>member_id<span style="color: #66cc66;">&#41;</span>
<span style="color: #993333; font-weight: bold;">GROUP</span> <span style="color: #993333; font-weight: bold;">BY</span> m<span style="color: #66cc66;">.</span>account_number
<span style="color: #66cc66;">,</span>        c<span style="color: #66cc66;">.</span>last_name
<span style="color: #993333; font-weight: bold;">ORDER</span> <span style="color: #993333; font-weight: bold;">BY</span> c<span style="color: #66cc66;">.</span>last_name;</pre></td></tr></table></div>

<p>It produces the following output:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">ACCOUNT    LAST_NAME  NAMES                                      MEMBERS
---------- ---------- ------------------------------------------ -------
SLC-000021 Jonah      Gretelz S.                                       1
SLC-000020 Moss       Jane W.                                          1
SLC-000023 Nathan     Smith B.                                         1
SLC-000024 Potter     Albus S., Ginny, Harry, James S., Lily L.        5
SLC-000022 Royal      Jennifer E.                                      1
SJC-000003 Sweeney    Ian M., Matthew, Meaghan                         3
SJC-000002 Vizquel    Doreen, Oscar                                    2
SLC-000018 Ward       Clinton G.                                       1
SLC-000019 Ward       Brandt H.                                        1
SJC-000001 Winn       Brian, Randi                                     2
&nbsp;
10 rows selected.</pre></div></div>

<p>I also found some existing examples you might like, at <a href="http://www.oracle-base.com/articles/misc/StringAggregationTechniques.php">Oracle-Base</a>, and there they&#8217;re showing you how to make it work in prior releases of the database without the new <span style="font-style:courier">LISTAGG</span> function.</p>
<p>Let&#8217;s say you just wanted a concatenated list of users, you could use the following in-line view approach:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span>   list<span style="color: #66cc66;">.</span>names
<span style="color: #993333; font-weight: bold;">FROM</span>    <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">SELECT</span>   <span style="color: #ff0000;">'List'</span> <span style="color: #993333; font-weight: bold;">AS</span> list
         <span style="color: #66cc66;">,</span>        LISTAGG<span style="color: #66cc66;">&#40;</span>last_name <span style="color: #66cc66;">||</span><span style="color: #ff0000;">', '</span><span style="color: #66cc66;">||</span>first_name<span style="color: #66cc66;">||</span>DECODE<span style="color: #66cc66;">&#40;</span>middle_name<span style="color: #66cc66;">,</span><span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span><span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">' '</span><span style="color: #66cc66;">||</span>SUBSTR<span style="color: #66cc66;">&#40;</span>middle_name<span style="color: #66cc66;">,</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">||</span><span style="color: #ff0000;">'.'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">'; '</span><span style="color: #66cc66;">&#41;</span>
                  <span style="color: #993333; font-weight: bold;">WITHIN</span> <span style="color: #993333; font-weight: bold;">GROUP</span> <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">ORDER</span> <span style="color: #993333; font-weight: bold;">BY</span> <span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> names
         <span style="color: #993333; font-weight: bold;">FROM</span>     contact<span style="color: #66cc66;">&#41;</span> list;</pre></td></tr></table></div>

<p>As always, I hope this helps somebody.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mclaughlinsoftware.com/2012/04/07/oracle-11gr2-within-group/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL REGEXP Error</title>
		<link>http://blog.mclaughlinsoftware.com/2012/03/23/mysql-regexp-error/</link>
		<comments>http://blog.mclaughlinsoftware.com/2012/03/23/mysql-regexp-error/#comments</comments>
		<pubDate>Fri, 23 Mar 2012 17:01:17 +0000</pubDate>
		<dc:creator>maclochlainn</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Regular Expression]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://blog.mclaughlinsoftware.com/?p=5704</guid>
		<description><![CDATA[While working through prepared statements in MySQL, there was an interesting MySQL regular expression question raised. A student wanted to know how to address the following error message: ERROR 1139 &#40;42000&#41;: Got error 'repetition-operator operand invalid' FROM REGEXP They had substituted * for a .+ in a metasequence. A metasequence is a parenthetical expression that [...]]]></description>
			<content:encoded><![CDATA[<p>While working through prepared statements in MySQL, there was an interesting <a href="http://dev.mysql.com/doc/refman/5.5/en/regexp.html">MySQL regular expression</a> question raised. A student wanted to know how to address the following error message:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;">ERROR <span style="color: #cc66cc;">1139</span> <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">42000</span><span style="color: #66cc66;">&#41;</span>: Got error <span style="color: #ff0000;">'repetition-operator operand invalid'</span> <span style="color: #993333; font-weight: bold;">FROM</span> <span style="color: #993333; font-weight: bold;">REGEXP</span></pre></div></div>

<p>They had substituted <code>*</code> for a <code>.+</code> in a metasequence. A metasequence is a parenthetical expression that evaluates based on multiple alternative conditions, and the pipe (<code>|</code>) acts as an <code>OR</code> operator. The full code example is found on page 482 of the <a href="http://www.amazon.com/gp/product/0071768858/ref=as_li_tf_tl?ie=UTF8&#038;tag=macloc-20&#038;linkCode=as2&#038;camp=1789&#038;creative=9325&#038;creativeASIN=0071768858">Oracle Database 11g &#038; MySQL 5.6 Developer Handbook</a>. The student&#8217;s change would have worked without an error had he replaced the metasequence with <code>.*</code> instead of the solitary <code>*</code>.</p>
<p>The original call to the procedure passes the following <em>well formed</em> regular expression:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">CALL</span> prepared_dml<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'(^|^.+)war(.+$|$)'</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>Or, they could eliminate the metasequences and use:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">CALL</span> prepared_dml<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'^.*war.*$'</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>Either returns the following entries from a column with movie titles from the sample code:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Charlie's War
Star Wars I
Star Wars II
Star Wars III</pre></div></div>

<p>The dot (<code>.</code>) means any possible character, and the plus (<code>+</code>) means <em>one-to-many</em> possible repeating characters of a preceding character. When the dot precedes the plus, it means one-to-many wildcard characters. The student replaced the metasequence with <em>an asterisk by itself</em> and generated the <em>badly formed</em> regular expression error.</p>
<p>The misunderstanding occurs because the asterisk (<code>*</code>) by itself doesn&#8217;t mean <em>zero-to-many</em> wildcard. The combination of the dot and asterisk creates a <em>zero-to-many</em> wildcard, which works when there is or isn&#8217;t a character before the first character of a string or after the last character of a string. It also eliminates the need for a metasequence.</p>
<p>Here&#8217;s a small test case outside of the book&#8217;s stored procedure:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">-- Conditionally drop the table.</span>
<span style="color: #993333; font-weight: bold;">DROP</span> <span style="color: #993333; font-weight: bold;">TABLE</span> <span style="color: #993333; font-weight: bold;">IF</span> <span style="color: #993333; font-weight: bold;">EXISTS</span> list;
&nbsp;
<span style="color: #808080; font-style: italic;">-- Create the table.</span>
<span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">TABLE</span> list <span style="color: #66cc66;">&#40;</span> list_id <span style="color: #993333; font-weight: bold;">INT</span> <span style="color: #993333; font-weight: bold;">UNSIGNED</span> <span style="color: #993333; font-weight: bold;">PRIMARY</span> <span style="color: #993333; font-weight: bold;">KEY</span> <span style="color: #993333; font-weight: bold;">AUTO_INCREMENT</span><span style="color: #66cc66;">,</span> list_item <span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">20</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">-- Insert for rows.</span>
<span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> list <span style="color: #66cc66;">&#40;</span>list_item<span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">VALUES</span> <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'Star'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">' Star'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">' Star '</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'Star '</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">-- Query for zero-to-many leading characters.</span>
<span style="color: #993333; font-weight: bold;">SELECT</span>   list_id <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #ff0000;">&quot;ID&quot;</span>
<span style="color: #66cc66;">,</span>        list_item <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #ff0000;">&quot;Zero-to-many leading characters &quot;</span>
<span style="color: #66cc66;">,</span>        <span style="color: #993333; font-weight: bold;">LENGTH</span><span style="color: #66cc66;">&#40;</span>list_item<span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #ff0000;">&quot;Length&quot;</span>
<span style="color: #66cc66;">,</span>        <span style="color: #ff0000;">'^.*Star.*$'</span> <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #ff0000;">&quot;Regular Expression&quot;</span>
<span style="color: #993333; font-weight: bold;">FROM</span>     list
<span style="color: #993333; font-weight: bold;">WHERE</span>    list_item <span style="color: #993333; font-weight: bold;">REGEXP</span> <span style="color: #ff0000;">'^.*Star.*$'</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">-- Query for zero-to-many leading characters.</span>
<span style="color: #993333; font-weight: bold;">SELECT</span>   list_id <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #ff0000;">&quot;ID&quot;</span>
<span style="color: #66cc66;">,</span>        list_item <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #ff0000;">&quot;One-to-many leading characters  &quot;</span>
<span style="color: #66cc66;">,</span>        <span style="color: #993333; font-weight: bold;">LENGTH</span><span style="color: #66cc66;">&#40;</span>list_item<span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #ff0000;">&quot;Length&quot;</span>
<span style="color: #66cc66;">,</span>        <span style="color: #ff0000;">'^.+Star.*$'</span> <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #ff0000;">&quot;Regular Expression&quot;</span>
<span style="color: #993333; font-weight: bold;">FROM</span>     list
<span style="color: #993333; font-weight: bold;">WHERE</span>    list_item <span style="color: #993333; font-weight: bold;">REGEXP</span> <span style="color: #ff0000;">'^.+Star.*$'</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">-- Query for one-to-many leading characters.</span>
<span style="color: #993333; font-weight: bold;">SELECT</span>   list_id <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #ff0000;">&quot;ID&quot;</span>
<span style="color: #66cc66;">,</span>        list_item <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #ff0000;">&quot;Zero-to-many trailing characters&quot;</span>
<span style="color: #66cc66;">,</span>        <span style="color: #993333; font-weight: bold;">LENGTH</span><span style="color: #66cc66;">&#40;</span>list_item<span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #ff0000;">&quot;Length&quot;</span>
<span style="color: #66cc66;">,</span>        <span style="color: #ff0000;">'^.*Star.*$'</span> <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #ff0000;">&quot;Regular Expression&quot;</span>
<span style="color: #993333; font-weight: bold;">FROM</span>     list
<span style="color: #993333; font-weight: bold;">WHERE</span>    list_item <span style="color: #993333; font-weight: bold;">REGEXP</span> <span style="color: #ff0000;">'^.*Star.*$'</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">-- Query for one-to-many leading characters.</span>
<span style="color: #993333; font-weight: bold;">SELECT</span>   list_id <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #ff0000;">&quot;ID&quot;</span>
<span style="color: #66cc66;">,</span>        list_item <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #ff0000;">&quot;One-to-many trailing characters &quot;</span>
<span style="color: #66cc66;">,</span>        <span style="color: #993333; font-weight: bold;">LENGTH</span><span style="color: #66cc66;">&#40;</span>list_item<span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #ff0000;">&quot;Length&quot;</span>
<span style="color: #66cc66;">,</span>        <span style="color: #ff0000;">'^.*Star.+$'</span> <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #ff0000;">&quot;Regular Expression&quot;</span>
<span style="color: #993333; font-weight: bold;">FROM</span>     list
<span style="color: #993333; font-weight: bold;">WHERE</span>    list_item <span style="color: #993333; font-weight: bold;">REGEXP</span> <span style="color: #ff0000;">'^.*Star.+$'</span>;</pre></div></div>

<p>The output from the scripts is:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">+----+----------------------------------+--------+--------------------+
| ID | Zero-to-many leading characters  | Length | Regular Expression |
+----+----------------------------------+--------+--------------------+
|  1 | Star                             |      4 | ^.*Star.*$         |
|  2 |  Star                            |      5 | ^.*Star.*$         |
|  3 |  Star                            |      6 | ^.*Star.*$         |
|  4 | Star                             |      5 | ^.*Star.*$         |
+----+----------------------------------+--------+--------------------+
4 rows in set (0.02 sec)
&nbsp;
+----+----------------------------------+--------+--------------------+
| ID | One-to-many leading characters   | Length | Regular Expression |
+----+----------------------------------+--------+--------------------+
|  2 |  Star                            |      5 | ^.+Star.*$         |
|  3 |  Star                            |      6 | ^.+Star.*$         |
+----+----------------------------------+--------+--------------------+
2 rows in set (0.00 sec)
&nbsp;
+----+----------------------------------+--------+--------------------+
| ID | Zero-to-many trailing characters | Length | Regular Expression |
+----+----------------------------------+--------+--------------------+
|  1 | Star                             |      4 | ^.*Star.*$         |
|  2 |  Star                            |      5 | ^.*Star.*$         |
|  3 |  Star                            |      6 | ^.*Star.*$         |
|  4 | Star                             |      5 | ^.*Star.*$         |
+----+----------------------------------+--------+--------------------+
4 rows in set (0.02 sec)
&nbsp;
+----+----------------------------------+--------+--------------------+
| ID | One-to-many trailing characters  | Length | Regular Expression |
+----+----------------------------------+--------+--------------------+
|  3 |  Star                            |      6 | ^.*Star.+$         |
|  4 | Star                             |      5 | ^.*Star.+$         |
+----+----------------------------------+--------+--------------------+
2 rows in set (0.02 sec)</pre></div></div>

<p>Hope this helps.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mclaughlinsoftware.com/2012/03/23/mysql-regexp-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

