<?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, 02 May 2013 17:46:24 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>ActivePerl on Windows</title>
		<link>http://blog.mclaughlinsoftware.com/2013/04/26/activeperl-on-windows/</link>
		<comments>http://blog.mclaughlinsoftware.com/2013/04/26/activeperl-on-windows/#comments</comments>
		<pubDate>Fri, 26 Apr 2013 16:48:25 +0000</pubDate>
		<dc:creator>maclochlainn</dc:creator>
				<category><![CDATA[Perl]]></category>
		<category><![CDATA[Windows OS]]></category>
		<category><![CDATA[Windows7]]></category>

		<guid isPermaLink="false">http://blog.mclaughlinsoftware.com/?p=7664</guid>
		<description><![CDATA[I actively maintain virtual test instances for my writing and teaching on Windows 7, Red Hat Enterprise Linux, Fedora, and Solaris. Perl on Windows is always interesting. I use ActivePerl on Windows 7 rather than Strawberry Perl, and it was interesting to see this note after I upgraded to the most current Community Edition of [...]]]></description>
				<content:encoded><![CDATA[<p>I actively maintain virtual test instances for my writing and teaching on Windows 7, Red Hat Enterprise Linux, Fedora, and Solaris. Perl on Windows is always interesting. I use ActivePerl on Windows 7 rather than Strawberry Perl, and it was interesting to see this note after I upgraded to the most current Community Edition of ActivePerl (5.16.3).</p>
<p>I thought it might be kind to post ActiveState&#8217;s Release Note because you should really read it before you try to install ActivePerl on Windows 7/8. Just make sure you&#8217;ve removed any earlier version of ActivePerl before trying the install. That&#8217;s what I did, and surprise, there weren&#8217;t any problems.</p>
<p>While the installation doesn&#8217;t tell you that you need to restart the Windows 7 operating system, you do. If you don&#8217;t restart Windows 7 after the ActivePerl install, you&#8217;ll get the following error message:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="dos" style="font-family:monospace;">install_driver<span style="color: #33cc33;">(</span>mysql<span style="color: #33cc33;">)</span> failed: Can't locate DBD/mysql.pm <span style="color: #00b100; font-weight: bold;">in</span> <span style="color: #33cc33;">@</span>INC</pre></td></tr></table></div>

<p>You can grab the DBD::MySQL bundle with this command:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="dos" style="font-family:monospace;">perl -MCPAN -e install Bundle::DBD::mysql</pre></td></tr></table></div>

<p>It downloads the MinGW (Minimalist GNU for Windows) C/C++ compiler, but it&#8217;ll be nested and not conflict with one if you have installed it independently. Absence of the compiler means you can&#8217;t attempt to build the library.</p>
<p>Proceeding further, I discovered a number of incompatibilities. The basic commands require you to load CPAN (Comprehensive Perl Archive Network) shell:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="dos" style="font-family:monospace;">perl -MCPAN -e shell</pre></td></tr></table></div>

<p>Inside the Perl <code>CPAN</code> shell:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="dos" style="font-family:monospace;">cpan<span style="color: #33cc33;">&gt;</span> force install DBD:mysql --mysql_config C:\ProgramData\MySQL\MySQL Server 5.6</pre></td></tr></table></div>

<p>You also need to create a MySQL anonymous user in the database to support the default user during compilation, and if you dropped the test database you need to recreate it. I also ended up creating an ODBC user. Here are the commands to run as the root superuser:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">CREATE</span> <span style="color: #000099;">USER</span> <span style="color: #008000;">'ODBC'</span>@<span style="color: #008000;">'localhost'</span><span style="color: #000033;">;</span>
<span style="color: #990099; font-weight: bold;">CREATE</span> <span style="color: #000099;">USER</span> <span style="color: #008000;">''</span>@<span style="color: #008000;">'localhost'</span> IDENTIFIED BY <span style="color: #008000;">'s3krit'</span><span style="color: #000033;">;</span>
<span style="color: #990099; font-weight: bold;">GRANT</span> <span style="color: #990099; font-weight: bold;">ALL</span> <span style="color: #990099; font-weight: bold;">ON</span> test.<span style="color: #CC0099;">*</span> <span style="color: #990099; font-weight: bold;">TO</span> <span style="color: #008000;">''</span>@<span style="color: #008000;">'localhost'</span><span style="color: #000033;">;</span></pre></td></tr></table></div>

<p>I also took the time to update the MySQL <code>test.pl</code> to Perl 5.16; unfortunately, at the end of the day I didn&#8217;t get it working. Maybe I&#8217;ll try back in a few weeks. You need to change line 57 from port 5050 to port 3306, and &#8220;<code>SharedSecret</code>&#8221; to &#8220;<code>s3krit</code>&#8220;, as shown:</p>
<p><a href="http://blog.mclaughlinsoftware.com/wp-content/uploads/2013/04/perl_5_16_change021.png"><img src="http://blog.mclaughlinsoftware.com/wp-content/uploads/2013/04/perl_5_16_change021.png" alt="perl_5_16_change02" width="610" height="88" class="aligncenter size-full wp-image-7682" /></a></p>
<p>Here&#8217;s are the edits required <code>test.pl</code> program on lines 189 and 194:</p>
<p><a href="http://blog.mclaughlinsoftware.com/wp-content/uploads/2013/04/perl_5_16_change01.png"><img src="http://blog.mclaughlinsoftware.com/wp-content/uploads/2013/04/perl_5_16_change01.png" alt="perl_5_16_change01" width="485" height="357" class="aligncenter size-full wp-image-7679" /></a></p>
<p>The only release note provided is below, which I found inadequate. If you find the trick before me, please post it.</p>
<p style="font-size:115%;font-weight:bold">Windows</p>
<ul>
<li>The <code>fork()</code> emulation has known limitations. See perlfork for a detailed summary. In particular, <code>fork()</code> emulation will not work correctly with extensions that are either not thread-safe, or maintain internal state that cannot be cloned in the pseudo-child process. This caveat currently applies to extensions such as Tk and Storable.</li>
<li>It seems that some people are having problems with the ActivePerl MSI installer. The first thing to note is that you <em>CANNOT</em> install ActivePerl 5.16 over an older version of ActivePerl based on 5.14, 5.12, 5.10, 5.8, 5.6 or 5.005, such as build 1204 or any other 1200, 1000, 800, 600 or 500 series build. We have determined that some of these problems are due to other installations of Perl that may be pointed at by something in the environment.
<p>    The sure-fire solution is to make absolutely certain that no other installations of Perl are on the target machine. Realizing that this is not always possible, you can follow these steps to ensure the other installations will not interfere.</p>
<ul>
<li>Stop the <em>&#8220;Windows Installer&#8221;</em> service. This can be accomplished from the command prompt using the following command:
<p style="clear:both">

<div class="wp_syntax"><table><tr><td class="code"><pre class="dos" style="font-family:monospace;">C:\<span style="color: #33cc33;">&gt;</span> net stop &quot;Windows Installer&quot;</pre></td></tr></table></div>

</li>
<li>Temporarily remove or rename <code>PERLLIB</code> and <code>PERL5LIB</code> environment variables in the system environment.</li>
<li>Temporarily remove or rename the following registry values:
<p style="clear:both">

<div class="wp_syntax"><table><tr><td class="code"><pre class="dos" style="font-family:monospace;">[\\HKEY_LOCAL_MACHINE\Software\Perl] lib = <span style="color: #33cc33;">&lt;</span>directory<span style="color: #33cc33;">&gt;</span> <span style="color: #33cc33;">(</span>REG_SV<span style="color: #33cc33;">)</span>
[\\HKEY_LOCAL_MACHINE\Software\Perl] sitelib = <span style="color: #33cc33;">&lt;</span>directory<span style="color: #33cc33;">&gt;</span> <span style="color: #33cc33;">(</span>REG_SV<span style="color: #33cc33;">)</span>
[\\HKEY_LOCAL_MACHINE\Software\Perl] lib-<span style="color: #33cc33;">&lt;</span>PerlVersion<span style="color: #33cc33;">&gt;</span> = <span style="color: #33cc33;">&lt;</span>directory<span style="color: #33cc33;">&gt;</span> <span style="color: #33cc33;">(</span>REG_SV<span style="color: #33cc33;">)</span>
[\\HKEY_LOCAL_MACHINE\Software\Perl] sitelib-<span style="color: #33cc33;">&lt;</span>PerlVersion<span style="color: #33cc33;">&gt;</span> = <span style="color: #33cc33;">&lt;</span>directory<span style="color: #33cc33;">&gt;(</span>REG_SV<span style="color: #33cc33;">)</span></pre></td></tr></table></div>

</li>
<li>Proceed with the installation.</li>
</ul>
<p>Once the installation has completed successfully, the above actions may be undone although restoring the environment variables or the registry values may interfere with the proper operation of your new ActivePerl installation. In order to perform all of the above steps, you will need to have Administrative privileges on the target machine. If you do not have the required privileges you should contact your Administrator.</li>
]]></content:encoded>
			<wfw:commentRss>http://blog.mclaughlinsoftware.com/2013/04/26/activeperl-on-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL Triggers with Logging</title>
		<link>http://blog.mclaughlinsoftware.com/2013/04/25/mysql-triggers-with-logging/</link>
		<comments>http://blog.mclaughlinsoftware.com/2013/04/25/mysql-triggers-with-logging/#comments</comments>
		<pubDate>Fri, 26 Apr 2013 05:01:10 +0000</pubDate>
		<dc:creator>maclochlainn</dc:creator>
				<category><![CDATA[InnoDB]]></category>
		<category><![CDATA[MyISAM]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[MySQL Trigger]]></category>
		<category><![CDATA[autonomous insert statements]]></category>
		<category><![CDATA[database triggers]]></category>
		<category><![CDATA[innodb]]></category>
		<category><![CDATA[myisam]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://blog.mclaughlinsoftware.com/?p=7657</guid>
		<description><![CDATA[Somebody asked why you can&#8217;t implement MySQL triggers that write information when you want to stop the DML statement, like autonomous procedures in Oracle. The question was a surprise but I didn&#8217;t find anything on it, so here&#8217;s how you can do it. This is more or less like an autonomous process by leveraging both [...]]]></description>
				<content:encoded><![CDATA[<p>Somebody asked why you can&#8217;t implement MySQL triggers that write information when you want to stop the DML statement, like autonomous procedures in Oracle. The question was a surprise but I didn&#8217;t find anything on it, so here&#8217;s how you can do it. This is more or less like an autonomous process by leveraging both the InnoDB and MyISAM engine&#8217;s behaviors. This post leverages an earlier explanation of <a href="http://blog.mclaughlinsoftware.com/2012/11/22/mysql-database-triggers/">MySQL Triggers</a>.</p>
<ol start="1">
<li>First you create a MyISAM table, which is a persistent store that auto commits when you&#8217;re other InnoDB tables can be transactionally dependent. Here&#8217;s a simple MyISAM <code>logger</code> table.</li>
</ol>
<div style="margin-left:30px">

<div class="wp_syntax"><table><tr><td class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">CREATE</span> <span style="color: #990099; font-weight: bold;">TABLE</span> logger
<span style="color: #FF00FF;">&#40;</span> logger_id         <span style="color: #999900; font-weight: bold;">INT</span> <span style="color: #FF9900; font-weight: bold;">UNSIGNED</span> <span style="color: #FF9900; font-weight: bold;">AUTO_INCREMENT</span> <span style="color: #990099; font-weight: bold;">PRIMARY KEY</span>
<span style="color: #000033;">,</span> logger_event      <span style="color: #999900; font-weight: bold;">VARCHAR</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">50</span><span style="color: #FF00FF;">&#41;</span>
<span style="color: #000033;">,</span> logger_table      <span style="color: #999900; font-weight: bold;">VARCHAR</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">50</span><span style="color: #FF00FF;">&#41;</span>
<span style="color: #000033;">,</span> logger_instring   <span style="color: #999900; font-weight: bold;">VARCHAR</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">100</span><span style="color: #FF00FF;">&#41;</span>
<span style="color: #000033;">,</span> logger_outstring  <span style="color: #999900; font-weight: bold;">VARCHAR</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">100</span><span style="color: #FF00FF;">&#41;</span>
<span style="color: #000033;">,</span> created_by        <span style="color: #999900; font-weight: bold;">INT</span> <span style="color: #FF9900; font-weight: bold;">UNSIGNED</span>
<span style="color: #000033;">,</span> creation_date     <span style="color: #999900; font-weight: bold;">DATE</span>
<span style="color: #000033;">,</span> last_updated_by   <span style="color: #999900; font-weight: bold;">INT</span> <span style="color: #FF9900; font-weight: bold;">UNSIGNED</span>
<span style="color: #000033;">,</span> last_update_date  <span style="color: #999900; font-weight: bold;">DATE</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #990099; font-weight: bold;">ENGINE</span><span style="color: #CC0099;">=</span>MyISAM<span style="color: #000033;">;</span></pre></td></tr></table></div>

</div>
<ol start="2">
<li>Next, you create an on-insert trigger that changes an input but doesn&#8217;t stop the transaction. It also writes to the logger MyISAM table in the scope of the transaction.</li>
</ol>
<div style="margin-left:30px">

<div class="wp_syntax"><table><tr><td class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">CREATE</span> <span style="color: #990099; font-weight: bold;">TRIGGER</span> contact_insert
BEFORE <span style="color: #990099; font-weight: bold;">INSERT</span> <span style="color: #990099; font-weight: bold;">ON</span> contact
<span style="color: #990099; font-weight: bold;">FOR EACH ROW</span>
<span style="color: #990099; font-weight: bold;">BEGIN</span>
&nbsp;
  <span style="color: #808000; font-style: italic;">/* Check if last name contains a white space. */</span>
  <span style="color: #009900;">IF</span> new.last_name <span style="color: #CC0099; font-weight: bold;">REGEXP</span> <span style="color: #008000;">'^.* .*$'</span> <span style="color: #009900;">THEN</span>
&nbsp;
    <span style="color: #808000; font-style: italic;">/* Insert into an MyISAM table, which auto commits in the scope
       of a transaction. */</span>
    <span style="color: #990099; font-weight: bold;">INSERT</span> <span style="color: #990099; font-weight: bold;">INTO</span> logger
    <span style="color: #990099; font-weight: bold;">VALUES</span> <span style="color: #FF00FF;">&#40;</span> <span style="color: #9900FF; font-weight: bold;">null</span>
           <span style="color: #000033;">,</span><span style="color: #008000;">'insert'</span>
           <span style="color: #000033;">,</span><span style="color: #008000;">'contact'</span>
           <span style="color: #000033;">,</span> new.last_name
           <span style="color: #000033;">,</span> <span style="color: #000099;">REPLACE</span><span style="color: #FF00FF;">&#40;</span>new.last_name<span style="color: #000033;">,</span><span style="color: #008000;">' '</span><span style="color: #000033;">,</span><span style="color: #008000;">'-'</span><span style="color: #FF00FF;">&#41;</span>
           <span style="color: #000033;">,</span> new.created_by
           <span style="color: #000033;">,</span> new.creation_date
           <span style="color: #000033;">,</span> new.last_updated_by
           <span style="color: #000033;">,</span> new.last_update_date <span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">;</span>
&nbsp;
    <span style="color: #808000; font-style: italic;">/* Replace the name for the INSERT INTO the CONTACT table. */</span>
    <span style="color: #990099; font-weight: bold;">SET</span> new.last_name <span style="color: #CC0099;">:=</span> <span style="color: #000099;">REPLACE</span><span style="color: #FF00FF;">&#40;</span>new.last_name<span style="color: #000033;">,</span><span style="color: #008000;">' '</span><span style="color: #000033;">,</span><span style="color: #008000;">'-'</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">;</span>
  <span style="color: #009900;">END</span> <span style="color: #009900;">IF</span><span style="color: #000033;">;</span>
<span style="color: #009900;">END</span><span style="color: #000033;">;</span>
$$</pre></td></tr></table></div>

</div>
<p style="clear:both">
<ol start="3">
<li>Next, you create an on-update trigger that changes an update while aborting the transaction. It also writes to the logger MyISAM table because its outside the InnoDB scope of a transaction and auto committed on insert.</li>
</ol>
<div style="margin-left:30px">

<div class="wp_syntax"><table><tr><td class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">CREATE</span> <span style="color: #990099; font-weight: bold;">TRIGGER</span> contact_update
BEFORE <span style="color: #990099; font-weight: bold;">UPDATE</span> <span style="color: #990099; font-weight: bold;">ON</span> contact
<span style="color: #990099; font-weight: bold;">FOR EACH ROW</span>
<span style="color: #990099; font-weight: bold;">BEGIN</span>
&nbsp;
  <span style="color: #808000; font-style: italic;">/* Check if last name contains a white space. */</span>
  <span style="color: #009900;">IF</span> new.last_name <span style="color: #CC0099; font-weight: bold;">REGEXP</span> <span style="color: #008000;">'^.* .*$'</span> <span style="color: #009900;">THEN</span>
&nbsp;
    <span style="color: #808000; font-style: italic;">/* Insert into an MyISAM table, which auto commits in the scope
       of a transaction. */</span>
    <span style="color: #990099; font-weight: bold;">INSERT</span> <span style="color: #990099; font-weight: bold;">INTO</span> logger
    <span style="color: #990099; font-weight: bold;">VALUES</span> <span style="color: #FF00FF;">&#40;</span> <span style="color: #9900FF; font-weight: bold;">null</span>
           <span style="color: #000033;">,</span><span style="color: #008000;">'update'</span>
           <span style="color: #000033;">,</span><span style="color: #008000;">'contact'</span>
           <span style="color: #000033;">,</span> new.last_name
           <span style="color: #000033;">,</span> <span style="color: #9900FF; font-weight: bold;">null</span>           
           <span style="color: #000033;">,</span> old.created_by
           <span style="color: #000033;">,</span> old.creation_date
           <span style="color: #000033;">,</span> new.last_updated_by
           <span style="color: #000033;">,</span> new.last_update_date <span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">;</span>
&nbsp;
    <span style="color: #808000; font-style: italic;">/* Throw an exception to force the business user to see they
       can't update a last name with a white space. */</span>
    SIGNAL SQLSTATE <span style="color: #008000;">'42000'</span><span style="color: #000033;">;</span>
  <span style="color: #009900;">END</span> <span style="color: #009900;">IF</span><span style="color: #000033;">;</span>
<span style="color: #009900;">END</span><span style="color: #000033;">;</span>
$$</pre></td></tr></table></div>

</div>
<p style="clear:both">
<ol start="4">
<li>Next, you create a test case with an <code>INSERT</code> and <code>UPDATE</code> statement that meets the condition of the triggers.</li>
</ol>
<div style="margin-left:30px">

<div class="wp_syntax"><table><tr><td class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #808000; font-style: italic;">/* Insert a row meeting the trigger condition. */</span>
<span style="color: #990099; font-weight: bold;">INSERT</span> <span style="color: #990099; font-weight: bold;">INTO</span> contact <span style="color: #990099; font-weight: bold;">VALUES</span>
<span style="color: #FF00FF;">&#40;</span> <span style="color: #9900FF; font-weight: bold;">null</span><span style="color: #000033;">,</span> <span style="color: #008080;">1001</span><span style="color: #000033;">,</span> <span style="color: #008080;">1003</span><span style="color: #000033;">,</span><span style="color: #008000;">'Catherine'</span><span style="color: #000033;">,</span> <span style="color: #9900FF; font-weight: bold;">null</span><span style="color: #000033;">,</span><span style="color: #008000;">'Zeta Jones'</span><span style="color: #000033;">,</span> <span style="color: #008080;">1001</span><span style="color: #000033;">,</span> <span style="color: #000099;">UTC_DATE</span><span style="color: #FF00FF;">&#40;</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">,</span> <span style="color: #008080;">1001</span><span style="color: #000033;">,</span> <span style="color: #000099;">UTC_DATE</span><span style="color: #FF00FF;">&#40;</span><span style="color: #FF00FF;">&#41;</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">;</span>
&nbsp;
<span style="color: #808000; font-style: italic;">/* Update a row meeting the trigger condition. */</span>
<span style="color: #990099; font-weight: bold;">UPDATE</span> contact
<span style="color: #990099; font-weight: bold;">SET</span>    last_name <span style="color: #CC0099;">=</span> <span style="color: #008000;">'Zeta Jones'</span>
<span style="color: #000033;">,</span>      last_updated_by <span style="color: #CC0099;">=</span> <span style="color: #008080;">1003</span>
<span style="color: #000033;">,</span>      last_update_date <span style="color: #CC0099;">=</span> <span style="color: #000099;">UTC_DATE</span><span style="color: #FF00FF;">&#40;</span><span style="color: #FF00FF;">&#41;</span>
<span style="color: #990099; font-weight: bold;">WHERE</span>  last_name <span style="color: #CC0099;">=</span> <span style="color: #008000;">'Zeta-Jones'</span><span style="color: #000033;">;</span></pre></td></tr></table></div>

</div>
<p style="clear:both">
<ol start="5">
<li>Last, query the logger table. You have a record inserted for both the allowed behavior and the aborted behavior. This means you have the ability to capture material that should never be inserted or updated into a table and who did it by leveraging the who-audit columns of the table.</li>
</ol>
<div style="margin-left:30px">

<div class="wp_syntax"><table><tr><td class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">SELECT</span> <span style="color: #CC0099;">*</span> <span style="color: #990099; font-weight: bold;">FROM</span> logger<span style="color: #000033;">;</span></pre></td></tr></table></div>

<p>It returns:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #CC0099;">+-----------+--------------+--------------+-----------------+------------------+------------+---------------+-----------------+------------------+</span>
<span style="color: #CC0099;">|</span> logger_id <span style="color: #CC0099;">|</span> logger_event <span style="color: #CC0099;">|</span> logger_table <span style="color: #CC0099;">|</span> logger_instring <span style="color: #CC0099;">|</span> logger_outstring <span style="color: #CC0099;">|</span> created_by <span style="color: #CC0099;">|</span> creation_date <span style="color: #CC0099;">|</span> last_updated_by <span style="color: #CC0099;">|</span> last_update_date <span style="color: #CC0099;">|</span>
<span style="color: #CC0099;">+-----------+--------------+--------------+-----------------+------------------+------------+---------------+-----------------+------------------+</span>
<span style="color: #CC0099;">|</span>         <span style="color: #008080;">1</span> <span style="color: #CC0099;">|</span> <span style="color: #990099; font-weight: bold;">insert</span>       <span style="color: #CC0099;">|</span> contact      <span style="color: #CC0099;">|</span> Zeta Jones      <span style="color: #CC0099;">|</span> Zeta<span style="color: #CC0099;">-</span>Jones       <span style="color: #CC0099;">|</span>       <span style="color: #008080;">1001</span> <span style="color: #CC0099;">|</span> <span style="color: #008080;">2013</span><span style="color: #CC0099;">-</span><span style="color: #008080;">04</span><span style="color: #CC0099;">-</span><span style="color: #008080;">26</span>    <span style="color: #CC0099;">|</span>            <span style="color: #008080;">1001</span> <span style="color: #CC0099;">|</span> <span style="color: #008080;">2013</span><span style="color: #CC0099;">-</span><span style="color: #008080;">04</span><span style="color: #CC0099;">-</span><span style="color: #008080;">26</span>       <span style="color: #CC0099;">|</span>
<span style="color: #CC0099;">|</span>         <span style="color: #008080;">2</span> <span style="color: #CC0099;">|</span> <span style="color: #990099; font-weight: bold;">update</span>       <span style="color: #CC0099;">|</span> contact      <span style="color: #CC0099;">|</span> Zeta Jones      <span style="color: #CC0099;">|</span> <span style="color: #9900FF; font-weight: bold;">NULL</span>             <span style="color: #CC0099;">|</span>       <span style="color: #008080;">1001</span> <span style="color: #CC0099;">|</span> <span style="color: #008080;">2013</span><span style="color: #CC0099;">-</span><span style="color: #008080;">04</span><span style="color: #CC0099;">-</span><span style="color: #008080;">26</span>    <span style="color: #CC0099;">|</span>            <span style="color: #008080;">1003</span> <span style="color: #CC0099;">|</span> <span style="color: #008080;">2013</span><span style="color: #CC0099;">-</span><span style="color: #008080;">04</span><span style="color: #CC0099;">-</span><span style="color: #008080;">26</span>       <span style="color: #CC0099;">|</span>
<span style="color: #CC0099;">+-----------+--------------+--------------+-----------------+------------------+------------+---------------+-----------------+------------------+</span>
<span style="color: #008080;">2</span> rows <span style="color: #990099; font-weight: bold;">in</span> <span style="color: #990099; font-weight: bold;">set</span> <span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">0.00</span> sec<span style="color: #FF00FF;">&#41;</span></pre></td></tr></table></div>

</div>
<p style="clear:both">
<p>This effectively delivers in MySQL the equivalent of an autonomous transaction in Oracle. The result from the non-critical trigger records the before and after value, while the results from the critical update trigger only record the before values because the event is aborted by raising an error in the trigger. As always, I hope this helps somebody looking for a solution.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mclaughlinsoftware.com/2013/04/25/mysql-triggers-with-logging/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>MySQL 5.6 Install Steps</title>
		<link>http://blog.mclaughlinsoftware.com/2013/04/25/mysql-5-6-install-steps/</link>
		<comments>http://blog.mclaughlinsoftware.com/2013/04/25/mysql-5-6-install-steps/#comments</comments>
		<pubDate>Thu, 25 Apr 2013 20:00:05 +0000</pubDate>
		<dc:creator>maclochlainn</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[MySQL Workbench]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[MySQL Install]]></category>
		<category><![CDATA[Windows 7]]></category>

		<guid isPermaLink="false">http://blog.mclaughlinsoftware.com/?p=7595</guid>
		<description><![CDATA[My install instructions on the web site were old, somebody wanted me to publish another set of screen capture for the MySQL 5.6 install and configuration. This is it for Windows 7 using the downloadable MSI file. Installation Steps The installation from MySQL&#8217;s perspective is actually the installation and configuration of MySQL. For your convenience [...]]]></description>
				<content:encoded><![CDATA[<p>My install instructions on the web site were old, somebody wanted me to publish another set of screen capture for the MySQL 5.6 install and configuration. This is it for Windows 7 using the downloadable MSI file.</p>
<p style="font-size:110%;font-weight:bold">Installation Steps</p>
<p>The installation from MySQL&#8217;s perspective is actually the installation and configuration of MySQL. For your convenience and reference, I&#8217;ve already installed the pre-requisites for MySQL. They&#8217;re:</p>
<ul style="margin-left:30px">
<li>Visual Studio Tools for Office 20120 Runtime</li>
<li>Microsoft .NET Framework 4 Client Profile</li>
<li>Microsoft Excel 2007 or greater</li>
<li>Microsoft .NET Framework 4 Client Profile</li>
<li>Microsoft Visual C++ 2010 32-bit runtime</li>
<li>Microsoft .NET Framework 4 Client Profile</li>
</ul>
<p>Below are the installation steps after you download the current release <code>.msi</code> file.<a href="http://blog.mclaughlinsoftware.com/wp-content/uploads/2013/04/MySQL56_Install01.png"><img src="http://blog.mclaughlinsoftware.com/wp-content/uploads/2013/04/MySQL56_Install01.png" alt="MySQL56_Install01" width="105" height="85" class="alignright size-full wp-image-7597" /></a> The icon should look like the one to the right. For this example, I&#8221;m using the <code>mysql-installer-community-5.6.11.0.msi</code>. Double-click the icon on your desktop or from your <code>C:\Users\<em>username</em>\Downloads</code> folder. While working through the steps, you can launch any of the small images to the left if you&#8217;d like to see what your screen should look like (generally with a right click to open in a new window).</p>
<p><a href="http://blog.mclaughlinsoftware.com/wp-content/uploads/2013/04/MySQL56_Install02.png"><img src="http://blog.mclaughlinsoftware.com/wp-content/uploads/2013/04/MySQL56_Install02.png" alt="" title="Windows 7 Confirmation Dialog Message Box" width="120" height="90" class="alignleft size-medium wp-image-6732" style="margin-right:30px" /></a>
<ol start="1">
<li>The first screen is a Windows 7 dialog box. Click the <em>Run</em> button to install launch the MySQL 5.6 Installer.</li>
</ol>
<p style="clear:both">
<p><a href="http://blog.mclaughlinsoftware.com/wp-content/uploads/2013/04/MySQL56_Install03.png"><img src="http://blog.mclaughlinsoftware.com/wp-content/uploads/2013/04/MySQL56_Install03.png" alt="" title="Windows 7 Cancellation Dialog Message Box" width="120" height="90" class="alignleft size-medium wp-image-6732" style="margin-right:30px" /></a>
<ol start="2">
<li>The second screen is a Windows 7 dialog box. It advises you that the MySQL Installer is working and lets you cancel that operation. Don&#8217;t click the <em>Cancel</em> button unless you want to stop the MySQL 5.6 Installer.</li>
</ol>
<p style="clear:both">
<p><a href="http://blog.mclaughlinsoftware.com/wp-content/uploads/2013/04/MySQL56_Install04.png"><img src="http://blog.mclaughlinsoftware.com/wp-content/uploads/2013/04/MySQL56_Install04.png" alt="" title="MySQL Installer Process Advise Dialog" width="120" height="90" class="alignleft size-medium wp-image-6732" style="margin-right:30px" /></a>
<ol start="3">
<li>The third screen is a MySQL Installer message box. It closes when ready to proceed. Ignore it, unless it&#8217;s there for more than a couple minutes. If that occurs you&#8217;ve got something wrong with your Windows installation or a very slow computer. If the former, kill the installation process; if the latter, wait patiently.</li>
</ol>
<p style="clear:both">
<p><a href="http://blog.mclaughlinsoftware.com/wp-content/uploads/2013/04/MySQL56_Install05.png"><img src="http://blog.mclaughlinsoftware.com/wp-content/uploads/2013/04/MySQL56_Install05.png" alt="" title="MySQL Installer Select Action Dialog" width="120" height="90" class="alignleft size-medium wp-image-6732" style="margin-right:30px" /></a>
<ol start="4">
<li>The fourth screen in the process is the first MySQL Installer screen. Here you choose what you want to do. You can install MySQL products, inquire about MySQL, or check physical resource components. Provided you installed the prerequisites listed above, you should be prepared to install MySQL Products. Click the <em>Install MySQL Products</em> link to proceed or one of the others to explore.</li>
</ol>
<p style="clear:both">
<p><a href="http://blog.mclaughlinsoftware.com/wp-content/uploads/2013/04/MySQL56_Install06.png"><img src="http://blog.mclaughlinsoftware.com/wp-content/uploads/2013/04/MySQL56_Install06.png" alt="" title="MySQL Installer License Dialog" width="120" height="90" class="alignleft size-medium wp-image-6732" style="margin-right:30px" /></a>
<ol start="5">
<li>The second MySQL Installer screen is the license form. You must check the <em>I accept the license terms</em> checkbox to enable the <em>Next</em> button. Once the <em>Next</em> button is enabled, click it to proceed.</li>
</ol>
<p style="clear:both">
<p><a href="http://blog.mclaughlinsoftware.com/wp-content/uploads/2013/04/MySQL56_Install07.png"><img src="http://blog.mclaughlinsoftware.com/wp-content/uploads/2013/04/MySQL56_Install07.png" alt="" title="MySQL Installer License Dialog" width="120" height="90" class="alignleft size-medium wp-image-6732" style="margin-right:30px" /></a>
<ol start="6">
<li>The third MySQL Installer screen connects to the Internet and finds the latest product update. You can check the <em>Skip the check for updates (not recommended)</em> checkbox to skip this but for the example we&#8217;ll check anyway. Click the <em>Execute</em> button to proceed.</li>
</ol>
<p style="clear:both">
<p><a href="http://blog.mclaughlinsoftware.com/wp-content/uploads/2013/04/MySQL56_Install07.png"><img src="http://blog.mclaughlinsoftware.com/wp-content/uploads/2013/04/MySQL56_Install07.png" alt="" title="MySQL Installer License Dialog" width="120" height="90" class="alignleft size-medium wp-image-6732" style="margin-right:30px" /></a>
<ol start="7">
<li>The fourth MySQL Installer screen connects to the Internet and finds the latest product update. You can check the <em>Skip the check for updates (not recommended)</em> checkbox to skip this but for the example we&#8217;ll check anyway. Click the <em>Execute</em> button to proceed.</li>
</ol>
<p style="clear:both">
<p><a href="http://blog.mclaughlinsoftware.com/wp-content/uploads/2013/04/MySQL56_Install08.png"><img src="http://blog.mclaughlinsoftware.com/wp-content/uploads/2013/04/MySQL56_Install08.png" alt="" title="MySQL Installer License Dialog" width="120" height="90" class="alignleft size-medium wp-image-6732" style="margin-right:30px" /></a>
<ol start="8">
<li>The fifth MySQL Installer screen acknowledges the latest update is what you&#8217;re installing. Click the <em>Next</em> button to proceed.</li>
</ol>
<p style="clear:both">
<p><a href="http://blog.mclaughlinsoftware.com/wp-content/uploads/2013/04/MySQL56_Install09.png"><img src="http://blog.mclaughlinsoftware.com/wp-content/uploads/2013/04/MySQL56_Install09.png" alt="" title="MySQL Installer License Dialog" width="120" height="90" class="alignleft size-medium wp-image-6732" style="margin-right:30px" /></a>
<ol start="9">
<li>
<p>The sixth MySQL Installer screen gives you five choices for the installation, which are listed below. You most likely want to install the <em>Developer Default</em>, so click the <em>Developer Default</em> radio button and then, click the <em>Next</em> button to proceed.</p>
<dl style="margin-left:150px">
<dt>MySQL Server</dt>
<dd>Both the client and server software for the MySQL Server</dd>
<dt>MySQL Workbench</dt>
<dd>The GUI application to develop for and manage the server.</dd>
<dt>MySQL Visual Studio Plugin</dt>
<dd>To work with the MySQL Server from VS.</dd>
<dt>MySQL Connectors</dt>
<dd>Connector/Net, Java, C/C++, OBDC and others.</dd>
<dt>Examples and tutorials</dt>
<dd>To help you get started with your development.</dd>
<dt>Documentation</dt>
<dd>Allows you to read the documentation offline.</dd>
</dl>
</li>
</ol>
<p style="clear:both">
<p><a href="http://blog.mclaughlinsoftware.com/wp-content/uploads/2013/04/MySQL56_Install10.png"><img src="http://blog.mclaughlinsoftware.com/wp-content/uploads/2013/04/MySQL56_Install10.png" alt="" title="MySQL Installer License Dialog" width="120" height="90" class="alignleft size-medium wp-image-6732" style="margin-right:30px" /></a>
<ol start="10">
<li>The seventh MySQL Installer screen performs a system check for the pre-requisites, which I listed before the installation. Assuming you installed them, you should see a screen that confirms your system configuration is ready for installation. Click the <em>Next</em> button to proceed.</li>
</ol>
<p style="clear:both">
<p><a href="http://blog.mclaughlinsoftware.com/wp-content/uploads/2013/04/MySQL56_Install11.png"><img src="http://blog.mclaughlinsoftware.com/wp-content/uploads/2013/04/MySQL56_Install11.png" alt="" title="MySQL Installer License Dialog" width="120" height="90" class="alignleft size-medium wp-image-6732" style="margin-right:30px" /></a>
<ol start="11">
<li>
<p>The eighth MySQL Installer screen performs displays the products that it&#8217;ll install, which are listed below and available in the full image to the left. Click the <em>Execute</em> button to install the products.</p>
<ul style="margin-left:150px">
<li>MySQL Server 5.6.11</li>
<li>MySQL Workbench CE 5.2.47</li>
<li>MySQL Notifier 1.0.3</li>
<li>MySQL for Excel 1.1.1</li>
<li>Connector/ODBC 5.2.4</li>
<li>Connector/C++ 1.1.2</li>
<li>Connector/C++ 1.1.2</li>
<li>Connector/J 5.1.24</li>
<li>Connector/NET 6.6.5</li>
<li>MySQL Documentation 5.6.11</li>
<li>Samples and Examples 5.6.11</li>
</ul>
</li>
</ol>
<p style="clear:both">
<p><a href="http://blog.mclaughlinsoftware.com/wp-content/uploads/2013/04/MySQL56_Install12.png"><img src="http://blog.mclaughlinsoftware.com/wp-content/uploads/2013/04/MySQL56_Install12.png" alt="" title="MySQL Installer License Dialog" width="120" height="90" class="alignleft size-medium wp-image-6732" style="margin-right:30px" /></a>
<ol start="12">
<li>The nineth MySQL Installer screen shows the installation by product and it can take a couple minutes. The screen to the left displays progress more than halfway complete. You don&#8217;t need to do anything in this step until all products are complete.</li>
</ol>
<p style="clear:both">
<p><a href="http://blog.mclaughlinsoftware.com/wp-content/uploads/2013/04/MySQL56_Install13.png"><img src="http://blog.mclaughlinsoftware.com/wp-content/uploads/2013/04/MySQL56_Install13.png" alt="" title="MySQL Installer License Dialog" width="120" height="90" class="alignleft size-medium wp-image-6732" style="margin-right:30px" /></a>
<ol start="13">
<li>The tenth MySQL Installer screen shows the completed installation. Everything should install successfully, as shown in the image. Click the <em>Next</em> button to proceed.</li>
</ol>
<p>This concludes the installation of the MySQL products. The next section shows you how to configure MySQL.</p>
<p style="clear:both;margin-top:10px">
<p style="font-size:110%;font-weight:bold">Configuration Steps</p>
<p>You have two basic options, the simple one and the advanced one. These steps will show you how to perform an advanced configuration. I&#8217;ve opted to maintain the step numbering from the beginning of the installation. Here are the steps:</p>
<p style="clear:both">
<p><a href="http://blog.mclaughlinsoftware.com/wp-content/uploads/2013/04/MySQL56_Install14.png"><img src="http://blog.mclaughlinsoftware.com/wp-content/uploads/2013/04/MySQL56_Install14.png" alt="" title="MySQL Installer License Dialog" width="120" height="90" class="alignleft size-medium wp-image-6732" style="margin-right:30px" /></a>
<ol start="14">
<li>The eleventh MySQL Installer screen is the first MySQL Configuration screen. You can click the <em>Show Details</em> button or begin the configuration. Click the <em>Next</em> button to proceed.</li>
</ol>
<p style="clear:both">
<p><a href="http://blog.mclaughlinsoftware.com/wp-content/uploads/2013/04/MySQL56_Install15.png"><img src="http://blog.mclaughlinsoftware.com/wp-content/uploads/2013/04/MySQL56_Install15.png" alt="" title="MySQL Installer License Dialog" width="120" height="90" class="alignleft size-medium wp-image-6732" style="margin-right:30px" /></a>
<ol start="15">
<li>The second MySQL Configuration screen sets the server configuration type, enables TCP/IP networking (as opposed to a socket model), and lets you enable <em>Advanced Configuration</em>. For this installation, we enable the <em>Show Advanced Options</em> checkbox before you click the <em>Next</em> button.</li>
</ol>
<p style="clear:both">
<p><a href="http://blog.mclaughlinsoftware.com/wp-content/uploads/2013/04/MySQL56_Install16.png"><img src="http://blog.mclaughlinsoftware.com/wp-content/uploads/2013/04/MySQL56_Install16.png" alt="" title="MySQL Installer License Dialog" width="120" height="90" class="alignleft size-medium wp-image-6732" style="margin-right:30px" /></a>
<ol start="16">
<li>
<p style="margin-left:120px">The third MySQL Configuration screen sets the password and lets you create MySQL User Accounts. It&#8217;s much easier to let the install proceed and use MySQL Workbench to create databases, users, and roles; plus grant permissions through the GUI environment. Enter the <code>root</code> password twice, a <strong><em>trivial and unsecure</em></strong> password <code>cangetin</code> is what I recommend to my students who won&#8217;t have any meaningful information in the database. Make sure you can remember the password you enter. Clearly, a better password is required for real environments. After entering the password twice, click the <em>Next</em> button to proceed.</p>
</li>
</ol>
<p style="clear:both">
<p><a href="http://blog.mclaughlinsoftware.com/wp-content/uploads/2013/04/MySQL56_Install17.png"><img src="http://blog.mclaughlinsoftware.com/wp-content/uploads/2013/04/MySQL56_Install17.png" alt="" title="MySQL Installer License Dialog" width="120" height="90" class="alignleft size-medium wp-image-6732" style="margin-right:30px" /></a>
<ol start="17">
<li>
<p style="margin-left:120px">The fourth MySQL Configuration screen sets the <em>Windows Service Name</em>, and you should probably make sure there isn&#8217;t another MySQL56 service on the machine before you proceed. You have the choice of running the Windows Service using the <em>Standard System Account</em> or a <em>Customer User</em> account. Unless you&#8217;re an expert at Windows 7 administration, you should probably choose the <em>Standard System Account</em> as the one running the Windows 7 service. Click the <em>Next</em> button.</p>
</li>
</ol>
<p style="clear:both">
<p><a href="http://blog.mclaughlinsoftware.com/wp-content/uploads/2013/04/MySQL56_Install18.png"><img src="http://blog.mclaughlinsoftware.com/wp-content/uploads/2013/04/MySQL56_Install18.png" alt="" title="MySQL Installer License Dialog" width="120" height="90" class="alignleft size-medium wp-image-6732" style="margin-right:30px" /></a>
<ol start="18">
<li>
<p style="margin-left:120px">The fifth MySQL Configuration screen sets the logging options. You only need <em>Show Query Log</em> typically, but the <em>Error Log</em> is helpful. Make the choices and click the <em>Next</em> button.</p>
</li>
</ol>
<p style="clear:both">
<p><a href="http://blog.mclaughlinsoftware.com/wp-content/uploads/2013/04/MySQL56_Install191.png"><img src="http://blog.mclaughlinsoftware.com/wp-content/uploads/2013/04/MySQL56_Install191.png" alt="" title="MySQL Installer License Dialog" width="120" height="90" class="alignleft size-medium wp-image-6732" style="margin-right:30px" /></a>
<ol start="19">
<li>The sixth MySQL Configuration screen explains the next step. It installs the sample files and example databases. You can see what you&#8217;ve installed when you click the <em>Show Details</em> button, which is what I did to get the image at the left. The default choice installs the samples and example databases, which can&#8217;t hurt. You&#8217;ll need the test database if you install DBD::mysql for Perl. If you don&#8217;t want them, you can drop them from the database.</li>
</ol>
<p style="clear:both">
<p><a href="http://blog.mclaughlinsoftware.com/wp-content/uploads/2013/04/MySQL56_Install120.png"><img src="http://blog.mclaughlinsoftware.com/wp-content/uploads/2013/04/MySQL56_Install20.png" alt="" title="MySQL Installer License Dialog" width="120" height="90" class="alignleft size-medium wp-image-6732" style="margin-right:30px" /></a>
<ol start="20">
<li>
<p style="margin-left:120px">The seventh MySQL Configuration screen explains you&#8217;ve completed configuring the MySQL Server. Click the <em>Next</em> button to proceed.</p>
</li>
</ol>
<p style="clear:both">
<p><a href="http://blog.mclaughlinsoftware.com/wp-content/uploads/2013/04/MySQL56_Install121.png"><img src="http://blog.mclaughlinsoftware.com/wp-content/uploads/2013/04/MySQL56_Install21.png" alt="" title="MySQL Installer License Dialog" width="120" height="90" class="alignleft size-medium wp-image-6732" style="margin-right:30px" /></a>
<ol start="21">
<li>
<p style="margin-left:120px">The eighth MySQL Configuration screen explains you&#8217;ve finished everything. You can copy the log file to clipboard, which allows you to see everything that was done. Click the <em>Finish</em> button to complete the installation and configuration.</p>
</li>
</ol>
<p style="clear:both">
<p>Just one caveat (that&#8217;s a warning), this installation doesn&#8217;t put the MySQL executable into your System <code>%PATH%</code> variable. You&#8217;ll need to do that, and if I get a chance I&#8217;ll put a post together for that. I know one or two of my students may need it later.</p>
<p>I hope this helps those you are using the new installer for the first time. It&#8217;s a superior tool to the old one, which was also a good tool.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mclaughlinsoftware.com/2013/04/25/mysql-5-6-install-steps/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Finding DBMS_TYPES value?</title>
		<link>http://blog.mclaughlinsoftware.com/2013/04/13/finding-dbms_types-value/</link>
		<comments>http://blog.mclaughlinsoftware.com/2013/04/13/finding-dbms_types-value/#comments</comments>
		<pubDate>Sat, 13 Apr 2013 18:31:06 +0000</pubDate>
		<dc:creator>maclochlainn</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Oracle 11g]]></category>
		<category><![CDATA[pl/sql]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://blog.mclaughlinsoftware.com/?p=7577</guid>
		<description><![CDATA[Somebody asked me why they can&#8217;t query the DBMS_TYPES.TYPECODE_OBJECT value because they get an ORA-06553 error. Their query attempt is: SELECT dbms_types.typecode_object FROM dual; Naturally, it raises the following exception: SELECT dbms_types.typecode_object * ERROR at line 1: ORA-06553: PLS-221: 'TYPECODE_OBJECT' IS NOT a PROCEDURE OR IS undefined The explanation is very simple. It&#8217;s a package [...]]]></description>
				<content:encoded><![CDATA[<p>Somebody asked me why they can&#8217;t query the <code>DBMS_TYPES.TYPECODE_OBJECT</code> value because they get an <code>ORA-06553</code> error. Their query attempt is:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span>   dbms_types<span style="color: #66cc66;">.</span>typecode_object
<span style="color: #993333; font-weight: bold;">FROM</span>     dual;</pre></td></tr></table></div>

<p>Naturally, it raises the following exception:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span>   dbms_types<span style="color: #66cc66;">.</span>typecode_object
         <span style="color: #66cc66;">*</span>
ERROR at line <span style="color: #cc66cc;">1</span>:
ORA<span style="color: #66cc66;">-</span>06553: PLS<span style="color: #66cc66;">-</span><span style="color: #cc66cc;">221</span>: <span style="color: #ff0000;">'TYPECODE_OBJECT'</span> <span style="color: #993333; font-weight: bold;">IS</span> <span style="color: #993333; font-weight: bold;">NOT</span> a <span style="color: #993333; font-weight: bold;">PROCEDURE</span> <span style="color: #993333; font-weight: bold;">OR</span> <span style="color: #993333; font-weight: bold;">IS</span> undefined</pre></td></tr></table></div>

<p>The explanation is very simple. It&#8217;s a package scoped variable and in Oracle 11<em>g</em> only accessible in a PL/SQL block. Here&#8217;s an anonymous block that would print the value to the console:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">BEGIN</span>
  dbms_output<span style="color: #66cc66;">.</span>put_line<span style="color: #66cc66;">&#40;</span>dbms_types<span style="color: #66cc66;">.</span>typecode_object<span style="color: #66cc66;">&#41;</span>;
<span style="color: #993333; font-weight: bold;">END</span>;
<span style="color: #66cc66;">/</span></pre></td></tr></table></div>

<p>Hope that helps those trying to discover what a package variable&#8217;s value is.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mclaughlinsoftware.com/2013/04/13/finding-dbms_types-value/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQL Injection Risks</title>
		<link>http://blog.mclaughlinsoftware.com/2013/04/05/sql-injection-risks/</link>
		<comments>http://blog.mclaughlinsoftware.com/2013/04/05/sql-injection-risks/#comments</comments>
		<pubDate>Sat, 06 Apr 2013 02:35:52 +0000</pubDate>
		<dc:creator>maclochlainn</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[SQL/PSM]]></category>
		<category><![CDATA[Stored Procedures]]></category>

		<guid isPermaLink="false">http://blog.mclaughlinsoftware.com/?p=7557</guid>
		<description><![CDATA[While I tried to deflect how you perform SQL Injection attacks against a MySQL procedure, my students requested that I post examples of what to do to avoid SQL injection, and what not to do to invite attacks. The best practice to avoid SQL injection attacks is too always bind inputs to data types, and [...]]]></description>
				<content:encoded><![CDATA[<p>While I tried to deflect how you perform SQL Injection attacks against a MySQL procedure, my students requested that I post examples of what to do to avoid SQL injection, and what not to do to invite attacks. The best practice to avoid SQL injection attacks is too always bind inputs to data types, and avoid providing completely dynamic <code>WHERE</code> clauses.</p>
<p>Here&#8217;s the correct way to dynamically generate a result from a MySQL Stored Procedure:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">CREATE</span> <span style="color: #990099; font-weight: bold;">PROCEDURE</span> hello <span style="color: #FF00FF;">&#40;</span><span style="color: #990099; font-weight: bold;">IN</span> pv_input <span style="color: #999900; font-weight: bold;">VARCHAR</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">50</span><span style="color: #FF00FF;">&#41;</span><span style="color: #FF00FF;">&#41;</span>
<span style="color: #990099; font-weight: bold;">BEGIN</span>
  <span style="color: #990099; font-weight: bold;">SELECT</span> sample_id
  <span style="color: #000033;">,</span>      sample_name
  <span style="color: #990099; font-weight: bold;">FROM</span>   sample
  <span style="color: #990099; font-weight: bold;">WHERE</span>  sample_name <span style="color: #CC0099;">=</span> pv_input<span style="color: #000033;">;</span>
<span style="color: #009900;">END</span><span style="color: #000033;">;</span>
$$</pre></td></tr></table></div>

<p>A call to this <code>hello</code> procedure will only return the row or rows where the <code>pv_input</code> value matches the <code>sample_name</code> column value. Any attempt to exploit it like the one below fails.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">CALL</span> hello<span style="color: #FF00FF;">&#40;</span><span style="color: #008000;">'<span style="color: #004000; font-weight: bold;">\'</span>Harriet<span style="color: #004000; font-weight: bold;">\'</span> OR 1 = 1'</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">;</span></pre></td></tr></table></div>

<p>It fails because there&#8217;s no matching <code>'Harriet' OR 1 = 1</code> in the table&#8217;s <code>sample_name</code> column. However, it works well when we submit <code>'Harriet'</code> by herself, without the intended SQL inject phrase &#8220;<code>OR 1 = 1</code>&#8220;, as you can see:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #CC0099;">+-----------+-------------+</span>
<span style="color: #CC0099;">|</span> sample_id <span style="color: #CC0099;">|</span> sample_name <span style="color: #CC0099;">|</span>
<span style="color: #CC0099;">+-----------+-------------+</span>
<span style="color: #CC0099;">|</span>         <span style="color: #008080;">2</span> <span style="color: #CC0099;">|</span> Harriet     <span style="color: #CC0099;">|</span>
<span style="color: #CC0099;">+-----------+-------------+</span>
<span style="color: #008080;">1</span> row <span style="color: #990099; font-weight: bold;">in</span> <span style="color: #990099; font-weight: bold;">set</span> <span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">0.00</span> sec<span style="color: #FF00FF;">&#41;</span></pre></td></tr></table></div>

<p>There are two approaches that you should never put in your code because they can be readily exploited unless you carefully parse the incoming string parameter. The problem in both cases is causes by concatenation rather than binding. The first example is extremely unlikely as an error but possible.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">CREATE</span> <span style="color: #990099; font-weight: bold;">PROCEDURE</span> hello <span style="color: #FF00FF;">&#40;</span><span style="color: #990099; font-weight: bold;">IN</span> pv_input <span style="color: #999900; font-weight: bold;">VARCHAR</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">50</span><span style="color: #FF00FF;">&#41;</span><span style="color: #FF00FF;">&#41;</span>
<span style="color: #990099; font-weight: bold;">BEGIN</span>
  <span style="color: #990099; font-weight: bold;">SET</span> @sql <span style="color: #CC0099;">:=</span> <span style="color: #000099;">CONCAT</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008000;">'SELECT sample<span style="color: #008080; font-weight: bold;">_</span>id, sample<span style="color: #008080; font-weight: bold;">_</span>name FROM sample WHERE sample<span style="color: #008080; font-weight: bold;">_</span>name = '</span><span style="color: #000033;">,</span>pv_input<span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">;</span>
  PREPARE stmt <span style="color: #990099; font-weight: bold;">FROM</span> @sql<span style="color: #000033;">;</span>
  EXECUTE stmt<span style="color: #000033;">;</span>
<span style="color: #009900;">END</span><span style="color: #000033;">;</span>
$$</pre></td></tr></table></div>

<p>The last <code>hello</code> procedure using concatenation and a prepared statement is vulnerable to SQL injection. A call like the following would return all two rows in the <code>sample</code> table.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">CALL</span> hello<span style="color: #FF00FF;">&#40;</span><span style="color: #008000;">'<span style="color: #004000; font-weight: bold;">\'</span>Juliette<span style="color: #004000; font-weight: bold;">\'</span> OR 1 = 1'</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">;</span></pre></td></tr></table></div>

<p>It would display:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="text" style="font-family:monospace;">+-----------+-------------+
| sample_id | sample_name |
+-----------+-------------+
|         1 | Hank        |
|         2 | Harriet     |
+-----------+-------------+
2 rows in set (0.00 sec)</pre></td></tr></table></div>

<p>While there&#8217;s no <code>sample_name</code> value of <code>'Juliette'</code>, the &#8220;<code>OR 1 = 1</code>&#8221; is true. Therefore, the <code>SELECT</code> statement filters out nothing and returns all the data from the table. It&#8217;s probably clear you&#8217;d never do this type of prepared statement inside a stored procedure, but most SQL Injection attacks exploit your scripting language implementation. Unfortunately, bad coding practices can infrequently expose this type of vulnerability; and they typically occur when a junior programmers is following a bad coding example.</p>
<p>A solution with the <code>WHERE</code> clause as part of the parameter would look like this:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">CREATE</span> <span style="color: #990099; font-weight: bold;">PROCEDURE</span> hello <span style="color: #FF00FF;">&#40;</span><span style="color: #990099; font-weight: bold;">IN</span> pv_where <span style="color: #999900; font-weight: bold;">VARCHAR</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">50</span><span style="color: #FF00FF;">&#41;</span><span style="color: #FF00FF;">&#41;</span>
<span style="color: #990099; font-weight: bold;">BEGIN</span>
  <span style="color: #990099; font-weight: bold;">SELECT</span> sample_id
  <span style="color: #000033;">,</span>      sample_name
  <span style="color: #990099; font-weight: bold;">FROM</span>   sample
  pv_where<span style="color: #000033;">;</span>
<span style="color: #009900;">END</span><span style="color: #000033;">;</span>
$$</pre></td></tr></table></div>

<p>The modified call:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">CALL</span> hello<span style="color: #FF00FF;">&#40;</span><span style="color: #008000;">'WHERE sample<span style="color: #008080; font-weight: bold;">_</span>name = <span style="color: #004000; font-weight: bold;">\'</span>Juliette<span style="color: #004000; font-weight: bold;">\'</span> OR 1 = 1'</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">;</span></pre></td></tr></table></div>

<p>returns all rows from the table.</p>
<p>A solution without the <code>WHERE</code> clause as part of the parameter would look like the following but it fails during runtime and returns no rows <span style="color:blue">[Updated in response to comment]</span>. The failure has nothing to do with the comment&#8217;s dialog on the <code>CONCAT</code> function, which also added nothing to the example once I tested it.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">CREATE</span> <span style="color: #990099; font-weight: bold;">PROCEDURE</span> hello <span style="color: #FF00FF;">&#40;</span><span style="color: #990099; font-weight: bold;">IN</span> pv_where <span style="color: #999900; font-weight: bold;">VARCHAR</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">50</span><span style="color: #FF00FF;">&#41;</span><span style="color: #FF00FF;">&#41;</span>
<span style="color: #990099; font-weight: bold;">BEGIN</span>
  <span style="color: #990099; font-weight: bold;">SELECT</span> sample_id
  <span style="color: #000033;">,</span>      sample_name
  <span style="color: #990099; font-weight: bold;">FROM</span>   sample
  <span style="color: #990099; font-weight: bold;">WHERE</span>  pv_where<span style="color: #000033;">;</span>
<span style="color: #009900;">END</span><span style="color: #000033;">;</span>
$$</pre></td></tr></table></div>

<p>It&#8217;s simply works only when you provide a &#8220;1 = 1&#8243; or other comparison without embedded apostrophes (&#8216;) but fails with embedded apostrophes. That means the following statement fails:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">CALL</span> hello<span style="color: #FF00FF;">&#40;</span><span style="color: #008000;">'sample<span style="color: #008080; font-weight: bold;">_</span>name = <span style="color: #004000; font-weight: bold;">\'</span>Juliette<span style="color: #004000; font-weight: bold;">\'</span> OR 1 = 1'</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">;</span></pre></td></tr></table></div>

<p>but this SQL injection statement works:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">CALL</span> hello<span style="color: #FF00FF;">&#40;</span><span style="color: #008000;">'1 = 1'</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">;</span></pre></td></tr></table></div>

<p>returns all rows from the table.</p>
<p>This example, when you omit the white space also works with embedded strings or numeric operands and an operator:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">CREATE</span> <span style="color: #990099; font-weight: bold;">PROCEDURE</span> hello <span style="color: #FF00FF;">&#40;</span><span style="color: #990099; font-weight: bold;">IN</span> pv_where <span style="color: #999900; font-weight: bold;">VARCHAR</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">50</span><span style="color: #FF00FF;">&#41;</span><span style="color: #FF00FF;">&#41;</span>
<span style="color: #990099; font-weight: bold;">BEGIN</span>
  <span style="color: #990099; font-weight: bold;">SELECT</span> sample_id
  <span style="color: #000033;">,</span>      sample_name
  <span style="color: #990099; font-weight: bold;">FROM</span>   sample
  WHEREpv_where<span style="color: #000033;">;</span>
<span style="color: #009900;">END</span><span style="color: #000033;">;</span>
$$</pre></td></tr></table></div>

<p>It returns all rows with a call like this:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">CALL</span> hello<span style="color: #FF00FF;">&#40;</span><span style="color: #008000;">'sample<span style="color: #008080; font-weight: bold;">_</span>name = <span style="color: #004000; font-weight: bold;">\'</span>Juliette<span style="color: #004000; font-weight: bold;">\'</span> OR 1 = 1'</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">;</span></pre></td></tr></table></div>

<p>My take initially was that it might be a bug, and I logged one (Bug 68903). That&#8217;s was a dumb thing to do because <code>WHEREpv_where</code> simply becomes a table alias in the query.</p>
<p>In conclusion, the first example is a good practice. The other two should never exist! Well, they shouldn&#8217;t exist unless you&#8217;re parsing the web form inputs vigilantly.</p>
<p>Hope this helps those trying to understand how to avoid SQL injection attacks. Always try to solve dynamic SQL statement problems by binding variables into statements.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mclaughlinsoftware.com/2013/04/05/sql-injection-risks/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Conflict between identifiers</title>
		<link>http://blog.mclaughlinsoftware.com/2013/03/30/conflict-between-identifiers/</link>
		<comments>http://blog.mclaughlinsoftware.com/2013/03/30/conflict-between-identifiers/#comments</comments>
		<pubDate>Sun, 31 Mar 2013 05:34:09 +0000</pubDate>
		<dc:creator>maclochlainn</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Oracle 11g]]></category>
		<category><![CDATA[pl/sql]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://blog.mclaughlinsoftware.com/?p=7539</guid>
		<description><![CDATA[Sometimes interesting problems lead to shock or dismay at the suppositions of why they occur. Why an ORA-22979 is raised is one of those, and the error is typically: ERROR at line 1: ORA-22979: cannot INSERT object VIEW REF OR user-defined REF This error occurs on an INSERT statement if you follow the example from [...]]]></description>
				<content:encoded><![CDATA[<p>Sometimes interesting problems lead to shock or dismay at the suppositions of why they occur. Why an <code>ORA-22979</code> is raised is one of those, and the error is typically:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="sql" style="font-family:monospace;">ERROR at line <span style="color: #cc66cc;">1</span>:
ORA<span style="color: #66cc66;">-</span><span style="color: #cc66cc;">22979</span>: cannot <span style="color: #993333; font-weight: bold;">INSERT</span> object <span style="color: #993333; font-weight: bold;">VIEW</span> <span style="color: #993333; font-weight: bold;">REF</span> <span style="color: #993333; font-weight: bold;">OR</span> user<span style="color: #66cc66;">-</span>defined <span style="color: #993333; font-weight: bold;">REF</span></pre></td></tr></table></div>

<p>This error occurs on an <code>INSERT</code> statement if you follow the example from the Oracle 11<em>g</em>R2 Object-Relational Developer&#8217;s Guide, which also has various slightly modified examples in a couple PL/SQL books. It also happens on an <code>UPDATE</code> statement to populate <code>REF</code> values.</p>
<p>The conflict is typically between the uniqueness of the reference and an attempt to make a <em>non-reference</em> column of the object type a primary key constrained column and embedded object view. The source of the conflict is the <code>OBJECT IDENTIFIER IS PRIMARY KEY</code> associated with a primary key in the Oracle documentation. The two goals are mutually exclusive; only the reference or non-reference column can be the <em>object identifier</em>. Unfortunately, Oracle documentation contains both examples in different places without making any effective cross reference.</p>
<p>If you want to make a column of an object type a primary key for an object table (that is a table that uses an object type to define its structure) and the object view (the content of the embedded object type), you can&#8217;t include the <code>OBJECT IDENTIFIER IS PRIMARY KEY</code> clause when you want to populate the <code>REF</code> column of the object type. Here&#8217;s an example that uses a column of the object type as a primary key and leaves the <code>REF</code> column empty:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">-- Create the BASE_T type, or specification for IDL.</span>
<span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">OR</span> <span style="color: #993333; font-weight: bold;">REPLACE</span>
  <span style="color: #993333; font-weight: bold;">TYPE</span> base_t <span style="color: #993333; font-weight: bold;">IS</span> OBJECT
  <span style="color: #66cc66;">&#40;</span> obj_id    <span style="color: #993333; font-weight: bold;">NUMBER</span>
  <span style="color: #66cc66;">,</span> obj_name  VARCHAR2<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">30</span><span style="color: #66cc66;">&#41;</span>
  <span style="color: #66cc66;">,</span> obj_ref   <span style="color: #993333; font-weight: bold;">REF</span> base_t<span style="color: #66cc66;">&#41;</span>
  <span style="color: #993333; font-weight: bold;">NOT</span> FINAL;
<span style="color: #66cc66;">/</span></pre></td></tr></table></div>

<p>You can then create a table like the following:</p>

<div class="wp_syntax"><table><tr><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;">TABLE</span> base <span style="color: #993333; font-weight: bold;">OF</span> base_t
<span style="color: #66cc66;">&#40;</span> obj_id <span style="color: #993333; font-weight: bold;">CONSTRAINT</span> base_pk <span style="color: #993333; font-weight: bold;">PRIMARY</span> <span style="color: #993333; font-weight: bold;">KEY</span> <span style="color: #66cc66;">&#41;</span>
  OBJECT IDENTIFIER <span style="color: #993333; font-weight: bold;">IS</span> <span style="color: #993333; font-weight: bold;">PRIMARY</span> <span style="color: #993333; font-weight: bold;">KEY</span>;</pre></td></tr></table></div>

<p>Let&#8217;s insert some rows to test for ourselves that this fails when you try to assign references:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> base <span style="color: #993333; font-weight: bold;">VALUES</span> <span style="color: #66cc66;">&#40;</span>base_t<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'Dwalin'</span><span style="color: #66cc66;">,</span><span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> base <span style="color: #993333; font-weight: bold;">VALUES</span> <span style="color: #66cc66;">&#40;</span>base_t<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">2</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'Borfur'</span><span style="color: #66cc66;">,</span><span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> base <span style="color: #993333; font-weight: bold;">VALUES</span> <span style="color: #66cc66;">&#40;</span>base_t<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">3</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'Gloin'</span><span style="color: #66cc66;">,</span><span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> base <span style="color: #993333; font-weight: bold;">VALUES</span> <span style="color: #66cc66;">&#40;</span>base_t<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">4</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'Kili'</span><span style="color: #66cc66;">,</span><span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> base <span style="color: #993333; font-weight: bold;">VALUES</span> <span style="color: #66cc66;">&#40;</span>base_t<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">5</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'Fili'</span><span style="color: #66cc66;">,</span><span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</pre></td></tr></table></div>

<p>The following <code>UPDATE</code> statement attempts to assign references, but fails as shown below:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">UPDATE</span>   base b
<span style="color: #993333; font-weight: bold;">SET</span>      obj_ref <span style="color: #66cc66;">=</span> <span style="color: #993333; font-weight: bold;">REF</span><span style="color: #66cc66;">&#40;</span>b<span style="color: #66cc66;">&#41;</span>;</pre></td></tr></table></div>

<p>The <code>UPDATE</code> fails as shown:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">UPDATE</span>   base b
         <span style="color: #66cc66;">*</span>
ERROR at line <span style="color: #cc66cc;">1</span>:
ORA<span style="color: #66cc66;">-</span><span style="color: #cc66cc;">22979</span>: cannot <span style="color: #993333; font-weight: bold;">INSERT</span> object <span style="color: #993333; font-weight: bold;">VIEW</span> <span style="color: #993333; font-weight: bold;">REF</span> <span style="color: #993333; font-weight: bold;">OR</span> user<span style="color: #66cc66;">-</span>defined <span style="color: #993333; font-weight: bold;">REF</span></pre></td></tr></table></div>

<p>The simple fix redefines the object table by removing the <code>OBJ_ID</code> column as an <em>object identifier</em> and primary key value. You do that by removing the <code>OBJECT IDENTIFIER IS PRIMARY KEY</code> clause because the column of the object type can be a primary key for the table without being an object view identifier. After you make the change, you can successfully update the table with object references. Object identifiers or references are unique and serve the same purpose of a primary key for the object view, and at the same time they can&#8217;t both exist.</p>

<div class="wp_syntax"><table><tr><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;">TABLE</span> base <span style="color: #993333; font-weight: bold;">OF</span> base_t</pre></td></tr></table></div>

<p>Inserting the same rows, you can now update the table to provide valid object references. Let&#8217;s experiment with how they work because that&#8217;s also not as clear as I&#8217;d like in the Oracle documentation.</p>
<p>The next statement creates a <code>CHILD</code> table that holds a reference to the <code>BASE</code> (or parent) table and another instance of the same <code>BASE_T</code> object type:</p>

<div class="wp_syntax"><table><tr><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;">TABLE</span> child
<span style="color: #66cc66;">&#40;</span> child_id   <span style="color: #993333; font-weight: bold;">NUMBER</span>  <span style="color: #993333; font-weight: bold;">CONSTRAINT</span> child_pk <span style="color: #993333; font-weight: bold;">PRIMARY</span> <span style="color: #993333; font-weight: bold;">KEY</span>
<span style="color: #66cc66;">,</span> base_ref   <span style="color: #993333; font-weight: bold;">REF</span> base_t SCOPE <span style="color: #993333; font-weight: bold;">IS</span> base
<span style="color: #66cc66;">,</span> child      base_t<span style="color: #66cc66;">&#41;</span>;</pre></td></tr></table></div>

<p>The <code>INSERT</code> statement can&#8217;t use a <code>VALUES</code> clause because we <strong><em>MUST</em></strong> capture the reference (or in this case primary key) from the <code>BASE</code> (or parent) table. An <code>INSERT</code> statement with a query does the trick:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> child 
<span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> obj_ref<span style="color: #66cc66;">,</span> base_t<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'Gimli'</span><span style="color: #66cc66;">,</span><span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #993333; font-weight: bold;">FROM</span>   base b
<span style="color: #993333; font-weight: bold;">WHERE</span>  b<span style="color: #66cc66;">.</span>obj_name <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'Gloin'</span>;</pre></td></tr></table></div>

<p>You should note that the reference for the <code>CHILD</code> table&#8217;s <code>CHILD</code> column isn&#8217;t set but is likewise not required for the example to work.</p>
<p>Now, lets perform an standard <code>INNER JOIN</code> (equijoin) between the two tables by using the references as primary and foreign keys. Please note the trick is referring to the <em>table and column of the <code>BASE</code> (or parent) table</em> and the <em>table, column, and embedded <code>OBJ_REF</code> of the CHILD table</em>.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">COLUMN</span> father FORMAT A10
<span style="color: #993333; font-weight: bold;">COLUMN</span> son    FORMAT A10
<span style="color: #993333; font-weight: bold;">SELECT</span>   b<span style="color: #66cc66;">.</span>obj_name <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #ff0000;">&quot;Father&quot;</span>
<span style="color: #66cc66;">,</span>        c<span style="color: #66cc66;">.</span>child<span style="color: #66cc66;">.</span>obj_name <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #ff0000;">&quot;Son&quot;</span>
<span style="color: #993333; font-weight: bold;">FROM</span>     base b <span style="color: #993333; font-weight: bold;">INNER</span> <span style="color: #993333; font-weight: bold;">JOIN</span> child c <span style="color: #993333; font-weight: bold;">ON</span> b<span style="color: #66cc66;">.</span>obj_ref <span style="color: #66cc66;">=</span> c<span style="color: #66cc66;">.</span>base_ref<span style="color: #66cc66;">.</span>obj_ref;</pre></td></tr></table></div>

<p>You get the following results:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="text" style="font-family:monospace;">Father     Son
---------- ----------
Gloin      Gimli</pre></td></tr></table></div>

<p>You can make a view of this table with either of these syntaxes:</p>

<div class="wp_syntax"><table><tr><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;">OR</span> <span style="color: #993333; font-weight: bold;">REPLACE</span> <span style="color: #993333; font-weight: bold;">VIEW</span> base_v <span style="color: #993333; font-weight: bold;">OF</span> base_t <span style="color: #993333; font-weight: bold;">WITH</span> OBJECT OID <span style="color: #993333; font-weight: bold;">DEFAULT</span> <span style="color: #993333; font-weight: bold;">AS</span>
<span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #66cc66;">*</span> <span style="color: #993333; font-weight: bold;">FROM</span> base;</pre></td></tr></table></div>

<p>or,</p>

<div class="wp_syntax"><table><tr><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;">OR</span> <span style="color: #993333; font-weight: bold;">REPLACE</span> <span style="color: #993333; font-weight: bold;">VIEW</span> base_v <span style="color: #993333; font-weight: bold;">OF</span> base_t <span style="color: #993333; font-weight: bold;">WITH</span> OBJECT OID <span style="color: #66cc66;">&#40;</span>obj_id<span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span>
<span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #66cc66;">*</span> <span style="color: #993333; font-weight: bold;">FROM</span> base;</pre></td></tr></table></div>

<p>Hope it helps anybody trying it. Personally, I think it&#8217;s better to use collections of object types, but that&#8217;s much bigger discussion that I&#8217;ll save for the Oracle Database 12<em>c</em> PL/SQL Programming book that I&#8217;m writing.  </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mclaughlinsoftware.com/2013/03/30/conflict-between-identifiers/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Object Table Function View</title>
		<link>http://blog.mclaughlinsoftware.com/2013/03/17/object-table-function-view/</link>
		<comments>http://blog.mclaughlinsoftware.com/2013/03/17/object-table-function-view/#comments</comments>
		<pubDate>Mon, 18 Mar 2013 04:59:48 +0000</pubDate>
		<dc:creator>maclochlainn</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Oracle 11g]]></category>
		<category><![CDATA[Oracle 12c]]></category>
		<category><![CDATA[Oracle XE]]></category>
		<category><![CDATA[pl/sql]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://blog.mclaughlinsoftware.com/?p=7520</guid>
		<description><![CDATA[Somebody was trying to create a striped view based on a table&#8217;s start_date and end_date temporal columns. They asked for some help, so here are the steps. Basically, you create a user-defined data type, or structure: 1 2 3 4 CREATE OR REPLACE TYPE item_structure IS OBJECT &#40; id NUMBER , lookup VARCHAR2&#40;30&#41;&#41;; / Then, [...]]]></description>
				<content:encoded><![CDATA[<p>Somebody was trying to create a striped view based on a table&#8217;s <code>start_date</code> and <code>end_date</code> temporal columns. They asked for some help, so here are the steps.</p>
<p>Basically, you create a user-defined data type, or structure:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</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;">OR</span> <span style="color: #993333; font-weight: bold;">REPLACE</span> <span style="color: #993333; font-weight: bold;">TYPE</span> item_structure <span style="color: #993333; font-weight: bold;">IS</span> OBJECT
<span style="color: #66cc66;">&#40;</span> id      <span style="color: #993333; font-weight: bold;">NUMBER</span>
<span style="color: #66cc66;">,</span> lookup  VARCHAR2<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">30</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">/</span></pre></td></tr></table></div>

<p>Then, you create a list (an Oracle table) of the structure, like:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</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;">OR</span> <span style="color: #993333; font-weight: bold;">REPLACE</span> <span style="color: #993333; font-weight: bold;">TYPE</span> item_lookup <span style="color: #993333; font-weight: bold;">IS</span> <span style="color: #993333; font-weight: bold;">TABLE</span> <span style="color: #993333; font-weight: bold;">OF</span> item_structure;
<span style="color: #66cc66;">/</span></pre></td></tr></table></div>

<p>Lastly, you create an object table function, like:</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
29
30
31
32
33
34
35
36
37
38
39
</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;">OR</span> <span style="color: #993333; font-weight: bold;">REPLACE</span> <span style="color: #993333; font-weight: bold;">FUNCTION</span> get_item_types <span style="color: #993333; font-weight: bold;">RETURN</span> item_lookup <span style="color: #993333; font-weight: bold;">IS</span>
&nbsp;
  <span style="color: #808080; font-style: italic;">-- Declare a variable that uses the record structure.</span>
  lv_counter      PLS_INTEGER :<span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">1</span>;
&nbsp;
  <span style="color: #808080; font-style: italic;">-- Declare a variable that uses the record structure.</span>
  lv_lookup_table  ITEM_LOOKUP :<span style="color: #66cc66;">=</span> item_lookup<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
  <span style="color: #808080; font-style: italic;">-- Declare static cursor structure.</span>
  CURSOR c <span style="color: #993333; font-weight: bold;">IS</span>
    <span style="color: #993333; font-weight: bold;">SELECT</span>   cl<span style="color: #66cc66;">.</span>common_lookup_id <span style="color: #993333; font-weight: bold;">AS</span> lookup_id
    <span style="color: #66cc66;">,</span>        SUBSTR<span style="color: #66cc66;">&#40;</span>cl<span style="color: #66cc66;">.</span>common_lookup_meaning<span style="color: #66cc66;">,</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span><span style="color: #cc66cc;">60</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> lookup_meaning
    <span style="color: #993333; font-weight: bold;">FROM</span>     common_lookup cl
    <span style="color: #993333; font-weight: bold;">WHERE</span>    cl<span style="color: #66cc66;">.</span>common_lookup_table <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'ITEM'</span>
    <span style="color: #993333; font-weight: bold;">AND</span>      cl<span style="color: #66cc66;">.</span>common_lookup_column <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'ITEM_TYPE'</span>
    <span style="color: #993333; font-weight: bold;">AND</span>      SYSDATE <span style="color: #993333; font-weight: bold;">BETWEEN</span> cl<span style="color: #66cc66;">.</span>start_date <span style="color: #993333; font-weight: bold;">AND</span> NVL<span style="color: #66cc66;">&#40;</span>cl<span style="color: #66cc66;">.</span>end_date<span style="color: #66cc66;">,</span>TRUNC<span style="color: #66cc66;">&#40;</span>SYSDATE<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">+</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #993333; font-weight: bold;">ORDER</span> <span style="color: #993333; font-weight: bold;">BY</span> cl<span style="color: #66cc66;">.</span>common_lookup_meaning;
&nbsp;
<span style="color: #993333; font-weight: bold;">BEGIN</span>
&nbsp;
  <span style="color: #993333; font-weight: bold;">FOR</span> i <span style="color: #993333; font-weight: bold;">IN</span> c LOOP
    lv_lookup_table<span style="color: #66cc66;">.</span>EXTEND;
&nbsp;
    <span style="color: #808080; font-style: italic;">/* The assignment pattern for a SQL collection is incompatible with
       the cursor return type, and you must construct an instance of the
       object type before assigning it to a collection. */</span>
    lv_lookup_table<span style="color: #66cc66;">&#40;</span>lv_counter<span style="color: #66cc66;">&#41;</span> :<span style="color: #66cc66;">=</span> item_structure<span style="color: #66cc66;">&#40;</span> i<span style="color: #66cc66;">.</span>lookup_id
                                                 <span style="color: #66cc66;">,</span> i<span style="color: #66cc66;">.</span>lookup_meaning <span style="color: #66cc66;">&#41;</span>;
&nbsp;
    lv_counter :<span style="color: #66cc66;">=</span> lv_counter <span style="color: #66cc66;">+</span> <span style="color: #cc66cc;">1</span>;
  <span style="color: #993333; font-weight: bold;">END</span> LOOP;
&nbsp;
  <span style="color: #808080; font-style: italic;">/* Call an autonomous function or procedure here! It would allow you to
     capture who queried what and when; and acts like a pseudo trigger for
     queries. */</span>
&nbsp;
  <span style="color: #993333; font-weight: bold;">RETURN</span> lv_lookup_table;
<span style="color: #993333; font-weight: bold;">END</span>;
<span style="color: #66cc66;">/</span></pre></td></tr></table></div>

<p>Now you can embed the object table function in a view, like this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</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;">OR</span> <span style="color: #993333; font-weight: bold;">REPLACE</span> <span style="color: #993333; font-weight: bold;">VIEW</span> item_lookup_view <span style="color: #993333; font-weight: bold;">AS</span>
  <span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #66cc66;">*</span>
  <span style="color: #993333; font-weight: bold;">FROM</span>   <span style="color: #993333; font-weight: bold;">TABLE</span><span style="color: #66cc66;">&#40;</span>get_item_types<span style="color: #66cc66;">&#41;</span>;</pre></td></tr></table></div>

<p>Why not simply use an embedded query in the view, like the following?</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="sql" style="font-family:monospace;">SQL<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">OR</span> <span style="color: #993333; font-weight: bold;">REPLACE</span> <span style="color: #993333; font-weight: bold;">VIEW</span> normal_view <span style="color: #993333; font-weight: bold;">AS</span>
  <span style="color: #cc66cc;">2</span>    <span style="color: #993333; font-weight: bold;">SELECT</span>   cl<span style="color: #66cc66;">.</span>common_lookup_id <span style="color: #993333; font-weight: bold;">AS</span> lookup_id
  <span style="color: #cc66cc;">3</span>      <span style="color: #66cc66;">,</span>        SUBSTR<span style="color: #66cc66;">&#40;</span>cl<span style="color: #66cc66;">.</span>common_lookup_meaning<span style="color: #66cc66;">,</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span><span style="color: #cc66cc;">60</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> lookup_meaning
  <span style="color: #cc66cc;">4</span>      <span style="color: #993333; font-weight: bold;">FROM</span>     common_lookup cl
  <span style="color: #cc66cc;">5</span>      <span style="color: #993333; font-weight: bold;">WHERE</span>    cl<span style="color: #66cc66;">.</span>common_lookup_table <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'ITEM'</span>
  <span style="color: #cc66cc;">6</span>      <span style="color: #993333; font-weight: bold;">AND</span>      cl<span style="color: #66cc66;">.</span>common_lookup_column <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'ITEM_TYPE'</span>
  <span style="color: #cc66cc;">7</span>      <span style="color: #993333; font-weight: bold;">AND</span>      SYSDATE <span style="color: #993333; font-weight: bold;">BETWEEN</span> cl<span style="color: #66cc66;">.</span>start_date <span style="color: #993333; font-weight: bold;">AND</span> NVL<span style="color: #66cc66;">&#40;</span>cl<span style="color: #66cc66;">.</span>end_date<span style="color: #66cc66;">,</span>TRUNC<span style="color: #66cc66;">&#40;</span>SYSDATE<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">+</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>
  <span style="color: #cc66cc;">8</span>      <span style="color: #993333; font-weight: bold;">ORDER</span> <span style="color: #993333; font-weight: bold;">BY</span> cl<span style="color: #66cc66;">.</span>common_lookup_meaning;</pre></td></tr></table></div>

<p>My guess is that it was too easy but who knows, maybe they found a real need. The only need that I see occurs when you&#8217;re enforcing something like HIPPA and you want to capture unauthorized queries along with who performed them.</p>
<p>Naturally, I hope this helps those looking to resolve syntax errors when they have a need to do the more complex solution.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mclaughlinsoftware.com/2013/03/17/object-table-function-view/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle Passwords</title>
		<link>http://blog.mclaughlinsoftware.com/2013/03/12/oracle-recommends-passwords/</link>
		<comments>http://blog.mclaughlinsoftware.com/2013/03/12/oracle-recommends-passwords/#comments</comments>
		<pubDate>Tue, 12 Mar 2013 20:20:54 +0000</pubDate>
		<dc:creator>maclochlainn</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Oracle 11g]]></category>
		<category><![CDATA[Oracle 12c]]></category>
		<category><![CDATA[Oracle Installer]]></category>
		<category><![CDATA[Oracle XE]]></category>

		<guid isPermaLink="false">http://blog.mclaughlinsoftware.com/?p=7509</guid>
		<description><![CDATA[It&#8217;s funny but Oracle doesn&#8217;t want you to enter a trivial password, and about every week I get asked what the standards are for Oracle Database passwords. That&#8217;s funny too because it&#8217;s in the documentation, the one most experienced and new users never read &#8211; Oracle Database Installation Guide (available by platform, the link is [...]]]></description>
				<content:encoded><![CDATA[<p>It&#8217;s funny but Oracle doesn&#8217;t want you to enter a trivial password, and about every week I get asked what the standards are for Oracle Database passwords. That&#8217;s funny too because it&#8217;s in the documentation, the one most experienced and new users never read &#8211; <a href="http://docs.oracle.com/cd/E11882_01/install.112/e24186/toc.htm">Oracle Database Installation Guide</a> (available by platform, the link is for the Windows platform).</p>
<p>Anyway, let me quote the rules:</p>
<p>Oracle recommends that the password you specify:</p>
<ul>
<li>Contains at least one lowercase letter.</li>
<li>Contains at least one uppercase letter.</li>
<li>Contains at least one digit.</li>
<li>Is at least 8 characters in length.</li>
<li>Uses the database character set which can include the underscore (_), dollar ($), and pound sign (#) character.</li>
<li>If (the password) contains special characters, including beginning the password with a number or symbol, then enclose the password with double-quotation marks.</li>
<li>Should not be an actual word.</li>
</ul>
<p>Likewise, you can&#8217;t use the old educational passwords:</p>
<ul>
<li>The <code>SYS</code> account password cannot be <code>change_on_install</code> (case-insensitive).</li>
<li>The <code>SYSTEM</code> account password cannot be <code>manager</code> (case-insensitive).</li>
<li>The <code>SYSMAN</code> account password cannot be <code>sysman</code> (case-insensitive).</li>
<li>The <code>DBSNMP</code> account password cannot be <code>dbsnmp</code> (case-insensitive).</li>
<li>If you choose to use the same password for all the accounts, then that password cannot be <code>change_on_install</code>, <code>manager</code>, <code>sysman</code>, or <code>dbsnmp</code> (case-insensitive).</li>
</ul>
<p>Hope this helps, and by the way reading the documentation never hurts too much! <img src='http://blog.mclaughlinsoftware.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mclaughlinsoftware.com/2013/03/12/oracle-recommends-passwords/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Speaking at UTOUG</title>
		<link>http://blog.mclaughlinsoftware.com/2013/03/12/speaking-at-utoug/</link>
		<comments>http://blog.mclaughlinsoftware.com/2013/03/12/speaking-at-utoug/#comments</comments>
		<pubDate>Tue, 12 Mar 2013 18:49:05 +0000</pubDate>
		<dc:creator>maclochlainn</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://blog.mclaughlinsoftware.com/?p=7502</guid>
		<description><![CDATA[I&#8217;m off to speak at the Utah Oracle User&#8217;s Group Training Days 2013 tomorrow and Thursday. I&#8217;m presenting on Oracle Database Triggers and on techniques leveraging PHP and MySQL Striped Views. If you&#8217;re not there, you can check this older (but recently updated) post on PHP and MySQL Striped Views. Hope to see a few [...]]]></description>
				<content:encoded><![CDATA[<p><img src="https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcTUHJHxc0bXB8q9NWp6DYoH26vZf6_AstDtvKlOiotOGQWgxlOHoQ"></p>
<p>I&#8217;m off to speak at the Utah Oracle User&#8217;s Group Training Days 2013 tomorrow and Thursday. I&#8217;m presenting on Oracle Database Triggers and on techniques leveraging PHP and MySQL Striped Views. If you&#8217;re not there, you can check this older (but recently updated) post on <a href="http://blog.mclaughlinsoftware.com/2012/07/16/php-for-mysql-striped-view/">PHP and MySQL Striped Views</a>.</p>
<p>Hope to see a few folks who use the blog. BTW, I won&#8217;t be at Collaborate 2013 this year. Travel budgets are always tight, and this year they&#8217;re more than tight. <img src='http://blog.mclaughlinsoftware.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mclaughlinsoftware.com/2013/03/12/speaking-at-utoug/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>The Good, Bad, &amp; Ugly</title>
		<link>http://blog.mclaughlinsoftware.com/2013/03/01/the-good-bad-ugly/</link>
		<comments>http://blog.mclaughlinsoftware.com/2013/03/01/the-good-bad-ugly/#comments</comments>
		<pubDate>Sat, 02 Mar 2013 00:11:27 +0000</pubDate>
		<dc:creator>maclochlainn</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Oracle 12c]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">http://blog.mclaughlinsoftware.com/?p=7460</guid>
		<description><![CDATA[My take on the good, the bad, and the ugly of our Winter season, beside all the snow I&#8217;ve shoveled and blown to get in and out of my driveway, is: The Good? February brought us MySQL 5.6 GA (General Availability) and Ruby 2.0.0-p0. Mega thanks to the MySQL and Ruby teams! By the way, [...]]]></description>
				<content:encoded><![CDATA[<p>My take on the good, the bad, and the ugly of our Winter season, beside all the snow I&#8217;ve shoveled and blown to get in and out of my driveway, is:</p>
<p><strong><em>The Good?</em></strong></p>
<p>February brought us <a href="http://dev.mysql.com/tech-resources/articles/mysql-5.6.html">MySQL 5.6 GA (General Availability)</a> and <a href="http://www.ruby-lang.org/en/news/2013/02/24/ruby-2-0-0-p0-is-released/">Ruby 2.0.0-p0</a>. <span style="color:blue"><em><strong>Mega thanks to the MySQL and Ruby teams!</strong></em></span> By the way, if you&#8217;ve always wanted to know a little about Ruby without a great deal of effort, you should check this awesome <a href="http://www.ruby-lang.org/en/documentation/quickstart/">little 20 minute Ruby tutorial</a>. Naturally, the best <a href="http://www.amazon.com/gp/product/0596516177/ref=as_li_tf_tl?ie=UTF8&#038;camp=1789&#038;creative=9325&#038;creativeASIN=0596516177&#038;linkCode=as2&#038;tag=macloc-20">Ruby Programming book</a><img src="http://www.assoc-amazon.com/e/ir?t=macloc-20&#038;l=as2&#038;o=1&#038;a=0596516177" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /> is a bit dated, and maybe there will be a new one later in the year. If anybody knows whether there&#8217;s a new edition forthcoming, I&#8217;d appreciate hearing about it! Another more current, Ruby 1.9, book is <a href="http://www.amazon.com/gp/product/1934356085/ref=as_li_tf_tl?ie=UTF8&#038;camp=1789&#038;creative=9325&#038;creativeASIN=1934356085&#038;linkCode=as2&#038;tag=macloc-20">Programming Ruby 1.9: The Pragmatic Programmers&#8217; Guide</a><img src="http://www.assoc-amazon.com/e/ir?t=macloc-20&#038;l=as2&#038;o=1&#038;a=1934356085" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />.</p>
<p><strong><em>The Bad?</em></strong></p>
<p>It seems like a lot of folks who implemented <a href="http://office.microsoft.com/en-us/collaboration-software-sharepoint-FX103479517.aspx">Microsoft SharePoint</a> are rapidly preparing to migrate from SharePoint 2010 to 2013, but what&#8217;s unclear is whether they&#8217;re upgrading for the features or bug fixes. It does seem many are opting for the Microsoft cloud services, and rumor has it that&#8217;s because a little collaboration requires a lot of hardware in the data center. It&#8217;s probably a good idea to do some research before <a href="http://www.the14folder.com/2009/12/15/hardware-requirements-for-sharepoint-2010/t" rel="nofollow">implementing Microsoft SharePoint</a>.</p>
<p><em><strong>The Ugly?</strong></em></p>
<p>If NBC got the <a href="http://firstread.nbcnews.com/_news/2013/03/01/17147525-as-meeting-yields-no-breakthrough-obama-blames-dumb-cuts-on-gop">quote right</a> today, President Obama disappointed me by saying, &#8220;&#8230;  I should somehow do a Jedi mind meld with these (republican) folks &#8230;&#8221; How can the President not know that Star Trek Vulcan&#8217;s aren&#8217;t in the Star Wars universe? Worse yet, my disappointment with Peter Jackson returns because he is releasing the <em>theatrical version</em> <a href="http://www.amazon.com/The-Hobbit-Unexpected-Journey-UltraViolet/dp/B00BEZTMWW">The Hobbit: An Unexpected Journey</a> Bluray and DVD on March 19<sup>th</sup> and then an extended version later in the year. Ouch!!! He&#8217;s getting into my wallet again.</p>
<p>Spring starts later this month and the rumor is that Oracle will <a href="http://www.cio.com/article/728072/Oracle_Database_12c_Close_to_General_Release_Sources_Say" rel="nofollow">release Oracle Database 12c</a> soon. Then, we get <a href="http://www.movieinsider.com/m5277/iron-man-3/">Iron Man 3</a>, <a href="http://www.movieinsider.com/m5959/star-trek-sequel/">Star Trek into Darkness</a>, and the <a href="http://www.movieinsider.com/m4676/the-lone-ranger/">Lone Ranger</a>, along with warm weather.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mclaughlinsoftware.com/2013/03/01/the-good-bad-ugly/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
