<?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>entwicklungsgedanken</title>
	<atom:link href="http://www.entwicklungsgedanken.de/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.entwicklungsgedanken.de</link>
	<description>Verschiedene Gedanken rund um die Softwareentwicklung</description>
	<lastBuildDate>Thu, 29 Jul 2010 11:09:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Solving NULL values are recognized as text-values within dynamic queries in PostgresSQL</title>
		<link>http://www.entwicklungsgedanken.de/2010/07/29/solving-null-values-are-recognized-as-text-values-within-dynamic-queries-in-postgressql/</link>
		<comments>http://www.entwicklungsgedanken.de/2010/07/29/solving-null-values-are-recognized-as-text-values-within-dynamic-queries-in-postgressql/#comments</comments>
		<pubDate>Thu, 29 Jul 2010 11:09:20 +0000</pubDate>
		<dc:creator>Eric Bartels</dc:creator>
				<category><![CDATA[SQL]]></category>
		<category><![CDATA[Webdevelopment]]></category>
		<category><![CDATA[dynamic query]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[NULL]]></category>
		<category><![CDATA[plpgsql]]></category>
		<category><![CDATA[postgres]]></category>

		<guid isPermaLink="false">http://www.entwicklungsgedanken.de/?p=435</guid>
		<description><![CDATA[I&#8217;ve written a dynamic query which is finally executed via EXECUTE my_dynamic_query; The query contained a select list in which two columns should always be NULL. -- ... stuff before dynamic_select_cols := 'tbl1.foo, tbl1.bar, null AS theAlias1, null AS theAlias2, tbl2.foo2'; -- ... stuff after combining the dynamic queries EXECUTE my_dynamic_query; In my case the [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve written a dynamic query which is finally executed via <code>EXECUTE my_dynamic_query;</code> The query contained a select list in which two columns should always be <code>NULL</code>.</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">-- ... stuff before</span>
dynamic_select_cols :<span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'tbl1.foo, tbl1.bar, null AS theAlias1, null AS theAlias2, tbl2.foo2'</span>;
<span style="color: #808080; font-style: italic;">-- ... stuff after combining the dynamic queries</span>
EXECUTE my_dynamic_query;</pre></div></div>

<p>In my case the result of the query will be inserted in a <a href="http://www.postgresql.org/docs/8.4/interactive/sql-createtable.html">temporary table</a> in memory. The destination column for <code>theAlias1</code> is of type <code>INTEGER</code>. When executing the query PostgreSQL gives me an error:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">column <span style="color: #ff0000;">&quot;theAlias1&quot;</span> is of <span style="color: #7a0874; font-weight: bold;">type</span> integer but expression is of <span style="color: #7a0874; font-weight: bold;">type</span> text</pre></div></div>

<p>So there is something wrong when the query is parsed, evaluated and executed.</p>
<p>Solving this was easy with the use of <a href="http://www.postgresql.org/docs/8.4/interactive/functions-conditional.html">NULLIF</a>. Zero equals zero so <code>NULL</code> is returned. Just as expected.</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">-- ... stuff before</span>
dynamic_select_cols :<span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'tbl1.foo, tbl1.bar, NULLIF(0, 0) AS theAlias1, NULLIF(0, 0) AS theAlias2, tbl2.foo2'</span>;
<span style="color: #808080; font-style: italic;">-- ... stuff after combining the dynamic queries</span>
EXECUTE my_dynamic_query;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.entwicklungsgedanken.de/2010/07/29/solving-null-values-are-recognized-as-text-values-within-dynamic-queries-in-postgressql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using a C# preprocessor directive for testing custom timer-jobs</title>
		<link>http://www.entwicklungsgedanken.de/2010/07/22/using-a-c-preprocessor-directive-for-testing-custom-timer-jobs/</link>
		<comments>http://www.entwicklungsgedanken.de/2010/07/22/using-a-c-preprocessor-directive-for-testing-custom-timer-jobs/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 20:42:00 +0000</pubDate>
		<dc:creator>Eric Bartels</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[SharePoint-Development]]></category>
		<category><![CDATA[preprocessor]]></category>
		<category><![CDATA[SPJobDefinition]]></category>
		<category><![CDATA[Timer job]]></category>
		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://www.entwicklungsgedanken.de/?p=425</guid>
		<description><![CDATA[If your are writing custom timer-jobs for your SharePoint solution it will happen that you write jobs which are only executed once a day or even less often. As a developer you cannot wait that long&#8230; You could of course comment in and out (via ctrl + k, ctrl + c / ctrl + k, [...]]]></description>
			<content:encoded><![CDATA[<p>If your are writing custom timer-jobs for your SharePoint solution it will happen that you write jobs which are only executed once a day or even less often. As a developer you cannot wait that long&#8230;</p>
<p>You could of course comment in and out (via ctrl + k, ctrl + c / ctrl + k, ctrl + u) the <a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spschedule.aspx">SPSchedule</a> used by the timer-job during debug-mode. But this is error-prone.</p>
<p>When using a <a href="http://msdn.microsoft.com/en-us/library/ed8yd1ha(VS.71).aspx">C# preprocessor directive</a> you cannot forget to switch back to the &#8220;production schedule&#8221; as this is done automatically (and even with syntax-highlighting depending on the active configuration!) when selecting the &#8220;release build&#8221;.</p>
<p><code lang="csharp"><br />
#if (DEBUG)<br />
var schedule = new SPMinuteSchedule();<br />
schedule.BeginSecond = 1;<br />
schedule.EndSecond = 59;<br />
schedule.Interval = 5;<br />
#else<br />
var schedule = new SPDailySchedule();<br />
schedule.BeginHour = 7;<br />
schedule.EndHour = 7;<br />
schedule.BeginMinute = 1;<br />
schedule.EndMinute = 59;<br />
#endif<br />
</code><br />
This code tells the compiler to use the <a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spminuteschedule.aspx">SPMinuteSchedule</a> when compiling the &#8220;debug build&#8221; and to use the <a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spdailyschedule.aspx">SPDailySchedule</a> when compiling in &#8220;release build&#8221;. All automatically!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.entwicklungsgedanken.de/2010/07/22/using-a-c-preprocessor-directive-for-testing-custom-timer-jobs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configure the symfony-mailer (swiftmailer) during runtime</title>
		<link>http://www.entwicklungsgedanken.de/2010/05/03/configure-the-symfony-mailer-swiftmailer-during-runtime/</link>
		<comments>http://www.entwicklungsgedanken.de/2010/05/03/configure-the-symfony-mailer-swiftmailer-during-runtime/#comments</comments>
		<pubDate>Mon, 03 May 2010 08:45:32 +0000</pubDate>
		<dc:creator>Eric Bartels</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Symfony]]></category>
		<category><![CDATA[Webdevelopment]]></category>
		<category><![CDATA[configure]]></category>
		<category><![CDATA[mailer]]></category>
		<category><![CDATA[multi-client]]></category>
		<category><![CDATA[runtime]]></category>
		<category><![CDATA[swiftmailer]]></category>

		<guid isPermaLink="false">http://www.entwicklungsgedanken.de/?p=413</guid>
		<description><![CDATA[One of my current projects is a multi-client environment. Each client has its own smtp-settings for the mailings that are done within that application. From static &#8230; Symfony allows the configuration of the mailer in its factories.yml. There smtp-settings can be definied. But in this case this is impossible as every client has different smtp-settings [...]]]></description>
			<content:encoded><![CDATA[<p>One of my current projects is a multi-client environment. Each client has its own smtp-settings for the mailings that are done within that application.</p>
<h3>From static &#8230;</h3>
<p>Symfony allows the configuration of the mailer in its <code>factories.yml</code>. There smtp-settings can be definied. But in this case this is impossible as every client has different smtp-settings (every client can use its own smtp-settings to handle mailings).</p>
<p>As I did not want to create an instance of the <a href="http://swiftmailer.org/">Swift_Mailer</a> (and<a href="http://swiftmailer.org/docs/smtp-transport"> Swift_SmtpTransport</a>) myself I decided to create my own mailer-class which is derived from the symfony one. So I get the full benefits of logging.</p>
<h3>&#8230; to dynamic</h3>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">class</span> myDynamicMailer <span style="color: #000000; font-weight: bold;">extends</span> sfMailer
<span style="color: #009900;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> __construct<span style="color: #009900;">&#40;</span>sfEventDispatcher <span style="color: #000088;">$dispatcher</span><span style="color: #339933;">,</span> <span style="color: #000088;">$options</span><span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
    <span style="color: #666666; font-style: italic;">// Load client based configuration</span>
    <span style="color: #000088;">$cfg</span> <span style="color: #339933;">=</span> EmailConfiguration<span style="color: #339933;">::</span><span style="color: #004000;">getCurrent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$cfg</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>isSmtpConfigured<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
      <span style="color: #000088;">$options</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;class&quot;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Swift_MailTransport&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">else</span>
    <span style="color: #009900;">&#123;</span>
      <span style="color: #666666; font-style: italic;">// Update settings for the current client</span>
      <span style="color: #000088;">$options</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;transport&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;param&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;host&quot;</span><span style="color: #009900;">&#93;</span>      <span style="color: #339933;">=</span> <span style="color: #000088;">$cfg</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>getHostname<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000088;">$options</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;transport&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;param&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;port&quot;</span><span style="color: #009900;">&#93;</span>      <span style="color: #339933;">=</span> <span style="color: #000088;">$cfg</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>getPort<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000088;">$options</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;transport&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;param&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;username&quot;</span><span style="color: #009900;">&#93;</span>  <span style="color: #339933;">=</span> <span style="color: #000088;">$cfg</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>getUsername<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000088;">$options</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;transport&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;param&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;password&quot;</span><span style="color: #009900;">&#93;</span>  <span style="color: #339933;">=</span> <span style="color: #000088;">$cfg</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>getDecryptedPassword<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    parent<span style="color: #339933;">::</span>__construct<span style="color: #009900;">&#40;</span><span style="color: #000088;">$dispatcher</span><span style="color: #339933;">,</span> <span style="color: #000088;">$options</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Simply update <code>factories.yml</code> with the new class and the dynamic configuration is applied.</p>

<div class="wp_syntax"><div class="code"><pre class="yaml" style="font-family:monospace;">all:
  mailer:
    class: myDynamicMailer
    # Rest follows here</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.entwicklungsgedanken.de/2010/05/03/configure-the-symfony-mailer-swiftmailer-during-runtime/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Meeting workspaces in SharePoint 2010 / Office 2010. A disappointment.</title>
		<link>http://www.entwicklungsgedanken.de/2010/04/29/meeting-workspaces-in-sharepoint-2010-office-2010-a-disappointment/</link>
		<comments>http://www.entwicklungsgedanken.de/2010/04/29/meeting-workspaces-in-sharepoint-2010-office-2010-a-disappointment/#comments</comments>
		<pubDate>Thu, 29 Apr 2010 06:07:29 +0000</pubDate>
		<dc:creator>Eric Bartels</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Meeting]]></category>
		<category><![CDATA[office]]></category>
		<category><![CDATA[Outlook]]></category>
		<category><![CDATA[SP2010]]></category>

		<guid isPermaLink="false">http://www.entwicklungsgedanken.de/2010/04/29/meeting-workspaces-in-sharepoint-2010-office-2010-a-disappointment/</guid>
		<description><![CDATA[SharePoint 2010 RTM (and its Foundation) are available for awhile now. After installing SharePoint Foundation I immediately took a look into the meeting workspaces. No improvements since the Beta! Not all lists support the new AJAX-Dialogs. The page-management (for multi-paged workspaces) is still the same as in 2007. Even some old (SP 2007) graphics appear. [...]]]></description>
			<content:encoded><![CDATA[<p>SharePoint 2010 RTM (and its Foundation) are available for awhile now. After installing SharePoint Foundation I immediately took a look into the meeting workspaces.</p>
<p>No improvements since the Beta! Not all lists support the new AJAX-Dialogs. The page-management (for multi-paged workspaces) is still the same as in 2007. Even some old (SP 2007) graphics appear. The handling is that awful, too. So the whole “area” of meeting-workspaces leaves with an “nothing happened here”-impression.</p>
<p>Additionally the meeting-workspace ribbon in Outlook 2010 is gone! <a href="http://www.johnchapman.name/outlook-2010-meeting-workspace-options/">You can get it back</a>, but its not that preset as in 2007. This was a really nice feature in 2007. Outlook combined with meeting workspaces.</p>
<p>When taking all this together I’m really disappointed.   <br />It comes to my mind that this whole “meeting-workspace-flow” will soon be removed from SharePoint/Outlook – No real improvements in SharePoint 2010 (haven’t tested building site-definitions from meeting-workspaces but I guess its still as hard as in 2007), ribbon in Office 2010 is gone per default and somewhat hidden.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.entwicklungsgedanken.de/2010/04/29/meeting-workspaces-in-sharepoint-2010-office-2010-a-disappointment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WITH-Klausel</title>
		<link>http://www.entwicklungsgedanken.de/2010/04/15/with-klausel/</link>
		<comments>http://www.entwicklungsgedanken.de/2010/04/15/with-klausel/#comments</comments>
		<pubDate>Thu, 15 Apr 2010 09:52:00 +0000</pubDate>
		<dc:creator>clausbajor</dc:creator>
				<category><![CDATA[Datenbank]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[PL/SQL]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Verschiedenes]]></category>

		<guid isPermaLink="false">http://www.entwicklungsgedanken.de/2010/04/15/with-klausel/</guid>
		<description><![CDATA[In der Praxis trifft man von Zeit zu Zeit auf aufgeblaehte SQL-Queries, die ausserordentlich kostenintensiven und langwierigen Ausfuehrungsplaenen folgen. Zeigt eine weitergehende Analyse, dass die komplexe Abfrage eine oder mehrere Subqueries enthaelt, die mehrfach ausgefuehrt werden, dann besteht eine sehr gute Chance durch Verwendung der sogenannten WITH-Klausel, die Performance der Abfrageausfuehrung erheblich zu steigern. Im [...]]]></description>
			<content:encoded><![CDATA[<p>In der Praxis trifft man von Zeit zu Zeit auf aufgeblaehte SQL-Queries, die ausserordentlich kostenintensiven und langwierigen Ausfuehrungsplaenen folgen.    <br />Zeigt eine weitergehende Analyse, dass die komplexe Abfrage eine oder mehrere Subqueries enthaelt, die mehrfach ausgefuehrt werden, dann besteht eine sehr     <br />gute Chance durch Verwendung der sogenannten WITH-Klausel, die Performance der Abfrageausfuehrung erheblich zu steigern. </p>
<p>Im Kern wird die schnellere Ausfuehrung der Query dadurch realisiert, dass mittels der WITH-Klausel die Ergebnismenge der Subquery vorab materialisiert, mit einem Namen versehen und schliesslich in der Hauptquery abgegriffen wird.    <br />Hier lohnt sich auch ein Vergleich und Gebrauch von &quot;global temporary tables&quot;, die in Ihrer Funktions- und Wirkungsweise durchaus ähnlich sind:     <br />Durch Entkopplung geeigneter Subqueries, die urspruenglich als Bestandteile einer komplexen Abfrage fungierten, wird dieses SQL-Statement vereinfacht.</p>
</p>
<div class="wp_syntax" style="padding-bottom: 0px">
<div class="code">
<pre style="font-family: monospace">
WITH   SQ1 AS (SELECT...FROM...WHERE...),
       SQ2 AS (SELECT...FROM...WHERE...)
SELECT...
  FROM Q1, SQ1, SQ2 WHERE…</pre>
</p></div>
</div>
<p>Interessanter Nebeneffekt:</p>
<p>Durch die Verwendung der WITH-Klausel wird anscheinend in einer Systemumgebung mit voreingestelltem CURSOR_SHARING=FORCE offensichtlich fuer die Query-Ausfuehrung diese systemweit gueltige Einstellung auf CURSOR_SHARING=EXACT zurueckgenommen (vergleichbar dem Einsatz des Hint /*+ cursor_sharing_exact */).</p>
<p>Zeigen die QEPs vorher noch eine allgemeine Ersetzung von Konstanten durch Parameter, so weisen die QEPs nachher die direkte Verwendung der Konstanten auf.</p>
<p>Somit orientiert sich der Optimizer auch grundsaetzlich an anderen Zugriffsstrategien.</p>
<p>Was in einer Umgebung mit problematischem Parseverhalten per Bindvariablen-Peeking einen &quot;flüssigen&quot; Anwendungsbetrieb ermöglichen kann, wird im Einzelfall einer komplexen Query unter Verwendung von Attributen mit stark ungleicher Werteverteilung zu relativ kostenintensiven QEPs führen. </p>
<p>Es empfiehlt sich dann für alle entsprechenden Konstanten/Parameter einen separaten und speziellen QEP zu erzwingen. </p>
<p>Vorraussetzung: </p>
<p>SQL-99 Standard bzw. Oracle9i Release 2</p>
<p>Links:</p>
<p><a title="SQLStandards.html" href="http://www.wiscorp.com/SQLStandards.html" target="_blank">SQLStandards.html</a> </p>
<p>to be continued….</p>
]]></content:encoded>
			<wfw:commentRss>http://www.entwicklungsgedanken.de/2010/04/15/with-klausel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MIN, MAX innerhalb eines SELECT-Statement</title>
		<link>http://www.entwicklungsgedanken.de/2010/04/05/min-max-innerhalb-eines-select/</link>
		<comments>http://www.entwicklungsgedanken.de/2010/04/05/min-max-innerhalb-eines-select/#comments</comments>
		<pubDate>Mon, 05 Apr 2010 08:01:00 +0000</pubDate>
		<dc:creator>Sven Thämar</dc:creator>
				<category><![CDATA[Datenbank]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[min max sql]]></category>

		<guid isPermaLink="false">http://www.entwicklungsgedanken.de/2010/01/24/min-max-innerhalb-eines-select/</guid>
		<description><![CDATA[Manchmal benötigten man sowohl den kleinsten (min) als auch den größten (max) Wert einer indizierten Spalte gleichzeitig. SELECT MIN(id) , MAX(id) FROM big_table Bei diesem SELECT kommt zwar das richtige Ergebnis, dennoch kann die Antwortzeit sehr lange dauern. Der Grund liegt in einem FAST FULL INDEX SCAN. Besser ist folgendes: SELECT MIN(id) min_value FROM big_table [...]]]></description>
			<content:encoded><![CDATA[<p>Manchmal benötigten man sowohl den kleinsten (min) als auch den größten (max) Wert einer indizierten Spalte gleichzeitig.</p>
<p> </br>
<div class="wp_syntax">
<div class="code">
<pre class="bash" style="font-family:monospace;">
SELECT MIN(id)
     , MAX(id)
  FROM big_table
</pre>
</div>
</div>
<p>Bei diesem SELECT kommt zwar das richtige Ergebnis, dennoch kann die Antwortzeit sehr lange dauern. Der Grund liegt in einem FAST <strong>FULL</strong> INDEX SCAN.</p>
<p>Besser ist folgendes:</p>
<div class="wp_syntax">
<div class="code">
<pre class="bash" style="font-family:monospace;">
SELECT MIN(id) min_value
  FROM big_table
 UNION ALL
SELECT MAX(id) max_value
  FROM big_table
</pre>
</div>
</div>
<p>oder</p>
<div class="wp_syntax">
<div class="code">
<pre class="bash" style="font-family:monospace;">SELECT (SELECT MIN(id) from big_table) min_value
      ,(SELECT MAX(id) from big_table) max_value
  FROM dual
</pre>
</div>
</div>
<p>Bei beiden alternativen wird ein FULL INDEX SCAN durchgeführt und liefert das Ergebnis (fast) sofort zurück.<br />
Den Umweg sollte man bei großen Tabellen und wo es auf Geschwindigkeit ankommt wählen.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.entwicklungsgedanken.de/2010/04/05/min-max-innerhalb-eines-select/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blockierende SQL-Session</title>
		<link>http://www.entwicklungsgedanken.de/2010/04/05/blockierende-sql-session/</link>
		<comments>http://www.entwicklungsgedanken.de/2010/04/05/blockierende-sql-session/#comments</comments>
		<pubDate>Mon, 05 Apr 2010 07:59:00 +0000</pubDate>
		<dc:creator>Sven Thämar</dc:creator>
				<category><![CDATA[Datenbank]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Verschiedenes]]></category>
		<category><![CDATA[Blockierende SQL Session]]></category>

		<guid isPermaLink="false">http://www.entwicklungsgedanken.de/2010/01/24/blockierende-sql-session/</guid>
		<description><![CDATA[Folgendes SQL-Statement kann man verwenden wenn man prüfen möchte ob es blockierende Sitzungen gibt. SELECT , b.username blocking_username , b.osuser blocking_osuser , b.machine blocking_machine , b.program blocking_program , w.sid waiting_sid , w.username waiting_username , w.osuser waiting_osuser , w.machine waiting_machine , w.seconds_in_wait FROM v$SESSION w , v$SESSION b WHERE w.blocking_session is not NULL AND b.sid = [...]]]></description>
			<content:encoded><![CDATA[<p>Folgendes SQL-Statement kann man verwenden wenn man prüfen möchte ob es blockierende Sitzungen gibt.</p>
<p> </br>
<div class="wp_syntax">
<div class="code">
<pre class="bash" style="font-family:monospace;">
SELECT
     , b.username blocking_username
     , b.osuser blocking_osuser
     , b.machine blocking_machine
     , b.program blocking_program
     , w.sid waiting_sid
     , w.username waiting_username
     , w.osuser waiting_osuser
     , w.machine waiting_machine
     , w.seconds_in_wait
  FROM v$SESSION w
     , v$SESSION b
 WHERE w.blocking_session is not NULL
   AND b.sid = w.blocking_session
 ORDER BY w.sid
</pre>
</div>
</div>
<p>Das Statement kann jederzeit um weitere Spalten erweitert werden.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.entwicklungsgedanken.de/2010/04/05/blockierende-sql-session/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sortierung von hierachischen B&#228;umen</title>
		<link>http://www.entwicklungsgedanken.de/2010/04/05/sortierung-von-hierachischen-bumen/</link>
		<comments>http://www.entwicklungsgedanken.de/2010/04/05/sortierung-von-hierachischen-bumen/#comments</comments>
		<pubDate>Mon, 05 Apr 2010 07:58:00 +0000</pubDate>
		<dc:creator>Sven Thämar</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[sortieren; hierachische Bäume;]]></category>

		<guid isPermaLink="false">http://www.entwicklungsgedanken.de/2010/03/31/sortierung-von-hierachischen-bumen/</guid>
		<description><![CDATA[Oft hat man die Anforderung hierachische Bäume sortiert darzustellen. Am besten soll die Sortierung auch jederzeit geändert werden können. Folgendes Beispiel soll die einfache Lösung aufzeigen: SELECT a.id , a.parent_id , a.label , a.sort FROM menu_tree a ORDER BY 2 nulls first,1 &#160; ID PARENT_ID LABEL SORT 1 &#160; Anwendung 1 2 1 Hilfsdaten 2 [...]]]></description>
			<content:encoded><![CDATA[<p>Oft hat man die Anforderung hierachische Bäume sortiert darzustellen. Am besten soll die Sortierung auch jederzeit geändert werden können.</p>
<p>Folgendes Beispiel soll die einfache Lösung aufzeigen:</p>
<div class="wp_syntax">
<div class="code">
<pre class="bash" style="font-family:monospace;">
SELECT a.id
     , a.parent_id
     , a.label
     , a.sort
  FROM menu_tree a
 ORDER BY 2 nulls first,1
</pre>
</div>
</div>
<p>&#160;</p>
<table border="1" cellspacing="0" cellpadding="2" width="386">
<tbody>
<tr>
<td valign="top" width="44">ID</td>
<td valign="top" width="78">PARENT_ID</td>
<td valign="top" width="213">LABEL</td>
<td valign="top" width="49">SORT</td>
</tr>
<tr>
<td valign="top" width="44">1</td>
<td valign="top" width="78">&#160;</td>
<td valign="top" width="213">Anwendung</td>
<td valign="top" width="49">1</td>
</tr>
<tr>
<td valign="top" width="44">2</td>
<td valign="top" width="78">1</td>
<td valign="top" width="213">Hilfsdaten</td>
<td valign="top" width="49">2</td>
</tr>
<tr>
<td valign="top" width="44">3</td>
<td valign="top" width="78">1</td>
<td valign="top" width="213">System</td>
<td valign="top" width="49">3</td>
</tr>
<tr>
<td valign="top" width="44">8</td>
<td valign="top" width="78">1</td>
<td valign="top" width="213">Berichte</td>
<td valign="top" width="49">1</td>
</tr>
<tr>
<td valign="top" width="44">5</td>
<td valign="top" width="78">2</td>
<td valign="top" width="213">Währung</td>
<td valign="top" width="49">3</td>
</tr>
<tr>
<td valign="top" width="44">6</td>
<td valign="top" width="78">2</td>
<td valign="top" width="213">Buchungsgründe</td>
<td valign="top" width="49">1</td>
</tr>
<tr>
<td valign="top" width="44">7</td>
<td valign="top" width="78">2</td>
<td valign="top" width="213">Kostenstellen</td>
<td valign="top" width="49">2</td>
</tr>
<tr>
<td valign="top" width="44">4</td>
<td valign="top" width="78">3</td>
<td valign="top" width="213">Anmelden</td>
<td valign="top" width="49">1</td>
</tr>
</tbody>
</table>
<p>(Abbildung 1: Unsortierte Basistabelle)</p>
<div class="wp_syntax">
<div class="code">
<pre class="bash" style="font-family:monospace;">
SELECT LEVEL
     , rpad(' ',LEVEL) || label
  FROM menu_tree a
 START WITH a.parent_id IS NULL
       CONNECT BY PRIOR a.id= a.parent_id
 ORDER siblings BY sort
</pre>
</div>
</div>
<p><font face="Courier New"></font></p>
<table border="1" cellspacing="0" cellpadding="2" width="365">
<tbody>
<tr>
<td valign="top" width="59">LEVEL</td>
<td valign="top" width="248">LABEL</td>
<td valign="top" width="56">SORT</td>
</tr>
<tr>
<td valign="top" width="66">1</td>
<td valign="top" width="251">Anwendung</td>
<td valign="top" width="61">1</td>
</tr>
<tr>
<td valign="top" width="70">2</td>
<td valign="top" width="246"> Berichte</td>
<td valign="top" width="65">1</td>
</tr>
<tr>
<td valign="top" width="73">2</td>
<td valign="top" width="241"> Hilfsdaten</td>
<td valign="top" width="68">2</td>
</tr>
<tr>
<td valign="top" width="75">3</td>
<td valign="top" width="238">&#160; Buchungsgründe</td>
<td valign="top" width="70">1</td>
</tr>
<tr>
<td valign="top" width="76">3</td>
<td valign="top" width="236">&#160; Kostenstellen</td>
<td valign="top" width="71">2</td>
</tr>
<tr>
<td valign="top" width="77">3</td>
<td valign="top" width="235">&#160; Währung</td>
<td valign="top" width="71">3</td>
</tr>
<tr>
<td valign="top" width="77">2</td>
<td valign="top" width="235"> System</td>
<td valign="top" width="71">3</td>
</tr>
<tr>
<td valign="top" width="77">3</td>
<td valign="top" width="235">&#160; Anmelden</td>
<td valign="top" width="71">1</td>
</tr>
</tbody>
</table>
<p>(Abbildung 2: Sortiertes Ergebnis)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.entwicklungsgedanken.de/2010/04/05/sortierung-von-hierachischen-bumen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to install postgres 8.4 on Debian 5 (lenny)</title>
		<link>http://www.entwicklungsgedanken.de/2010/03/06/how-to-install-postgres-8-4-on-debian-5-lenny/</link>
		<comments>http://www.entwicklungsgedanken.de/2010/03/06/how-to-install-postgres-8-4-on-debian-5-lenny/#comments</comments>
		<pubDate>Sat, 06 Mar 2010 13:28:23 +0000</pubDate>
		<dc:creator>Eric Bartels</dc:creator>
				<category><![CDATA[SQL]]></category>
		<category><![CDATA[Webdevelopment]]></category>
		<category><![CDATA[apt]]></category>
		<category><![CDATA[backport]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[postgres]]></category>

		<guid isPermaLink="false">http://www.entwicklungsgedanken.de/?p=385</guid>
		<description><![CDATA[Because I didn&#8217;t found this information in one place I&#8217;m writing this quick &#8220;guide&#8221; on how to install PostgreSQL 8.4.x on Debian 5.x &#8220;lenny&#8221;. Debian lenny stable packages are bundled with Postgres 8.3.x but thanks to Debian Backports the newer Postgres version is available for lenny. Simply do it Add the backports-sources (/etc/apt/sources.list) and update [...]]]></description>
			<content:encoded><![CDATA[<p>Because I didn&#8217;t found this information in one place I&#8217;m writing this quick &#8220;guide&#8221; on how to install <a href="http://www.postgresql.org/docs/8.4/interactive/index.html">PostgreSQL 8.4.x</a> on <a href="http://www.debian.org/">Debian 5.x &#8220;lenny&#8221;</a>.</p>
<p>Debian lenny stable packages are bundled with Postgres 8.3.x but thanks to Debian <a href="http://www.backports.org/dokuwiki/doku.php">Backports</a> the newer Postgres version is available for lenny.</p>
<h3>Simply do it</h3>
<p>Add the backports-sources (/etc/apt/sources.list) and update (apt-get update)</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">deb http:<span style="color: #000000; font-weight: bold;">//</span>www.backports.org<span style="color: #000000; font-weight: bold;">/</span>debian lenny-backports main contrib non-free</pre></div></div>

<p>Install postgres</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #660033;">-t</span> lenny-backports <span style="color: #c20cb9; font-weight: bold;">install</span> postgresql-<span style="color: #000000;">8.4</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.entwicklungsgedanken.de/2010/03/06/how-to-install-postgres-8-4-on-debian-5-lenny/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Updating existing lookup fields in SharePoint</title>
		<link>http://www.entwicklungsgedanken.de/2010/02/01/updating-existing-lookup-fields-in-sharepoint/</link>
		<comments>http://www.entwicklungsgedanken.de/2010/02/01/updating-existing-lookup-fields-in-sharepoint/#comments</comments>
		<pubDate>Mon, 01 Feb 2010 11:39:50 +0000</pubDate>
		<dc:creator>Eric Bartels</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[SharePoint-Development]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[lookup]]></category>
		<category><![CDATA[Regex]]></category>
		<category><![CDATA[SchemaXml]]></category>
		<category><![CDATA[update]]></category>

		<guid isPermaLink="false">http://www.entwicklungsgedanken.de/2010/02/01/updating-existing-lookup-fields-in-sharepoint/</guid>
		<description><![CDATA[Creating lookup-fields only via XML-Definition is not possible. You need the ID of the Web hosting the list and the ID of the list hosting the data the lookup field is connected to. This information can only be retrieved when both entities are created… Object model?! When looking into the SPFieldLookup-class you find the properties [...]]]></description>
			<content:encoded><![CDATA[<p>Creating lookup-fields only via XML-Definition is not possible. You need the ID of the Web hosting the list and the ID of the list hosting the data the lookup field is connected to. This information can only be retrieved when both entities are created…</p>
<h3>Object model?!</h3>
<p>When looking into the <a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spfieldlookup.aspx">SPFieldLookup</a>-class you find the properties LookupField, LookupList and LookupWebId. LookupWebId and LookupField can easily be set via the object model. The documentation says that <a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spfieldlookup.lookuplist.aspx">LookupList is read and writeable</a> which is not true. Setting LookupList throws an exception stating out “Cannot change the lookup list of the lookup field.”.</p>
<h3>SchemaXml and Regex to the rescue</h3>
<p>The <a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spfield.schemaxml.aspx">SchemaXml-property</a> of a SPField can be used to manipulate the LookupList. One stumbling block is that you do not know the Guid of the LookupList currently stored in the schema. Even if you define a Guid inside your xml-field-definition SharePoint puts in an other Guid. Here a simple regular expression comes to help.</p>
<p><strong>The code for connecting a site-column with a list somewhere in some web:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #008080; font-style: italic;">// Declarations (myWeb is the context given by a feature receiver scoped &quot;web&quot;)</span>
var rx <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> Regex<span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;List=<span style="color: #008080; font-weight: bold;">\&quot;</span>([^<span style="color: #008080; font-weight: bold;">\&quot;</span>]*)<span style="color: #008080; font-weight: bold;">\&quot;</span>&quot;</span>, RegexOptions.<span style="color: #0000FF;">IgnoreCase</span> <span style="color: #008000;">|</span> RegexOptions.<span style="color: #0000FF;">ECMAScript</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
var root <span style="color: #008000;">=</span> myWeb.<span style="color: #0000FF;">Site</span>.<span style="color: #0000FF;">RootWeb</span><span style="color: #008000;">;</span>
&nbsp;
<span style="color: #008080; font-style: italic;">// myListInstance is an instance of a SPList existing somewhere</span>
var lookupField <span style="color: #008000;">=</span> <span style="color: #000000;">&#40;</span>SPFieldLookup<span style="color: #000000;">&#41;</span>root.<span style="color: #0000FF;">Fields</span><span style="color: #000000;">&#91;</span><span style="color: #666666;">&quot;MyLookupField&quot;</span><span style="color: #000000;">&#93;</span><span style="color: #008000;">;</span>
var xml <span style="color: #008000;">=</span> lookupField.<span style="color: #0000FF;">SchemaXml</span><span style="color: #008000;">;</span>
xml <span style="color: #008000;">=</span> rx.<span style="color: #0000FF;">Replace</span><span style="color: #000000;">&#40;</span>xml, <span style="color: #FF0000;">String</span>.<span style="color: #0000FF;">Format</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;List=<span style="color: #008080; font-weight: bold;">\&quot;</span>{0}<span style="color: #008080; font-weight: bold;">\&quot;</span>&quot;</span>, myListInstance.<span style="color: #0000FF;">ID</span>.<span style="color: #0000FF;">ToString</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;B&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
lookupField.<span style="color: #0000FF;">SchemaXml</span> <span style="color: #008000;">=</span> xml<span style="color: #008000;">;</span>
<span style="color: #008080; font-style: italic;">// Do not call update here!</span>
<span style="color: #008080; font-style: italic;">// Quote from MSDN &quot;Do not call the Update method when using the SchemaXml  property to modify a field.&quot;</span>
&nbsp;
<span style="color: #008080; font-style: italic;">// Fetch the field again and apply the web-id</span>
var lookupFieldReFetch <span style="color: #008000;">=</span> <span style="color: #000000;">&#40;</span>SPFieldLookup<span style="color: #000000;">&#41;</span>root.<span style="color: #0000FF;">Fields</span><span style="color: #000000;">&#91;</span><span style="color: #666666;">&quot;MyLookupField&quot;</span><span style="color: #000000;">&#93;</span><span style="color: #008000;">;</span>
lookupFieldReFetch.<span style="color: #0000FF;">LookupWebId</span> <span style="color: #008000;">=</span> myWeb.<span style="color: #0000FF;">ID</span><span style="color: #008000;">;</span>
lookupFieldReFetch.<span style="color: #0000FF;">LookupField</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;Title&quot;</span><span style="color: #008000;">;</span>
lookupFieldReFetch.<span style="color: #0000FF;">Update</span><span style="color: #000000;">&#40;</span><span style="color: #0600FF;">true</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></pre></div></div>

<p>This problem still persists in the beta of SharePoint 2010. I hope this will get fixed in the RTM. <a href="http://pholpar.wordpress.com/2010/01/26/updating-sharepoint-lookup-and-user-field-values/">Creating a lookup-field-connection</a> is far more easy by the way …</p>
]]></content:encoded>
			<wfw:commentRss>http://www.entwicklungsgedanken.de/2010/02/01/updating-existing-lookup-fields-in-sharepoint/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
