<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Our Craft</title>
	<atom:link href="http://ourcraft.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://ourcraft.wordpress.com</link>
	<description>Making it better</description>
	<lastBuildDate>Mon, 06 May 2013 19:20:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='ourcraft.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Our Craft</title>
		<link>http://ourcraft.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://ourcraft.wordpress.com/osd.xml" title="Our Craft" />
	<atom:link rel='hub' href='http://ourcraft.wordpress.com/?pushpress=hub'/>
		<item>
		<title>How to put a delay in an Oracle sproc, for testing</title>
		<link>http://ourcraft.wordpress.com/2013/04/11/how-to-put-a-delay-in-an-oracle-sproc-for-testing/</link>
		<comments>http://ourcraft.wordpress.com/2013/04/11/how-to-put-a-delay-in-an-oracle-sproc-for-testing/#comments</comments>
		<pubDate>Thu, 11 Apr 2013 12:22:55 +0000</pubDate>
		<dc:creator>danielmeyer</dc:creator>
				<category><![CDATA[Technical Stuff]]></category>

		<guid isPermaLink="false">http://ourcraft.wordpress.com/?p=2330</guid>
		<description><![CDATA[To simulate your Oracle stored procedure taking 15 minutes to execute, put this in your sproc: dbms_lock.sleep(15 * 60); But first you&#8217;ll need to give your user EXECUTE permissions on the dbms_lock module: C:\&#62;sqlplus sys@clayoracle3 as sysdba ... SQL&#62; GRANT EXECUTE ON dbms_lock TO my_user; Grant succeeded. If you&#8217;re trying this out outside a sproc, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ourcraft.wordpress.com&#038;blog=2431618&#038;post=2330&#038;subd=ourcraft&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>To simulate your Oracle stored procedure taking 15 minutes to execute, put this in your sproc:</p>
<p><code>dbms_lock.sleep(15 * 60);</code></p>
<p>But first you&#8217;ll need to give your user EXECUTE permissions on the dbms_lock module:</p>
<pre>C:\&gt;sqlplus sys@clayoracle3 as sysdba
...
SQL&gt; GRANT EXECUTE ON dbms_lock TO my_user;

Grant succeeded.</pre>
<p>If you&#8217;re trying this out outside a sproc, put an <code>exec</code> on the beginning, thus:</p>
<p><code>exec dbms_lock.sleep(15 * 60);</code></p>
<p>Note: dbms_lock.sleep() <a href="http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:6019886867656">is known to be unreliable past about a 10 minute nap</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ourcraft.wordpress.com/2330/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ourcraft.wordpress.com/2330/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ourcraft.wordpress.com&#038;blog=2431618&#038;post=2330&#038;subd=ourcraft&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ourcraft.wordpress.com/2013/04/11/how-to-put-a-delay-in-an-oracle-sproc-for-testing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/745c1699ef739b13b10b33db744ee804?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">danielmeyer</media:title>
		</media:content>
	</item>
		<item>
		<title>How to put a delay in a SQL Server sproc, for testing</title>
		<link>http://ourcraft.wordpress.com/2013/02/21/how-to-put-a-delay-in-a-sql-server-sproc-for-testing/</link>
		<comments>http://ourcraft.wordpress.com/2013/02/21/how-to-put-a-delay-in-a-sql-server-sproc-for-testing/#comments</comments>
		<pubDate>Thu, 21 Feb 2013 14:27:47 +0000</pubDate>
		<dc:creator>danielmeyer</dc:creator>
				<category><![CDATA[Technical Stuff]]></category>

		<guid isPermaLink="false">http://ourcraft.wordpress.com/?p=2326</guid>
		<description><![CDATA[To simulate your SQL Server stored procedure taking 15 minutes to execute, put this in your sproc: WAITFOR DELAY '00:15'<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ourcraft.wordpress.com&#038;blog=2431618&#038;post=2326&#038;subd=ourcraft&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>To simulate your SQL Server stored procedure taking 15 minutes to execute, put this in your sproc:</p>
<p><code>WAITFOR DELAY '00:15'</code></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ourcraft.wordpress.com/2326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ourcraft.wordpress.com/2326/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ourcraft.wordpress.com&#038;blog=2431618&#038;post=2326&#038;subd=ourcraft&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ourcraft.wordpress.com/2013/02/21/how-to-put-a-delay-in-a-sql-server-sproc-for-testing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/745c1699ef739b13b10b33db744ee804?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">danielmeyer</media:title>
		</media:content>
	</item>
		<item>
		<title>How to spit out a result set returned by an Oracle sproc</title>
		<link>http://ourcraft.wordpress.com/2013/01/18/how-to-spit-out-a-result-set-returned-by-an-oracle-sproc/</link>
		<comments>http://ourcraft.wordpress.com/2013/01/18/how-to-spit-out-a-result-set-returned-by-an-oracle-sproc/#comments</comments>
		<pubDate>Fri, 18 Jan 2013 20:29:03 +0000</pubDate>
		<dc:creator>danielmeyer</dc:creator>
				<category><![CDATA[Technical Stuff]]></category>

		<guid isPermaLink="false">http://ourcraft.wordpress.com/?p=2321</guid>
		<description><![CDATA[When a sproc returns a result set, in Oracle it takes a little more work to view the contents of that result set. But it can be done. Simple example As an example, say you want to call the spir_get_fooids_by_bazidkey sproc which returns a result set of foo ids, and you want to see what [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ourcraft.wordpress.com&#038;blog=2431618&#038;post=2321&#038;subd=ourcraft&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<div>
<p>When a sproc returns a result set, in Oracle it takes a little more work to view the contents of that result set. But it can be done.</p>
<h2 id="HOWTOspitoutaresultsetreturnedbyanOraclesproc-Simpleexample">Simple example</h2>
<p>As an example, say you want to call the <code>spir_get_fooids_by_bazidkey</code> sproc which returns a result set of foo ids, and you want to see what foo ids it returned. Here&#8217;s how that would look:<br />
<span id="more-2321"></span></p>
<div>
<div>
<div>
<div id="highlighter_506251">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<div title="Hint: double-click to select code">
<div><code>DECLARE</code></div>
<div><code>  </code><code>IBAZIDKEY NVARCHAR2(</code><code>200</code><code>);</code></div>
<div><code>  </code><code>OUTPUT_CV ir40_pkg.cur_fooId;</code></div>
<div><code>  </code><code>v_recid RAW(</code><code>32</code><code>);</code></div>
<div><code>BEGIN</code></div>
<div><code>  </code><code>IBAZIDKEY :=   </code><code>'3001125370050120517'</code><code>;</code></div>
<div></div>
<div><code>  </code><code>SPIR_GET_RECIDS_BY_BAZIDKEY(</code></div>
<div><code>    </code><code>IBAZIDKEY =&gt; IBAZIDKEY,</code></div>
<div><code>    </code><code>OUTPUT_CV =&gt; OUTPUT_CV</code></div>
<div><code>  </code><code>);</code></div>
<div><code>  </code></div>
<div><code>  </code><code>--Here's how we loop through a result set cursor</code></div>
<div><code>  </code><code>LOOP</code></div>
<div><code>    </code><code>FETCH OUTPUT_CV</code></div>
<div><code>    </code><code>INTO  v_recid;</code></div>
<div><code>    </code><code>EXIT WHEN output_cv%NOTFOUND;</code></div>
<div><code>    </code><code>DBMS_OUTPUT.PUT_LINE(RAWTOHEX(v_recid));</code></div>
<div><code>  </code><code>END LOOP;</code></div>
<div><code>  </code><code>CLOSE output_cv;</code></div>
<div><code>  </code></div>
<div><code>END;</code></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<h2 id="HOWTOspitoutaresultsetreturnedbyanOraclesproc-Advancedexample">Advanced example</h2>
<p>If the cursor&#8217;s package type has more than one column in it, you can fetch the output cursor into multiple variables and include them in the output. Or better yet, fetch &#8216;em into a package-type variable so that you don&#8217;t have to declare 50 individual variables, like in the following example.</p>
<p>Here&#8217;s an example where the sproc returns five result sets, two of which are large. We fetch one row at a time into a package variable and then print out the columns we care about.</p>
<div>
<div>
<div>
<div id="highlighter_927265">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<div title="Hint: double-click to select code">
<div><code>set serveroutput on</code></div>
<div><code>DECLARE</code></div>
<div><code>  </code><code>IFOOID RAW(</code><code>16</code><code>);</code></div>
<div><code>  </code><code>output_cv                       ir40_pkg.cur_FooMedia;</code></div>
<div><code>  </code><code>output_cv_rel                   ir40_pkg.cur_RelatedFoo;</code></div>
<div><code>  </code><code>output_cv_events                ir40_pkg.cur_FooEvent;</code></div>
<div><code>  </code><code>output_cv_tags                  ir40_pkg.cur_FooTag;</code></div>
<div><code>  </code><code>output_cv_custattrs             ir40_pkg.cur_CustomAttribute;</code></div>
<div><code>  </code><code>v_successcode INTEGER;</code></div>
<div><code>  </code><code>v_recid RAW(</code><code>32</code><code>);</code></div>
<div></div>
<div><code>  </code><code>v_foomedia        ir40_pkg.rec_FooMedia;</code></div>
<div><code>  </code><code>v_rel                   ir40_pkg.rec_RelatedFoo;</code></div>
<div><code>  </code><code>v_events                ir40_pkg.rec_FooEvent;</code></div>
<div><code>  </code><code>v_tags                  ir40_pkg.rec_FooTag;</code></div>
<div><code>  </code><code>v_custattrs             ir40_pkg.rec_CustomAttribute;</code></div>
<div><code>BEGIN</code></div>
<div><code>  </code><code>IFOOID :=   HEXTORAW(</code><code>'12939DFBEF28CFD08F02115D2C560001'</code><code>);</code></div>
<div></div>
<div><code>  </code><code>spir_qry_foo(</code></div>
<div><code>    </code><code>IFOOID =&gt; IFOOID,</code></div>
<div><code>    </code><code>OUTPUT_CV =&gt; OUTPUT_CV,</code></div>
<div><code>    </code><code>OUTPUT_CV_REL =&gt; OUTPUT_CV_REL,</code></div>
<div><code>    </code><code>OUTPUT_CV_EVENTS =&gt; OUTPUT_CV_EVENTS,</code></div>
<div><code>    </code><code>OUTPUT_CV_TAGS =&gt; OUTPUT_CV_TAGS,</code></div>
<div><code>    </code><code>OUTPUT_CV_CUSTATTRS =&gt; OUTPUT_CV_CUSTATTRS,</code></div>
<div><code>    </code><code>oSuccessCode =&gt; v_successcode</code></div>
<div><code>  </code><code>);</code></div>
<div><code>  </code></div>
<div><code>  </code><code>DBMS_OUTPUT.PUT_LINE(</code><code>''</code><code>);</code></div>
<div><code>  </code><code>DBMS_OUTPUT.PUT_LINE(</code><code>'FooMedia data:'</code><code>);</code></div>
<div><code>  </code><code>LOOP</code></div>
<div><code>    </code><code>FETCH OUTPUT_CV</code></div>
<div><code>    </code><code>INTO  v_foomedia;</code></div>
<div><code>    </code><code>EXIT WHEN output_cv%NOTFOUND;</code></div>
<div><code>    </code><code>DBMS_OUTPUT.PUT_LINE(</code><code>'Foo ID:'</code> <code>|| RAWTOHEX(v_foomedia.m_fooid) || </code><code>' FooDate:'</code> <code>|| TO_CHAR(v_foomedia.m_foodate, </code><code>'YYYY-MM-DD HH24:MI:SS'</code><code>) || </code><code>' Duration:'</code> <code>|| v_foomedia.m_Duration);</code></div>
<div><code>  </code><code>END LOOP;</code></div>
<div><code>  </code><code>CLOSE output_cv;</code></div>
<div><code>  </code></div>
<div><code>  </code><code>DBMS_OUTPUT.PUT_LINE(</code><code>''</code><code>);</code></div>
<div><code>  </code><code>DBMS_OUTPUT.PUT_LINE(</code><code>'Related foo data:'</code><code>);</code></div>
<div><code>  </code><code>LOOP</code></div>
<div><code>    </code><code>FETCH OUTPUT_CV_REL</code></div>
<div><code>    </code><code>INTO  v_rel;</code></div>
<div><code>    </code><code>EXIT WHEN output_cv_rel%NOTFOUND;</code></div>
<div><code>    </code><code>DBMS_OUTPUT.PUT_LINE(</code><code>'FooId:'</code> <code>|| RAWTOHEX(v_rel.m_FooId) || </code><code>' MediaType:'</code> <code>|| v_rel.m_MediaType);</code></div>
<div><code>  </code><code>END LOOP;</code></div>
<div><code>  </code><code>CLOSE output_cv_rel;</code></div>
<div><code>  </code></div>
<div><code>  </code><code>DBMS_OUTPUT.PUT_LINE(</code><code>''</code><code>);</code></div>
<div><code>  </code><code>DBMS_OUTPUT.PUT_LINE(</code><code>'IR_Event data:'</code><code>);</code></div>
<div><code>  </code><code>LOOP</code></div>
<div><code>    </code><code>FETCH OUTPUT_CV_events</code></div>
<div><code>    </code><code>INTO  v_events;</code></div>
<div><code>    </code><code>EXIT WHEN output_cv_events%NOTFOUND;</code></div>
<div><code>    </code><code>DBMS_OUTPUT.PUT_LINE(</code><code>'FooId:'</code> <code>|| RAWTOHEX(v_events.m_FooId) || </code><code>' FooDate:'</code> <code>|| TO_CHAR(v_events.m_eventdate, </code><code>'YYYY-MM-DD HH24:MI:SS'</code><code>));</code></div>
<div><code>  </code><code>END LOOP;</code></div>
<div><code>  </code><code>CLOSE output_cv_events;</code></div>
<div></div>
<div><code>  </code><code>--Looping through the tags and custattrs cursors is left as an exercise </code><code>for</code> <code>the reader</code></div>
<div><code>  </code></div>
<div><code>END;</code></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<p><strong>Acknowledgments</strong><br />
Thanks to <a href="http://www.akadia.com/services/ora_return_result_set.html" rel="nofollow">Akadia.com</a> (and <a href="http://stackoverflow.com/questions/6373397/how-to-iterate-through-oracledbtype-refcursor-result-set" rel="nofollow">StackOverflow.com</a> for the pointer).</p>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ourcraft.wordpress.com/2321/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ourcraft.wordpress.com/2321/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ourcraft.wordpress.com&#038;blog=2431618&#038;post=2321&#038;subd=ourcraft&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ourcraft.wordpress.com/2013/01/18/how-to-spit-out-a-result-set-returned-by-an-oracle-sproc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/745c1699ef739b13b10b33db744ee804?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">danielmeyer</media:title>
		</media:content>
	</item>
		<item>
		<title>Oracle stuff</title>
		<link>http://ourcraft.wordpress.com/2013/01/18/oracle-stuff/</link>
		<comments>http://ourcraft.wordpress.com/2013/01/18/oracle-stuff/#comments</comments>
		<pubDate>Fri, 18 Jan 2013 20:21:57 +0000</pubDate>
		<dc:creator>danielmeyer</dc:creator>
				<category><![CDATA[Technical Stuff]]></category>

		<guid isPermaLink="false">http://ourcraft.wordpress.com/?p=2319</guid>
		<description><![CDATA[To disable ampersand-variables: SET DEFINE OFF To enable debug output: SET SERVEROUTPUT ON To list data tablespaces: SELECT DISTINCT TABLESPACE_NAME FROM ALL_TABLES; To list index tablespaces: SELECT DISTINCT TABLESPACE_NAME FROM ALL_INDEXES;<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ourcraft.wordpress.com&#038;blog=2431618&#038;post=2319&#038;subd=ourcraft&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>To disable ampersand-variables:<br />
<code>SET DEFINE OFF</code></p>
<p>To enable debug output:<br />
<code>SET SERVEROUTPUT ON</code></p>
<p>To list data tablespaces:<br />
<code>SELECT DISTINCT TABLESPACE_NAME FROM ALL_TABLES;</code></p>
<p>To list index tablespaces:<br />
<code>SELECT DISTINCT TABLESPACE_NAME FROM ALL_INDEXES;<br />
</code></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ourcraft.wordpress.com/2319/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ourcraft.wordpress.com/2319/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ourcraft.wordpress.com&#038;blog=2431618&#038;post=2319&#038;subd=ourcraft&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ourcraft.wordpress.com/2013/01/18/oracle-stuff/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/745c1699ef739b13b10b33db744ee804?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">danielmeyer</media:title>
		</media:content>
	</item>
		<item>
		<title>The identifier formerly unknown as&#8230;</title>
		<link>http://ourcraft.wordpress.com/2012/02/09/the-identifier-formerly-unknown-as/</link>
		<comments>http://ourcraft.wordpress.com/2012/02/09/the-identifier-formerly-unknown-as/#comments</comments>
		<pubDate>Thu, 09 Feb 2012 15:01:42 +0000</pubDate>
		<dc:creator>danielmeyer</dc:creator>
				<category><![CDATA[Fun]]></category>

		<guid isPermaLink="false">http://ourcraft.wordpress.com/?p=2310</guid>
		<description><![CDATA[Today I got a compiler error I don&#8217;t ever remember seeing before: &#8220;previous definition was a &#8216;formerly unknown identifier&#8217;&#8221;, probably in shades and a trenchcoat. Funny!<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ourcraft.wordpress.com&#038;blog=2431618&#038;post=2310&#038;subd=ourcraft&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Today I got a compiler error I don&#8217;t ever remember seeing before:</p>
<pre class="brush: cpp; title: ; notranslate">
C:\p4\team\EIC\clay\irqm\products\eic\src\i3dbtranintxsearchprovider\CI3DBTranIntxSearchProvider.cpp(326) : error C3861: 'ExecTranExecuteSearch2': identifier not found, even with argument-dependent lookup
C:\p4\team\EIC\clay\irqm\products\eic\src\i3dbtranintxsearchprovider\CI3DBTranIntxSearchProvider.cpp(465) : error C2039: 'ExecTranExecuteSearch2' : is not a member of 'CI3DBTranIntxSearchProvider'
        c:\p4\team\EIC\clay\irqm\products\eic\src\i3dbtranintxsearchprovider\CI3DBTranIntxSearchProvider.h(34) : see declaration of 'CI3DBTranIntxSearchProvider'
C:\p4\team\EIC\clay\irqm\products\eic\src\i3dbtranintxsearchprovider\CI3DBTranIntxSearchProvider.cpp(484) : error C2365: 'ExecTranExecuteSearch2' : redefinition; previous definition was a 'formerly unknown identifier'
dmake.EXE:  Error code 130, while making 'UnitTestDebugU\CI3DBTranIntxSearchProvider.obj'
dmake.EXE:  Error code 255, while making 'UDT'
</pre>
<p>&#8220;previous definition was a &#8216;formerly unknown identifier&#8217;&#8221;, probably in shades and a trenchcoat. Funny!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ourcraft.wordpress.com/2310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ourcraft.wordpress.com/2310/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ourcraft.wordpress.com&#038;blog=2431618&#038;post=2310&#038;subd=ourcraft&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ourcraft.wordpress.com/2012/02/09/the-identifier-formerly-unknown-as/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/745c1699ef739b13b10b33db744ee804?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">danielmeyer</media:title>
		</media:content>
	</item>
		<item>
		<title>Oracle: 30 char identifiers</title>
		<link>http://ourcraft.wordpress.com/2011/08/26/oracle-30-char-identifiers/</link>
		<comments>http://ourcraft.wordpress.com/2011/08/26/oracle-30-char-identifiers/#comments</comments>
		<pubDate>Fri, 26 Aug 2011 12:50:24 +0000</pubDate>
		<dc:creator>danielmeyer</dc:creator>
				<category><![CDATA[Technical Stuff]]></category>
		<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://ourcraft.wordpress.com/?p=2305</guid>
		<description><![CDATA[Because I can never remember, here it is: The size of an identifier cannot exceed 30 characters. &#8211;from Oracle&#8217;sPL/SQL User&#8217;s Guide and Reference: 10g Release 1 (10.1)<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ourcraft.wordpress.com&#038;blog=2431618&#038;post=2305&#038;subd=ourcraft&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Because I can never remember, here it is:</p>
<blockquote><p>The size of an identifier cannot exceed 30 characters.</p></blockquote>
<p>&#8211;from Oracle&#8217;s<a href="http://download.oracle.com/docs/cd/B13789_01/appdev.101/b10807/02_funds.htm#sthref120">PL/SQL User&#8217;s Guide and Reference: 10g Release 1 (10.1)</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ourcraft.wordpress.com/2305/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ourcraft.wordpress.com/2305/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ourcraft.wordpress.com&#038;blog=2431618&#038;post=2305&#038;subd=ourcraft&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ourcraft.wordpress.com/2011/08/26/oracle-30-char-identifiers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/745c1699ef739b13b10b33db744ee804?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">danielmeyer</media:title>
		</media:content>
	</item>
		<item>
		<title>Gerald M. Weinberg</title>
		<link>http://ourcraft.wordpress.com/2010/06/03/gerald-m-weinberg/</link>
		<comments>http://ourcraft.wordpress.com/2010/06/03/gerald-m-weinberg/#comments</comments>
		<pubDate>Thu, 03 Jun 2010 15:00:15 +0000</pubDate>
		<dc:creator>danielmeyer</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ourcraft.wordpress.com/?p=2293</guid>
		<description><![CDATA[Today, while looking for the Reasons article about which I just posted, I found out that Jerry Weinberg has recently come out of what was supposed to be terminal cancer. I was moved to write him this letter, which I sent this morning: June 3, 2010 Gerald Weinberg c/o Dorset House Publishing Co. 3143 Broadway, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ourcraft.wordpress.com&#038;blog=2431618&#038;post=2293&#038;subd=ourcraft&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Today, while looking for the Reasons article about which I just <a href="http://ourcraft.wordpress.com/2010/06/03/reasons/">posted</a>, I found out that Jerry Weinberg has recently come out of what was supposed to be terminal cancer.  I was moved to write him this letter, which I sent this morning:</p>
<blockquote><p>June 3, 2010</p>
<p>Gerald Weinberg<br />
c/o Dorset House Publishing Co.<br />
3143 Broadway, Suite 2B<br />
New York, New York 10027  USA</p>
<p>Dear Mr. Weinberg,</p>
<p>As a computer programmer of thirteen years, I have read and benefited from your writing – specifically, <em>Exploring Requirements</em> and <em>Are Your Lights On?</em> Thank you for working to understand what’s wrong with how the people within software development organizations think and articulating what needs to change and how.  Your work has made a difference to me.</p>
<p>I went to your website this morning and saw that you have had a battle with cancer.  Recently you were declared cancer-free &#8212; praise God for that!</p>
<p>Mr. Weinberg, you have had a brush with death, and because I love you I need to warn you of the Day of Judgment that we all will face.  On that day, what will you say to the King?</p>
<p>I do not know the state of your soul before God, but I implore you, please do not deny the existence of the King.  God who made the heavens and the earth and gave you every breath you’ve ever taken rules in righteouness, and he will call you to account one day.  All have sinned and fall short of the glory of God.  Only those who repent and believe in Jesus Christ will be saved.</p>
<p>Oh Mr. Weinberg, repent and be saved!</p>
<p>Sincerely and with love,<br />
Daniel S. Meyer</p></blockquote>
<p>I don&#8217;t have a mailing address for Mr. Weinberg, and I don&#8217;t know if his publisher will forward it on to him.  Even if they do, how likely is Mr. Weinberg to repent?  Am I not a fool for doing such a thing &#8212; not to mention for advertising it here?  Where is my respectability?</p>
<p>Brothers who are in Christ: <em>souls are at stake</em>. Fool or no, I care about Mr. Weinberg&#8217;s soul.  On Judgment Day I want to be able to look in the eyes of all, knowing I was faithful to warn.   And may God grant repentance to those He has chosen!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ourcraft.wordpress.com/2293/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ourcraft.wordpress.com/2293/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ourcraft.wordpress.com&#038;blog=2431618&#038;post=2293&#038;subd=ourcraft&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ourcraft.wordpress.com/2010/06/03/gerald-m-weinberg/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/745c1699ef739b13b10b33db744ee804?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">danielmeyer</media:title>
		</media:content>
	</item>
		<item>
		<title>Reasons</title>
		<link>http://ourcraft.wordpress.com/2010/06/03/reasons/</link>
		<comments>http://ourcraft.wordpress.com/2010/06/03/reasons/#comments</comments>
		<pubDate>Thu, 03 Jun 2010 13:42:15 +0000</pubDate>
		<dc:creator>danielmeyer</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ourcraft.wordpress.com/?p=2290</guid>
		<description><![CDATA[As developers, we consider ourselves to be logical thinkers. And to an extent, we are able to think logically, to find and implement technical solutions. But is our decisionmaking driven by cool reason?  Yes, we say &#8212; by cool reason. What about when we communicate our evaluation of a Microsoft tool to co-workers?  Cool reason? [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ourcraft.wordpress.com&#038;blog=2431618&#038;post=2290&#038;subd=ourcraft&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>As developers, we consider ourselves to be logical thinkers.  And to an extent, we <em>are</em> able to think logically, to find and implement technical solutions.</p>
<p>But is our decisionmaking driven by cool reason?  Yes, we say &#8212; by cool reason.</p>
<p>What about when we communicate our evaluation of a Microsoft tool to co-workers?  Cool reason?</p>
<p>Not usually.</p>
<p>The fact is, many of the decisions we make as developers are made based on <em>emotional </em>arguments couched in technical terminology.  Reading a post by Jerry Weinberg several months back brought on an <em>Aha!</em> moment that changed my thinking about us developers.</p>
<p>From Mr. Weinberg&#8217;s post titled <em><a href="http://www.ayeconference.com/reasons/">Reasons</a></em>, then:</p>
<blockquote><p>&#8230;<br />
Recently, I found myself recalling that summer day, half-a-century  ago, when a client asked me to find out why their Software Engineering  Process Group was having so much trouble getting people to adopt new  software tools. It couldn’t be the tools themselves, they reasoned,  because quite a few people had adopted them and liked them. So, I set  out to interview both adopters and rejecters, to discover the reasons  some were using the tools and some were not. Here are some of the  answers I obtained:</p>
<p>Darlene: I installed it because the boss told me to use it.</p>
<p>Porter: The boss told me to use it, so I didn’t use it.</p>
<p>Ursula: I installed it because the boss forced me to use it.</p>
<p>Marcy: The boss forced me to use it, so I installed it, but I don’t  use it. He wouldn’t know the difference.</p>
<p>Quentin: I used it because it was like what I used before, so I knew I  wouldn’t have any trouble adapting to it.</p>
<p>Chuck: Why should I use it? It’s nothing new; it’s just like what I  used before.</p>
<p>Carl: Hey, I used it right away, because it was new and different.</p>
<p>Cynthia: I’m not going to use anything that’s new and different. Too  many things aren’t tested, and something’s sure to go wrong.</p>
<p>Mary: Of course I used it. Everyone else was using it.</p>
<p>Roy: Everyone else was using it – what a bore! You won’t catch me  following the crowd.</p>
<p>Frances: Why should I use it? Nobody else was.</p>
<p>Edgar: Hey, I got to be the first one to use it!</p>
<p>Mort: I couldn’t use it. It didn’t do all the things I needed.</p>
<p>Alan: The thing I liked best about this tool was that it didn’t try  to be a Swiss army knife and do everything anyone could possibly want.</p>
<p>Gerri: It was the perfect tool, because it had every feature I could  possibly want.</p>
<p>Chico: Every time I hit a key by accident, it would invoke some  obscure feature that I didn’t want in there in the first place. Finally,  I trashed the whole thing.</p>
<p>Orion: I’m so busy, I needed a new tool to save me some time.</p>
<p>Belle: I’m so busy, I don’t have time to install and learn a new  tool.</p>
<p>May: I’m not that heavily loaded. Why would I need a time-saving  tool?</p>
<p>Paul: Well, I wasn’t so busy with other things, so I had time to  install and learn a new tool.</p>
<p>Earl: It was freeware, so it was a bargain.</p>
<p>Justine: It was shareware, so it couldn’t have been any good.</p>
<p>Jacob: This tool costs $3,000. It must be good, so I’m using it.</p>
<p>Neelie: I’m saving the company $3,000 by not using it.</p>
<p>Willis: I won’t use it because I don’t like the way Microsoft makes  software.</p>
<p>Samuel: I knew it would be good because Microsoft makes it.</p>
<p>—–</p>
<p>Well, there were more, many more, but that’s enough of the infinite  reasons to make my point. By this time, you may have noticed that I have  arranged these reasons in pairs. Why? So you could see the pattern that  I saw:</p>
<p>Every single reason to use the tool was matched by the same reason  for not using it – and vice versa!</p>
<p>In other words, these reasons may look like logic, but they’re not  logic – they’re just reasons. In logic, the reasoning comes first, then  comes the decision. But in real life, it’s usually the other way around –  first we make the decision, then we make up whatever reasons we need to  “justify” the decision and make it look like logic&#8230;</p></blockquote>
<p>Going back to the Microsoft example again, when the Microsoft tool blows up, do we have cursings at the ready?  If so, would we have had similar cursings at the ready if it had been our favorite open source tool that blew up?  If not, why not?  Are we of a mind to be understanding toward our open source tool and impatient with our Microsoft tool?  (The question has the same implications if we reverse the inclinations &#8212; positing a tendency for patience toward the Microsoft tool and impatience toward the open source tool.)</p>
<p>What I have described is not a <em>logical</em> argument about a tool.  It is an <em>emotional</em> argument about a company.  Perhaps there is an argument to be made against the company (&#8220;Where possible I  do not support Microsoft because of its history of corrupt business practices regarding smaller innovators in the market&#8221; would be an example of a <em>moral</em> argument.)  Cloaking such a moral argument as a technical argument against a particular tool, however, is not honest.  As developers, we don&#8217;t even realize we&#8217;re doing this, but we need to realize it.  It&#8217;s part of being a professional.</p>
<p>Read <a href="http://www.ayeconference.com/reasons/">Weinberg&#8217;s whole article</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ourcraft.wordpress.com/2290/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ourcraft.wordpress.com/2290/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ourcraft.wordpress.com&#038;blog=2431618&#038;post=2290&#038;subd=ourcraft&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ourcraft.wordpress.com/2010/06/03/reasons/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/745c1699ef739b13b10b33db744ee804?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">danielmeyer</media:title>
		</media:content>
	</item>
		<item>
		<title>Living in a virtual machine</title>
		<link>http://ourcraft.wordpress.com/2010/05/27/living-in-a-virtual-machine/</link>
		<comments>http://ourcraft.wordpress.com/2010/05/27/living-in-a-virtual-machine/#comments</comments>
		<pubDate>Thu, 27 May 2010 16:03:15 +0000</pubDate>
		<dc:creator>danielmeyer</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ourcraft.wordpress.com/?p=2283</guid>
		<description><![CDATA[We programmers are a proud lot, aren&#8217;t we? We can do things our family members and friends can&#8217;t do. We can take lifeless bits, wave our hands, and make the code live! We have logic. We have design and problem solving skills. We have honed our technical prowess. All this is good &#8212; but there [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ourcraft.wordpress.com&#038;blog=2431618&#038;post=2283&#038;subd=ourcraft&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>We programmers are a proud lot, aren&#8217;t we?</p>
<p>We can do things our family members and friends can&#8217;t do.  We can take lifeless bits, wave our hands, and make the code live!  We have logic.  We have design and problem solving skills.  We have honed our technical prowess.</p>
<p>All this is good &#8212; but there is a problem: We imagine that we live in a larger world than the non-technical people around us.  Brothers, let us not be deceived: our world is a <em>smaller</em> world.</p>
<p>What do I mean?</p>
<p>Our technical expertise does not help us prolong the life of our sick child &#8212; we thank God for the doctors and pray for grace.</p>
<p>Our design skills do not give us boldness to warn those who do not love Jesus of the judgment they face if they do not repent.</p>
<p>Our logic does not teach us how to live with our wives as with a weaker vessel, leading with honor, gentleness, and strength.</p>
<p>Our ability to do what others can&#8217;t do does not confer on us a special ability to honor our father and our mother as we know we ought.</p>
<p>These are matters of eternal import where we are no better than anyone else &#8212; and often worse!</p>
<p>Brothers, in our daily work we&#8217;re living in a virtual machine.</p>
<p>Yes, let&#8217;s continue to work to solve problems, to help people with our software, to work as unto the Lord &#8212; but let&#8217;s never forget that the rules are simpler inside this machine.  The hard problems are <em>out there</em>.  We don&#8217;t know how to solve those problems.  Sometimes we don&#8217;t even try to deal with those problems &#8212; we hide inside our virtual machine, where the universe is smaller and the rules are better defined.</p>
<p>It&#8217;s not wrong for us to do our technical work.  But we should be the humble ones, not the proud ones.  Brothers, let us remember this.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ourcraft.wordpress.com/2283/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ourcraft.wordpress.com/2283/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ourcraft.wordpress.com&#038;blog=2431618&#038;post=2283&#038;subd=ourcraft&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ourcraft.wordpress.com/2010/05/27/living-in-a-virtual-machine/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/745c1699ef739b13b10b33db744ee804?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">danielmeyer</media:title>
		</media:content>
	</item>
		<item>
		<title>DB-level unit tests for SQL Server</title>
		<link>http://ourcraft.wordpress.com/2010/05/11/db-level-unit-tests-for-sql-server/</link>
		<comments>http://ourcraft.wordpress.com/2010/05/11/db-level-unit-tests-for-sql-server/#comments</comments>
		<pubDate>Tue, 11 May 2010 17:07:32 +0000</pubDate>
		<dc:creator>danielmeyer</dc:creator>
				<category><![CDATA[Technical Stuff]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[unit testing]]></category>

		<guid isPermaLink="false">http://ourcraft.wordpress.com/?p=2274</guid>
		<description><![CDATA[I had created some test data on a labmanager VM.  It had taken some time &#8212; I had recorded a few calls, an email, and a chat, then tweaked the recording metadata to try out a few important aspects of the stored procedure I was testing. It&#8217;s at these times that I get the nagging [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ourcraft.wordpress.com&#038;blog=2431618&#038;post=2274&#038;subd=ourcraft&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I had created some test data on a labmanager VM.  It had taken some time &#8212; I had recorded a few calls, an email, and a chat, then tweaked the recording metadata to try out a few important aspects of the stored procedure I was testing.</p>
<p>It&#8217;s at these times that I get the nagging feeling &#8212; the test was so time-intensive to create and run, why not take the step of automating it so we can run it in the future and catch regressions &#8216;most instantly?</p>
<p>I wanted an SQL script that I could run that would INSERT the test data as it currently existed on my test machine.  And I didn&#8217;t want to create those INSERT statements by hand.  Boy, did I not want to write them all by hand.</p>
<h4>Solution</h4>
<p>Microsoft SQL Server 2005 comes with something called Database Publishing Wizard (look under <code>Program Files\Microsoft SQL Server\90\Tools\Publishing\1.2\</code> ).  With the following command:</p>
<pre class="brush: plain; title: ; notranslate">
sqlpubwiz script -d MyDatabase -dataonly c:\temp\MyDatabase.sql
</pre>
<p>&#8230;I was able to generate INSERT statements for all the data in my little test database to an .sql script file.  I then edited the file to remove things I didn&#8217;t need (and to avoid key collisions by substituting <code>NEWID()</code> calls for hardcoded uniqueidentifiers as necessary).</p>
<p>Finally, with all the data in place, I could add the following tests.  (If anything goes wrong, an error message appears in the Messages window.)</p>
<pre class="brush: sql; title: ; notranslate">
DECLARE @tempTable TABLE(BlahId      uniqueidentifier,
                         BlahType        int,
                         BlahDateUTC DateTime,
                         BlahLength  int,
                         PhoneNumber      nvarchar(60),
                         RightsMask       int);

DECLARE	@return_value int;
INSERT INTO @tempTable
EXEC	@return_value = [dbo].[blah_get_blah_chunk]
		@i_sessionId = @sessionId,
		@i_chunkSize = 50;

IF @return_value &lt;&gt; 0 RAISERROR('Return value should be zero but was %d', 15, 1, @return_value);

DECLARE @expectedRecords int;
DECLARE @actualRecords int;
SET @expectedRecords = 5;
SET @actualRecords = (SELECT COUNT(*) FROM @tempTable);
IF @actualRecords &lt;&gt; @expectedRecords RAISERROR('Expected %d records in result set but found %d', 15, 1, @expectedRecords, @actualRecords);

DECLARE @actualDisplayName nvarchar(60);
DECLARE @expectedDisplayName nvarchar(60);
SET @expectedDisplayName = N'blah_user -';
SELECT @actualDisplayName = (SELECT LocalPartyName FROM @tempTable WHERE RecordingId = N'a0ca1a4f-0933-4565-b5da-d8fc3222a42a');
IF @actualDisplayName &lt;&gt; @expectedDisplayName RAISERROR('Expected display name to be &quot;%s&quot; but it was &quot;%s&quot;', 15, 1, @expectedDisplayName, @actualDisplayName);

GO
</pre>
<p>In the future we could have a script test runner that keeps track of the output and flags errors as part of the build&#8230; but one step at a time, right?  This already takes test scenarios that took more than a day to set up and makes them runnable in a minute or two.</p>
<p>Database Publishing Wizard can also generate script to create the entire database schema, but it&#8217;s the data generation that will support my unit test needs.</p>
<p>Thanks, Microsoft!</p>
<h4>Acknowledgement</h4>
<p>Thanks to Pinalkumar Dave for his helpful write-up titled <cite><a href="http://blog.sqlauthority.com/2007/11/16/sql-server-2005-generate-script-with-data-from-database-database-publishing-wizard/">Generate Script with Data from Database – Database Publishing Wizard</a></cite></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ourcraft.wordpress.com/2274/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ourcraft.wordpress.com/2274/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ourcraft.wordpress.com&#038;blog=2431618&#038;post=2274&#038;subd=ourcraft&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ourcraft.wordpress.com/2010/05/11/db-level-unit-tests-for-sql-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/745c1699ef739b13b10b33db744ee804?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">danielmeyer</media:title>
		</media:content>
	</item>
	</channel>
</rss>
