<?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>Andy's Blog: Application Express etc.</title>
	<atom:link href="http://atulley.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://atulley.wordpress.com</link>
	<description>SELECT * FROM RANDOM.stuff WHERE subject IN ('Application Express','Oracle','PL/SQL','SQL') AND is_worth_blogging_about IN ('YES','MAYBE','DOUBTFUL');</description>
	<lastBuildDate>Thu, 17 Nov 2011 12:46:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='atulley.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Andy's Blog: Application Express etc.</title>
		<link>http://atulley.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://atulley.wordpress.com/osd.xml" title="Andy&#039;s Blog: Application Express etc." />
	<atom:link rel='hub' href='http://atulley.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Using Dual to reduce function calls (and getting your 5-a-day)</title>
		<link>http://atulley.wordpress.com/2011/02/07/using-dual-to-reduce-function-calls-and-getting-your-5-a-day/</link>
		<comments>http://atulley.wordpress.com/2011/02/07/using-dual-to-reduce-function-calls-and-getting-your-5-a-day/#comments</comments>
		<pubDate>Mon, 07 Feb 2011 17:33:06 +0000</pubDate>
		<dc:creator>Andrew Tulley</dc:creator>
				<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://atulley.wordpress.com/?p=152</guid>
		<description><![CDATA[Reducing function calls with Scalar Subquery Caching.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=atulley.wordpress.com&amp;blog=907573&amp;post=152&amp;subd=atulley&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://atulley.files.wordpress.com/2011/02/banana_guard.jpg"><img class="alignleft size-medium wp-image-154" title="Banana Guard" src="http://atulley.files.wordpress.com/2011/02/banana_guard.jpg?w=108&#038;h=76" alt="" width="108" height="76" /></a><span style="text-decoration:underline;"> </span></p>
<h3>An introduction to an interesting feature of<br />
Oracle SQL through the medium of fruit&#8230;</h3>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><span style="text-decoration:underline;">Make a FRUITS table.</span></p>
<p><code>CREATE TABLE fruits (fruit_name varchar2(30));</code></p>
<p><span style="text-decoration:underline;">Put in 5 bananas, 7 apples and 3 blueberries.</span><br />
<code>INSERT INTO fruits VALUES ('banana');<br />
INSERT INTO fruits VALUES ('banana');<br />
INSERT INTO fruits VALUES ('banana');<br />
INSERT INTO fruits VALUES ('banana');<br />
INSERT INTO fruits VALUES ('banana');<br />
INSERT INTO fruits VALUES ('apple');<br />
INSERT INTO fruits VALUES ('apple');<br />
INSERT INTO fruits VALUES ('apple');<br />
INSERT INTO fruits VALUES ('apple');<br />
INSERT INTO fruits VALUES ('apple');<br />
INSERT INTO fruits VALUES ('apple');<br />
INSERT INTO fruits VALUES ('apple');<br />
INSERT INTO fruits VALUES ('blueberry');<br />
INSERT INTO fruits VALUES ('blueberry');<br />
INSERT INTO fruits VALUES ('blueberry');</code></p>
<p><span style="text-decoration:underline;">Create a sequence for keeping track of the number of times our function below is called.</span><br />
<code>CREATE SEQUENCE seq START WITH 1;</code></p>
<p><span style="text-decoration:underline;">Make our function which returns a fruit&#8217;s colour</span> (and increments our sequence each time it runs).<br />
<code>CREATE OR REPLACE FUNCTION get_colour (p_fruit_name IN varchar2)</code><br />
<code>RETURN varchar2<br />
IS<br />
l_num number;<br />
BEGIN<br />
SELECT seq.nextval INTO l_num FROM dual;</code></p>
<p><code> CASE p_fruit_name<br />
WHEN 'banana' THEN RETURN 'yellow';<br />
WHEN 'apple' THEN RETURN 'green';<br />
WHEN 'blueberry' THEN RETURN 'blue';<br />
END CASE;<br />
END get_colour;<br />
/</code></p>
<p><span style="text-decoration:underline;">Get the colour of each fruit in our table.</span><br />
<code>SELECT get_colour(fruit_name) FROM fruits;</code></p>
<p><em><strong>QUESTION ONE: What will the following return?</strong></em><br />
<code>SELECT seq.nextval FROM dual;</code></p>
<p>Well, there are 15 rows in our table so we&#8217;d expect the function to have run 15 times. And indeed it has: seq.nextval will show a value of 16.</p>
<p><span style="text-decoration:underline;">Now, let&#8217;s reset the sequence for the next experiment.</span><br />
<code>DROP SEQUENCE seq;<br />
CREATE SEQUENCE seq START WITH 1;</code></p>
<p><span style="text-decoration:underline;">And again get the colour of all of our fruits using our function but this time wrapping it inside a SELECT FROM dual.</span><br />
<code>SELECT (SELECT get_colour(fruit_name) FROM dual)<br />
FROM fruits;</code></p>
<p><strong><em>QUESTION TWO: What will the following return now?</em></strong><br />
<code>SELECT seq.nextval FROM dual;</code></p>
<p>Well, we might be tempted to think that the function would have run 15 times as before and hence our sequence&#8217;s nextval would now be 16, as before. However, this is not the case. You&#8217;ll find the value returned is in fact <strong>4</strong>, meaning that the function ran <strong>3</strong> times.</p>
<p><em><strong>What happened there?</strong></em><br />
How can the function have run only 3 times if we gave it 15 bits of data to process (i.e. 15 fruits, one for each row from our table) and it returned the correct answer in each case?</p>
<p>The answer is <strong>Scalar Subquery Caching</strong> whereby the result of a &#8220;<em>SELECT some_function(x) FROM dual&#8221;</em> will be remembered for <em>x</em> as soon as it is run once. Hence, the function need only be run for each of the <em>different</em> fruits in the table and since we have only 3 different fruits (blueberry, apple and banana), the function is only run 3 times.</p>
<p>Tom Kyte talks about it <a href="http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:2683853500346598211">here</a>.</p>
<p>Nifty, eh?</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/atulley.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/atulley.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/atulley.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/atulley.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/atulley.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/atulley.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/atulley.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/atulley.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/atulley.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/atulley.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/atulley.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/atulley.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/atulley.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/atulley.wordpress.com/152/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=atulley.wordpress.com&amp;blog=907573&amp;post=152&amp;subd=atulley&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://atulley.wordpress.com/2011/02/07/using-dual-to-reduce-function-calls-and-getting-your-5-a-day/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a6739a93530503423b488917f43cf9ae?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">Andy</media:title>
		</media:content>

		<media:content url="http://atulley.files.wordpress.com/2011/02/banana_guard.jpg?w=300" medium="image">
			<media:title type="html">Banana Guard</media:title>
		</media:content>
	</item>
		<item>
		<title>ChangeCase: A Simple Apex 4.0 Plugin</title>
		<link>http://atulley.wordpress.com/2010/07/16/changecase-a-simple-apex-4-0-plugin/</link>
		<comments>http://atulley.wordpress.com/2010/07/16/changecase-a-simple-apex-4-0-plugin/#comments</comments>
		<pubDate>Fri, 16 Jul 2010 15:24:39 +0000</pubDate>
		<dc:creator>Andrew Tulley</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://atulley.wordpress.com/?p=137</guid>
		<description><![CDATA[Creating a simple Apex 4 Item Plugin to allow the contents of a Text Field to be automatically uppercased or lowercased.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=atulley.wordpress.com&amp;blog=907573&amp;post=137&amp;subd=atulley&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>A foray into Plug-Ins</strong></p>
<p><a href="http://atulley.files.wordpress.com/2010/07/13-amp-plug.jpg"><img class="alignleft size-full wp-image-142" title="13-amp-plug" src="http://atulley.files.wordpress.com/2010/07/13-amp-plug.jpg?w=130&#038;h=130" alt="" width="130" height="130" /></a>To educate myself in the ways of the new Apex 4.0 Plug-Ins feature, I decided to create a simple item Plug-In which automatically converts all the text entered into the item either to uppercase or to lowercase, depending on which option the developer chooses. I&#8217;m making it available here not so much because I think it will be a useful Plug-In (though perhaps it might be if your requirement is very simple) but rather in the hope that it might be helpful to anyone else looking at Plug-Ins for the first time. I have heavily commented the code to explain what each bit is doing.</p>
<p><strong>See it in action</strong></p>
<p>A working example of this plugin can be seen <a title="Example of ChangeCase Plugin" href="http://apex.oracle.com/pls/apex/f?p=45649">here</a>.</p>
<p><strong>Download and install</strong></p>
<p>The plugin itself can be downloaded <a href="http://andrew.tulley.co.uk/blogfiles/item_type_plugin_uk_co_tulley_changecase.sql">here</a>.</p>
<p>Once you have downloaded the Plug-In, you can install it by going to Shared Components &gt; Plug-Ins &gt; Import and following the prompt. You will then be able to create ChangeCase items in your application, choosing whether you want the contents to be automatically uppercased or lowercased.</p>
<p><strong>Creating it from scratch</strong></p>
<p>If, for the hell of it, you want to create this Plug-In from scratch as opposed to just downloading and installing it you can do so by following these steps.</p>
<ol>
<li>Within Application Builder go to Shared Components &gt; Plug-ins and click &#8220;Create &gt;&#8221;.</li>
<li>Specify the following details and then click &#8220;Create&#8221;:<br />
<span style="text-decoration:underline;"><br />
Name</span>: ChangeCase<br />
<span style="text-decoration:underline;">Internal Name</span>: uk.co.tulley.changecase (or change this to be a universally unique name based on your domain name)<br />
<span style="text-decoration:underline;">Type</span>: Item<br />
<span style="text-decoration:underline;">PL/SQL Code</span>: Paste in the contents of <a href="http://andrew.tulley.co.uk/blogfiles/ChangeCase_Plugin_PLSQL_Code.txt">this file</a>. This contains two PLSQL functions (render_changecase and validate_changecase which we reference in the Render Function Name and Validation Function Name properties of this Plug-In). This PL/SQL code is heavily commented so should hopefully be fairly self-explanatory.<br />
<span style="text-decoration:underline;">Render Function Name</span>: render_changecase<br />
<span style="text-decoration:underline;">Validation Function Name</span>: validate_changecase<br />
<span style="text-decoration:underline;">Standard Attributes</span>: Tick the checkbox labelled &#8220;Is Visible Widget&#8221;. If you do not tick this checkbox then there will be no option to specify a Label for our ChangeCase Item Plugin when we create an instance of it in our application. Since this is essentially just a slightly-modified Text Field, we certainly want the ability to specify a label.</li>
<li>Click &#8220;Custom Attributes&#8221;. When we create a new instance of our new Plug-In, we want to be able to decide whether we want the contents to be automatically uppercased or lowercased so we create a custom attribute here to allow that decision to be made.</li>
<li>Click &#8220;Add Attribute&#8221;.</li>
<li>Specify the following details and then click &#8220;Create&#8221;.<br />
<span style="text-decoration:underline;"><br />
Scope</span>: Component<br />
<span style="text-decoration:underline;"> Attribute</span>: 1<br />
<span style="text-decoration:underline;"> Label</span>: Case Alteration Option<br />
<span style="text-decoration:underline;"> Type</span>: Select List<br />
<span style="text-decoration:underline;"> Required</span>: Yes<br />
<span style="text-decoration:underline;"> Default Value</span>: UPPER<br />
<span style="text-decoration:underline;"> Add Value button in List of Values Section</span>: Create two entries. One with a Display Value of &#8220;Uppercase&#8221; &amp; a Return Value of &#8220;UPPER&#8221;; and the other with a Display Value of &#8220;Lowercase&#8221; and a Return Value of &#8220;LOWER&#8221;.</li>
<li>We want the value entered into any instance of our new Plug-In Item to be either automatically uppercased or lowercased. We want this to happen client-side so for this we need some Javascript. That very simple Javascript can be found in <a href="http://andrew.tulley.co.uk/blogfiles/changecase.js">this file</a>. Download this file to your computer.</li>
<li>Back in Application Builder, click &#8220;Files&#8221; and then the &#8220;Upload New File&#8221; button.</li>
<li>Browse for the changecase.js file that you just downloaded and then click &#8220;Upload&#8221;.</li>
<li>Finally, click &#8220;Apply Changes&#8221;.</li>
</ol>
<p>You will now be able to create ChangeCase items in your pages where you&#8217;ll be able to specify, under settings, whether you want the content automatically uppercased or lowercased.</p>
<p><a href="http://atulley.files.wordpress.com/2010/07/changecaseplugin_screenshot1.jpg"><img class="alignleft size-medium wp-image-140" title="Ability to create ChangeCase items" src="http://atulley.files.wordpress.com/2010/07/changecaseplugin_screenshot1.jpg?w=300&#038;h=84" alt="" width="300" height="84" /></a></p>
<p><a href="http://atulley.files.wordpress.com/2010/07/changecaseplugin_screenshot2.jpg"><img class="alignleft size-full wp-image-141" title="Ability to choose whether you want text to be automatically uppercased or lowercased" src="http://atulley.files.wordpress.com/2010/07/changecaseplugin_screenshot2.jpg?w=260&#038;h=73" alt="" width="260" height="73" /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/atulley.wordpress.com/137/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/atulley.wordpress.com/137/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/atulley.wordpress.com/137/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/atulley.wordpress.com/137/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/atulley.wordpress.com/137/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/atulley.wordpress.com/137/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/atulley.wordpress.com/137/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/atulley.wordpress.com/137/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/atulley.wordpress.com/137/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/atulley.wordpress.com/137/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/atulley.wordpress.com/137/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/atulley.wordpress.com/137/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/atulley.wordpress.com/137/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/atulley.wordpress.com/137/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=atulley.wordpress.com&amp;blog=907573&amp;post=137&amp;subd=atulley&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://atulley.wordpress.com/2010/07/16/changecase-a-simple-apex-4-0-plugin/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a6739a93530503423b488917f43cf9ae?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">Andy</media:title>
		</media:content>

		<media:content url="http://atulley.files.wordpress.com/2010/07/13-amp-plug.jpg" medium="image">
			<media:title type="html">13-amp-plug</media:title>
		</media:content>

		<media:content url="http://atulley.files.wordpress.com/2010/07/changecaseplugin_screenshot1.jpg?w=300" medium="image">
			<media:title type="html">Ability to create ChangeCase items</media:title>
		</media:content>

		<media:content url="http://atulley.files.wordpress.com/2010/07/changecaseplugin_screenshot2.jpg" medium="image">
			<media:title type="html">Ability to choose whether you want text to be automatically uppercased or lowercased</media:title>
		</media:content>
	</item>
		<item>
		<title>Free Full UK Postcode Data</title>
		<link>http://atulley.wordpress.com/2010/07/02/free-full-uk-postcode-data/</link>
		<comments>http://atulley.wordpress.com/2010/07/02/free-full-uk-postcode-data/#comments</comments>
		<pubDate>Fri, 02 Jul 2010 09:50:43 +0000</pubDate>
		<dc:creator>Andrew Tulley</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://atulley.wordpress.com/?p=131</guid>
		<description><![CDATA[For a long time the full set of UK Postcode data has been subject to quite a hefty fee. I didn&#8217;t realise until today but, earlier this year, this information was made available by Ordnance Survey free of charge. The data can be downloaded from here (https://www.ordnancesurvey.co.uk/opendatadownload/products.html). Just tick the checkbox entitled Code-Point Open then [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=atulley.wordpress.com&amp;blog=907573&amp;post=131&amp;subd=atulley&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft" style="margin-left:5px;margin-right:5px;" title="Ordnance Survey Free Postcode Data" src="https://www.ordnancesurvey.co.uk/opendatadownload/images/codepoint.png" alt="Ordnance Survey Free Postcode Data" width="100" height="75" />For a long time the full set of UK Postcode data has been subject to quite a hefty fee. I didn&#8217;t realise until today but, earlier this year, this information was made available by Ordnance Survey free of charge.</p>
<p>The data can be downloaded from here (<a href="https://www.ordnancesurvey.co.uk/opendatadownload/products.html">https://www.ordnancesurvey.co.uk/opendatadownload/products.html</a>).</p>
<p>Just tick the checkbox entitled Code-Point Open then click Next. They then email you a link to the CSV file to download (about 20 mb).</p>
<p>Now, can this data be incorporated into a nifty Apex 4 Plug-in?</p>
<p><strong>The License</strong></p>
<p>The licensing for this data seems pretty open, too, which is good news.</p>
<p>Taken from the Ordnance Survey License found <a href="http://www.ordnancesurvey.co.uk/oswebsite/opendata/licence/index.html">here</a>:</p>
<div id="_mcePaste"><em>You are free to:</em></div>
<div id="_mcePaste"><em>	copy, distribute and transmit the Data;</em></div>
<div id="_mcePaste"><em>	adapt the Data;</em></div>
<div id="_mcePaste"><em>	exploit the Data commercially whether by sub-licensing it, combining it with other data, or by including it in your own product or application.</em></div>
<div><em><br />
</em></div>
<div><strong>A Note on the CSV File</strong></div>
<div><em><strong><br />
</strong></em></div>
<div>In the CSV files that you will download from the link that Ordnance Survey send you, column K is the British National Grid (BNG) X co-ordinate and column L is the BNG Y co-ordinate. You can use http://www.nearby.org.uk for converting the odd co-ordinate backwards and forwards between BNG and Lat/Lon.</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/atulley.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/atulley.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/atulley.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/atulley.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/atulley.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/atulley.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/atulley.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/atulley.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/atulley.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/atulley.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/atulley.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/atulley.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/atulley.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/atulley.wordpress.com/131/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=atulley.wordpress.com&amp;blog=907573&amp;post=131&amp;subd=atulley&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://atulley.wordpress.com/2010/07/02/free-full-uk-postcode-data/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a6739a93530503423b488917f43cf9ae?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">Andy</media:title>
		</media:content>

		<media:content url="https://www.ordnancesurvey.co.uk/opendatadownload/images/codepoint.png" medium="image">
			<media:title type="html">Ordnance Survey Free Postcode Data</media:title>
		</media:content>
	</item>
		<item>
		<title>Converting strings into nonsense</title>
		<link>http://atulley.wordpress.com/2010/07/01/converting-strings-into-nonsense/</link>
		<comments>http://atulley.wordpress.com/2010/07/01/converting-strings-into-nonsense/#comments</comments>
		<pubDate>Thu, 01 Jul 2010 16:28:42 +0000</pubDate>
		<dc:creator>Andrew Tulley</dc:creator>
				<category><![CDATA[ApEx]]></category>
		<category><![CDATA[PL/SQL]]></category>

		<guid isPermaLink="false">http://atulley.wordpress.com/?p=123</guid>
		<description><![CDATA[Masking text with PLSQL<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=atulley.wordpress.com&amp;blog=907573&amp;post=123&amp;subd=atulley&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>&nbsp;</p>
<p><img class="alignleft size-full wp-image-171" style="margin:3px 4px;" title="mrnonsense" src="http://atulley.files.wordpress.com/2010/07/mrnonsense.jpg?w=160&#038;h=198" alt="" width="160" height="198" /></p>
<p>&nbsp;</p>
<p><strong>Most of the time you want to make sense.</strong></p>
<p>Sometimes, however, you want to make nonsense out of sense.</p>
<p>What gibberish is this? Good question.</p>
<p>The following script allows you to convert any string that you pass it into a string of exactly the same form but where each word has been replaced with another random word of the same length. Punctuation and carriage returns are retained.</p>
<p>&nbsp;</p>
<p><strong>Why would this be useful?</strong></p>
<p>If you have some data, perhaps stored in a table, which is sensitive in some way. You might want to use that data on an insecure environment for testing or some other purpose. You can&#8217;t put the data on there directly because of security concerns. So one solution would be to alter the data so that it was no longer sensitive but yet retained the same fundamental characteristics (in terms of word length etc.) as the original data.</p>
<p><strong>The script</strong></p>
<p>The script makes use of the <span style="font-family:Consolas, Monaco, 'Courier New', Courier, monospace;line-height:18px;font-size:12px;white-space:pre;">wwv_flow_dictionary$ </span>table in your Apex schema so you&#8217;ll need to make sure the schema you&#8217;re creating this function in has SELECT rights on that table. You&#8217;ll also need to  change &#8220;APEX_030200&#8243; below if you&#8217;re using a different version of Apex.</p>
<pre><strong>
<div id="_mcePaste"><span style="font-weight:normal;">CREATE OR REPLACE FUNCTION mask_string (p_input VARCHAR2)
   RETURN VARCHAR2
IS
   l_output   VARCHAR2 (4000);
   y          NUMBER   := 1;

   FUNCTION get_word_of_length (p_word_length IN NUMBER)
      RETURN VARCHAR2
   IS
      l_word_output   VARCHAR2 (1000);
   BEGIN
      SELECT words
        INTO l_word_output
        FROM (SELECT   words
                  FROM apex_030200.wwv_flow_dictionary$
                 WHERE LENGTH (words) = p_word_length
              ORDER BY DBMS_RANDOM.VALUE ())
       WHERE ROWNUM = 1;

      RETURN l_word_output;
   END get_word_of_length;

BEGIN
   DBMS_RANDOM.SEED (TO_NUMBER (TO_CHAR (SYSDATE, 'ddss')));
   l_output := '~' || REPLACE (p_input, ' ', '~~') || '~';

   FOR x IN 1 .. 22
   LOOP
      y := 1;

      LOOP
         EXIT WHEN REGEXP_INSTR (
             l_output,
             '[~\.,;!\?"''-:[:cntrl:]][^~\.,;!\?"''-:[:cntrl:]]{'
             || x
             || '}[~\.,;!\?"''-:[:cntrl:]]',
             1,
             y
            ) = 0;

         l_output :=
            REGEXP_REPLACE (
                l_output,
                '([~\.,;!\?"''-:[:cntrl:]])[^~\.,;!\?"''-:[:cntrl:]]{'
                || x
                || '}([~\.,;!\?"''-:[:cntrl:]])',
                '\1'
                || get_word_of_length (x)
                || '\2',
                1,
                y
               );

         y := y + 1;
      END LOOP;
   END LOOP;

   l_output := REPLACE (l_output, '~~', ' ');
   l_output := SUBSTR (l_output, 2, 99999);
   l_output := SUBSTR (l_output, 1, LENGTH (l_output) - 1);

   RETURN l_output;

END mask_string;
/</span></div>
<div id="_mcePaste"><span style="font-weight:normal;">
</span></div>

<span style="font-weight:normal;"><strong> </strong></span>
<strong>
<span style="font-family:Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;font-weight:normal;line-height:19px;white-space:normal;font-size:13px;"><strong>Example</strong></span>
</strong>
<span style="font-weight:normal;"><strong> </strong></span>
<strong>
<pre><span style="font-family:Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;font-weight:normal;line-height:19px;white-space:normal;font-size:13px;"><strong>
<pre>SELECT mask_string(q'!
To be or not to be that is the question:
Whether 'tis nobler in the mind to suffer
The slings and arrows of outrageous fortune,
Or to take arms against a sea of troubles
And, by opposing, end them. To die, to sleep
No more  and by a sleep to say we end
The heartache and the thousand natural shocks
That flesh is heir to  ëtis a consummation
Devoutly to be wished!') from dual;

Result:
oh ad ma hoc pi Al toad OK sod realists:
tinning 'how topple vi nix ruin to gritty
cam gang's Vic arrows as angiosperm statues,
OK ad pals swab brassed a cow ex superior
jaw, nm treadled, Amy keel. on jut, us repay
go dyed  MBA Io x purer DB hew nd cue
The cannister vis lab Broadway snuffle shrove
Liss funny Io hone ix  Vega a ungenerously
capstans ax be surfer</pre>
<p></strong> </span></pre>
<p></strong></strong></pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/atulley.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/atulley.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/atulley.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/atulley.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/atulley.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/atulley.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/atulley.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/atulley.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/atulley.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/atulley.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/atulley.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/atulley.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/atulley.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/atulley.wordpress.com/123/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=atulley.wordpress.com&amp;blog=907573&amp;post=123&amp;subd=atulley&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://atulley.wordpress.com/2010/07/01/converting-strings-into-nonsense/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a6739a93530503423b488917f43cf9ae?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">Andy</media:title>
		</media:content>

		<media:content url="http://atulley.files.wordpress.com/2010/07/mrnonsense.jpg" medium="image">
			<media:title type="html">mrnonsense</media:title>
		</media:content>
	</item>
		<item>
		<title>Apex and SSO blank white screen problem: SOLVED</title>
		<link>http://atulley.wordpress.com/2010/06/18/apex-and-sso-blank-white-screen-problem-solved/</link>
		<comments>http://atulley.wordpress.com/2010/06/18/apex-and-sso-blank-white-screen-problem-solved/#comments</comments>
		<pubDate>Fri, 18 Jun 2010 16:20:34 +0000</pubDate>
		<dc:creator>Andrew Tulley</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[ApEx]]></category>

		<guid isPermaLink="false">http://atulley.wordpress.com/?p=112</guid>
		<description><![CDATA[Having configured Apex with SSO, Apex will sometimes present a blank white screen when attempting to login if the login screen itself has been sat idle for more than a few minutes. This is an attempt at explaining and solving this problem<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=atulley.wordpress.com&amp;blog=907573&amp;post=112&amp;subd=atulley&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>Apex and SSO: The White Screen Problem</strong></p>
<p><img class="alignleft" title="Unicorn Meat" src="http://www.thinkgeek.com/images/products/other/canned_unicorn_meat.jpg" alt="Unicorn Meat" width="168" height="126" />You may have configured Apex to use Oracle Single Sign On (SSO) as your authentication scheme using instructions such as those found <a title="How to configure Apex to use SSO" href="http://www.oracle.com/technology/products/database/application_express/howtos/sso_partner_app.html" target="_blank">here</a>. If you have, you may have noticed that if you leave the login screen (i.e. login.jsp) sat idly displayed in your browser for more than a certain amount of time (I&#8217;ve not done precise timings but it seems to be something like 5 minutes) and then try to login, when you click the Login button you&#8217;re presented with a blank white screen and nothing more.</p>
<p>Below, I offer a solution to this problem.</p>
<p><strong>Why it happens</strong></p>
<p>Before we talk about how to fix this, let me describe what I think the problem is here&#8230;</p>
<p>When you first request access to your Apex application which has SSO set as its authentication scheme, Apex generates a brand new shiny Apex session id for you and then redirects you to the SSO login screen (login.jsp be default but you may have modified this to be your own custom jsp) for you to enter your credentials. This jsp contains a hidden item with a name of site2pstoretoken (a name mandated by SSO). The value of this hidden item is a long string of seemingly random characters (V1.2~75D127345~6a5DDF88CFDCE765FBEF&#8230;). This string is in fact an encoded representation of various bits of data. The important bit of data for us which is encoded in this long string is the URL that SSO should forward us to when we have clicked the Login button and been successfully authenticated by SSO. The actual URL that is encoded in this string which SSO will try to forward us to is:</p>
<p>http://server/pls/apex/f?p=100:10:12345678</p>
<p>Where server and pls/apex and 100 and 10 are replaced by the relevant server name, DAD, application number and page number respectively. The crucial bit is the session id at the end (12345678 in the example). This will be replaced by the brand new shiny Apex session ID that Apex assigned to us. How did this URL get encoded into site2pstoretoken? It was passed when Apex originally redirected us to SSO.</p>
<p><strong>So site2pstoretoken contains a URL to forward to. So what?</strong></p>
<p>Good question. It seems that the brand new shiny Apex session ID which was originally assigned to us has the ability to &#8220;time out&#8221;. Once it has &#8220;timed out&#8221;, if you click Login on the login.jsp page, SSO will try to redirect you to f?p=100:10:12345678 (*). Since the session has &#8220;timed out&#8221;, Apex shows you just a blank white screen.</p>
<p>(*) Note: To be precise, the login.jsp submits to /sso/auth which in turn redirects you to /pls/apex/wwv_flow_custom_auth_sso.process_success. In the redirection to wwv_flow_custom_auth_sso.process_success, the site2pstoretoken is included in the url in the &#8220;urlc&#8221; parameter (e.g. /pls/apex/wwv_flow_custom_auth_sso.process_success?urlc=V1.2~75D127345~6a5DDF88CFDCE765FBEF&#8230;). It is this process_success procedure which appears to display the blank white screen. For info: the wwv_flow_custom_auth_sso is created when you ran custom_auth_sso.sql (see <a href="http://www.oracle.com/technology/products/database/application_express/howtos/sso_partner_app.html" target="_blank">step 5 in the instructions for setting up Apex with SSO</a>). I am not sure exactly what the process_success procedure is checking to cause it to display a white screen (the code is wrapped so can&#8217;t be inspected). The only thing I can hazard a guess at is that it looks in the &lt;Apex schema&gt;.wwv_flow_session$ table and if the ON_NEW_INSTANCE_FIRED_FOR column has not been populated within a certain amount of time since the session was created (CREATED_ON column) then it shows a white screen. (The ON_NEW_INSTANCE_FIRED column I&#8217;ve noticed is only populated once you actually access a page of your application. Just being redirected to SSO does not populate it.)</p>
<p><strong>Anyway, how do we fix it?</strong></p>
<p>So even though we can&#8217;t tell exactly the reason why wwv_flow_custom_auth_sso.process_success displays a white screen if you attempt to login after the login screen has been idle for some time, we can put in place a workaround to stop this happening. If we were to somehow refresh the site2pstoretoken on the login JSP periodically so that the value it held always represented (in an encoded form) a URL to redirect to which contained a valid, non timed-out Apex session then the problem should disappear. This can be achieved with a bit of Ajax in the login.jsp as follows. The javascript is all contained in +&#8221;&#8230;&#8221; syntax because it&#8217;s all part of one long out.println() call in your JSP. Also notice that I&#8217;ve wrapped 3 of the longer lines (the ones that don&#8217;t begin with a + below) just to fit into the format of this blog. You&#8217;d need to remove these 3 extra line breaks in your jsp :</p>
<pre>+"&lt;script&gt;\n"
+"function getXmlHttpRequestObject() {\n"
+"if (window.XMLHttpRequest) {return new XMLHttpRequest();} \n" 
+"else if(window.ActiveXObject) {return new ActiveXObject('Microsoft.XMLHTTP');} \n" 
+"else { alert('Your browser does not seem to support XMLHTTP.');} \n"
+"}\n"

+"function getToken() { \n"
+"if (receiveReq.readyState == 4 || receiveReq.readyState == 0) { \n"
+"receiveReq.open('GET','<a href="http://devsvripadb8.land.army.r.mil.uk:7777/mongentoken/f?p=1002:10" target="_blank">http://myserver:7777/gentoken/f?p=234:10</a>',true); \n"
+"receiveReq.onreadystatechange = handleGetToken; \n"
+"receiveReq.send(null);"
+"}"
+"}"

+"function handleGetToken() { \n"
+"if (receiveReq.readyState == 4) { \n"
+"processedResponse = receiveReq.responseText;\n"
+"processedResponse = processedResponse.substring(
   processedResponse.indexOf('VALUE=\"')+7); \n"
+"processedResponse = processedResponse.substring(
   0,processedResponse.indexOf('\"')); \n"
+"document.getElementsByName('site2pstoretoken').item(0).value =
   processedResponse; \n"
+"}"
+"}"
+" \n"
+"var receiveReq = getXmlHttpRequestObject(); \n"
+"setInterval('getToken()',60000);"
+"&lt;/script&gt;"</pre>
<p>You&#8217;ll notice above that the Ajax / XMLHTTP request is made to http://myserver:7777/gentoken/f?p=100:10</p>
<p>In this example configuration, the Infrastructure tier (where SSO is installed) is accessed on port 7777. This is the same port on which you will be accessing login.jsp. The apex application is served using MODPLSQL from a different instance of Apache on port 80. So, really, we would need to make a call to server:80/pls/apex/f?p=100:10 but the problem is that browsers do not permit you to make cross-domain Ajax / XMLHTTP requests. Hence, we make the request to the same domain as we are currently on (myserver.domain.com:7777) and add a proxy entry into the Infrastructure&#8217;s httpd.conf file to automatically forward any requests to server:7777/gentoken/ to server:80/pls/apex/. Whether you need to do this kind of configuration of httpd.conf will depend on your setup but for completeness the kind of entry you would need to add to your Infrastructure&#8217;s httpd.conf would be as follows:</p>
<p>&lt;IfModule mod_proxy.c&gt;<br />
ProxyRequests On<br />
ProxyPass /gentoken/ <a href="http://devsvripadb8.land.army.r.mil.uk:80/pls/monitor/" target="_blank">http://server:80/pls/apex/</a><br />
ProxyPassReverse /gentoken/ <a href="http://devsvripadb3.land.army.r.mil.uk:80/pls/monitor/" target="_blank">http://server:80/pls/apex/</a><br />
&lt;/IfModule&gt;</p>
<p><strong>What is all that Javascript doing? </strong></p>
<p>It is essentially requesting access to our Apex application again. Again, Apex realises the application is protected by SSO so assigns us a shiny new Apex session ID and forwards us to SSO. Or rather, it can&#8217;t actually forward <em>us</em> in this case because all this is is an XMLHTTP request, but it does still return HTML which, if we were a browser and not an XMLHTTP request, would cause us to redirect to SSO. Our Javascript scrapes the new site2pstoretoken which is contained in this HTML and assigns it to the value of the hidden site2pstoretoken already contained in our login.jsp. It does this every 60 seconds (well under the time period in which the Apex session ids seem to expire). Hence, whenever you click Login on your JSP, whether you&#8217;ve had it on screen for 30 seconds or 30 days, you will still be submitting a valid encoded Apex URL and will see your app and not just a blank white screen.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/atulley.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/atulley.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/atulley.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/atulley.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/atulley.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/atulley.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/atulley.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/atulley.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/atulley.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/atulley.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/atulley.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/atulley.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/atulley.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/atulley.wordpress.com/112/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=atulley.wordpress.com&amp;blog=907573&amp;post=112&amp;subd=atulley&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://atulley.wordpress.com/2010/06/18/apex-and-sso-blank-white-screen-problem-solved/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a6739a93530503423b488917f43cf9ae?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">Andy</media:title>
		</media:content>

		<media:content url="http://www.thinkgeek.com/images/products/other/canned_unicorn_meat.jpg" medium="image">
			<media:title type="html">Unicorn Meat</media:title>
		</media:content>
	</item>
		<item>
		<title>New URL for this blog</title>
		<link>http://atulley.wordpress.com/2009/03/26/new-url-for-this-blog/</link>
		<comments>http://atulley.wordpress.com/2009/03/26/new-url-for-this-blog/#comments</comments>
		<pubDate>Thu, 26 Mar 2009 21:50:27 +0000</pubDate>
		<dc:creator>Andrew Tulley</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://atulley.wordpress.com/?p=109</guid>
		<description><![CDATA[I recently downloaded and installed the really rather brilliant open source blogging software from wordpress.org. I recommend having a play about with it if you have a web server with PHP and MySQL available to you. This will be the last entry to atulley.wordpress.com. The new home for this blog is: http://andrew.tulley.co.uk<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=atulley.wordpress.com&amp;blog=907573&amp;post=109&amp;subd=atulley&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I recently downloaded and installed the really rather brilliant open source blogging software from wordpress.org. I recommend having a play about with it if you have a web server with PHP and MySQL available to you. This will be the last entry to atulley.wordpress.com. The new home for this blog is:</p>
<h2><a href="http://andrew.tulley.co.uk">http://andrew.tulley.co.uk</a></h2>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/atulley.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/atulley.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/atulley.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/atulley.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/atulley.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/atulley.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/atulley.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/atulley.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/atulley.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/atulley.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/atulley.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/atulley.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/atulley.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/atulley.wordpress.com/109/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=atulley.wordpress.com&amp;blog=907573&amp;post=109&amp;subd=atulley&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://atulley.wordpress.com/2009/03/26/new-url-for-this-blog/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a6739a93530503423b488917f43cf9ae?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">Andy</media:title>
		</media:content>
	</item>
		<item>
		<title>Replacing text in a file using Perl</title>
		<link>http://atulley.wordpress.com/2009/03/15/replacing-text-in-a-file-using-perl/</link>
		<comments>http://atulley.wordpress.com/2009/03/15/replacing-text-in-a-file-using-perl/#comments</comments>
		<pubDate>Sun, 15 Mar 2009 20:00:36 +0000</pubDate>
		<dc:creator>Andrew Tulley</dc:creator>
				<category><![CDATA[Batch Scripting]]></category>
		<category><![CDATA[Perl]]></category>

		<guid isPermaLink="false">http://atulley.wordpress.com/2009/03/15/replacing-text-in-a-file-using-perl/</guid>
		<description><![CDATA[How to replace text in a file using a simple bit of Perl.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=atulley.wordpress.com&amp;blog=907573&amp;post=100&amp;subd=atulley&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img style="margin:5px;" src="http://atulley.files.wordpress.com/2009/03/perl.png?w=104&#038;h=32" alt="" width="104" height="32" align="top" /></p>
<p>I&#8217;ve been working with Windows Batch Scripts recently. The aim has been to create a set of scripts which will automate the installation and configuration of certain applications. I was taking in user input using the SET /P MYVARIABLE=Please enter a value: syntax at the beginning of the batch script and needed to replace existing text in a configuration file with whatever the user entered at the prompt.</p>
<p>You can achieve this, after a fashion, using batch scripts but it&#8217;s a bit of a pain. There is a much better, easier and quicker way to do exactly the same thing using Perl. Chances are you will already have a copy of Perl available if you have the Oracle Database installed. It can all be achieved from one line typed directly into the command prompt (no need even to create a Perl script!). Example below.</p>
<p><strong><span style="font-size:14pt;">The file before</span></strong></p>
<p><img style="margin:5px;" src="http://atulley.files.wordpress.com/2009/03/perl-screenshot-11.jpg?w=338&#038;h=186" alt="" width="338" height="186" /></p>
<p><strong><span style="font-size:14pt;">The Perl command</span></strong></p>
<p><img style="margin:5px;" src="http://atulley.files.wordpress.com/2009/03/perl-screenshot-22.jpg?w=460&#038;h=107" alt="" width="460" height="107" /></p>
<p>This will replace all instances of the string &#8220;banana&#8221; in the file test.txt with the string &#8220;apple&#8221;. The search will be case insensitive. If perl.exe is not already in your PATH, you will need to call it by explicitly specifying the path where it is located or by first adding the directory where it can be found to your PATH environment variable.</p>
<p><strong><span style="font-size:14pt;">The file afterwards</span></strong></p>
<p><img style="margin:5px;" src="http://atulley.files.wordpress.com/2009/03/perl-screenshot-32.jpg?w=338&#038;h=186" alt="" width="338" height="186" /></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/atulley.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/atulley.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/atulley.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/atulley.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/atulley.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/atulley.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/atulley.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/atulley.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/atulley.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/atulley.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/atulley.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/atulley.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/atulley.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/atulley.wordpress.com/100/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=atulley.wordpress.com&amp;blog=907573&amp;post=100&amp;subd=atulley&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://atulley.wordpress.com/2009/03/15/replacing-text-in-a-file-using-perl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a6739a93530503423b488917f43cf9ae?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">Andy</media:title>
		</media:content>

		<media:content url="http://atulley.files.wordpress.com/2009/03/perl.png" medium="image" />

		<media:content url="http://atulley.files.wordpress.com/2009/03/perl-screenshot-11.jpg" medium="image" />

		<media:content url="http://atulley.files.wordpress.com/2009/03/perl-screenshot-22.jpg" medium="image" />

		<media:content url="http://atulley.files.wordpress.com/2009/03/perl-screenshot-32.jpg" medium="image" />
	</item>
		<item>
		<title>SQL: SELECTing a random subset of data</title>
		<link>http://atulley.wordpress.com/2009/02/06/sql-selecting-a-random-subset-of-data/</link>
		<comments>http://atulley.wordpress.com/2009/02/06/sql-selecting-a-random-subset-of-data/#comments</comments>
		<pubDate>Fri, 06 Feb 2009 15:19:13 +0000</pubDate>
		<dc:creator>Andrew Tulley</dc:creator>
				<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://atulley.wordpress.com/2009/02/06/sql-selecting-a-random-subset-of-data/</guid>
		<description><![CDATA[Show me some data, Baby Have a table with a lot of data in and want to work with a random subset of that data? The answer is the Sample Clause of the SELECT statement. The syntax is often described as something like the following: SELECT *FROM my_table SAMPLE (percentage_of_rows); For example: SQL&#62; CREATE TABLE [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=atulley.wordpress.com&amp;blog=907573&amp;post=90&amp;subd=atulley&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:left;"><strong><span style="font-size:14pt;">Show me some data, Baby</span></strong></p>
<p style="text-align:left;">Have a table with a lot of data in and want to work with a random subset of that data? The answer is the <em>Sample Clause</em> of the SELECT statement. The syntax is often described as something like the following:</p>
<p><span style="font-family:Courier;">SELECT *<br />FROM my_table SAMPLE (<em>percentage_of_rows</em>);</span></p>
<p>For example:</p>
<p><span style="font-size:8pt;">SQL&gt; CREATE TABLE ANDY.objs AS SELECT * FROM all_objects;</p>
<p>Table created.</p>
<p>SQL&gt; SELECT COUNT(*) FROM ANDY.objs;</p>
<p> COUNT(*)<br />&#8212;&#8212;&#8212;-<br /> 71277</p>
<p>SQL&gt; SELECT COUNT(*) FROM ANDY.objs SAMPLE(10);</p>
<p> COUNT(*)<br />&#8212;&#8212;&#8212;-<br /> 7107</span></p>
</p>
<p><span style="font-size:14pt;"><strong>&quot;Some data&quot; is not always the same &quot;some data&quot;</strong></span></p>
<p>The above is demonstrably returning a random 10% of data from the ANDY.objs table. Great. Very useful. However, an (arguably) interesting thing happens if we run the exact same SELECT statement again:</p>
<p>SQL&gt; SELECT COUNT(*) FROM ANDY.objs SAMPLE(10);</p>
<p> COUNT(*)<br />&#8212;&#8212;&#8212;-<br /> 7020</p>
<p>And again:</p>
<p>SQL&gt; SELECT COUNT(*) FROM ANDY.objs SAMPLE(10);</p>
<p> COUNT(*)<br />&#8212;&#8212;&#8212;-<br /> 7209</p>
<p>We get a different number of rows each time. It&#8217;s still close enough to 10% of the data, you might say. Maybe so but it does highlight an interesting point: <em><strong>The Sample Clause does not bring back x% of rows (as is often thought) but rather gives each row an x% chance of being returned</strong>. </em></p>
<p><span style="text-decoration:underline;">From the <a href="http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/statements_10002.htm#i2065953">Oracle Documentation</a>:<br /></span>&quot;This percentage indicates the probability of each row, or each cluster of rows in the case of block sampling, being selected as part of the sample. It does not mean that the database will retrieve exactly <code><span class="codeinlineitalic">sample_percent</span></code> of the rows of <code><span class="codeinlineitalic">table</span></code>.&quot;</p>
</p>
<p><span style="font-size:14pt;"><strong>The moral of this tale</strong></span></p>
<p>Use the Sample Clause to work with a random subset of data but don&#8217;t rely on it to bring back exactly the expected number of rows. Complete details on the Sample Clause can be found <a href="http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/statements_10002.htm#i2065953">here</a> and more examples can be found <a href="http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/statements_10002.htm#i2065953">here.</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/atulley.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/atulley.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/atulley.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/atulley.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/atulley.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/atulley.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/atulley.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/atulley.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/atulley.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/atulley.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/atulley.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/atulley.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/atulley.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/atulley.wordpress.com/90/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=atulley.wordpress.com&amp;blog=907573&amp;post=90&amp;subd=atulley&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://atulley.wordpress.com/2009/02/06/sql-selecting-a-random-subset-of-data/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a6739a93530503423b488917f43cf9ae?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">Andy</media:title>
		</media:content>
	</item>
		<item>
		<title>Apex: Speeding things up with Oracle Web Cache compression</title>
		<link>http://atulley.wordpress.com/2009/02/06/apex-speeding-things-up-with-oracle-web-cache-compression/</link>
		<comments>http://atulley.wordpress.com/2009/02/06/apex-speeding-things-up-with-oracle-web-cache-compression/#comments</comments>
		<pubDate>Fri, 06 Feb 2009 11:26:17 +0000</pubDate>
		<dc:creator>Andrew Tulley</dc:creator>
				<category><![CDATA[ApEx]]></category>

		<guid isPermaLink="false">http://atulley.wordpress.com/2009/02/06/apex-speeding-things-up-with-oracle-web-cache-compression/</guid>
		<description><![CDATA[Apex pages on a diet Duncan Mein last year wrote about enabling content compression using Oracle Web Cache to speed up use of both Apex apps and Oracle Discoverer. Enabling compression in this way is a risk-free, quick win and there&#8217;s really no reason not to do it. Feeling the burn To enable compression for [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=atulley.wordpress.com&amp;blog=907573&amp;post=79&amp;subd=atulley&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:left;" align="left"><span style="font-size:14pt;"><strong>Apex pages on a diet</strong></span></p>
<p style="text-align:left;" align="left"><img height="96" border="0" width="96" style="float:left;margin:5px;" class="" alt="" src="http://atulley.files.wordpress.com/2009/02/gzip.jpg?w=96&#038;h=96" title="" />Duncan Mein <a href="http://djmein.blogspot.com/2008/09/web-cache-compression-and-modgzip.html">last year wrote about</a> enabling content compression using Oracle Web Cache to speed up use of both Apex apps and Oracle Discoverer.</p>
<p style="text-align:left;" align="left">Enabling compression in this way is a risk-free, quick win and there&#8217;s really no reason not to do it.</p>
<p><span style="font-size:14pt;"><strong>Feeling the burn</strong></span></p>
<p>To enable compression for your Apex apps (including Application Builder itself), do the following:</p>
<ol>
<li>Access the URL http://your.server.com:9400/ (this is the default port for accessing Web Cache administration).</li>
<li>Click &quot;Caching, Personalization, and Compression Rules&quot;.</li>
<li>Under &quot;For all sites&quot; select the last radio button and click &quot;Insert Below&quot;.</li>
<li>Add a rule for Get and Get with Querystring of type regular expression.</li>
<li>Add the regular expression of: /pls/apex/.*$<br />NOTE: You need to replace /pls/apex/ with the DAD (Database Access Descriptor) that you use to access Apex.</li>
<li>You will be able to check that these settings have taken effect by taking a look at the HTTP response headers that your browser receives when you access one of your Apex pages.
<p><img height="19" style="margin:5px;" width="286" alt="" src="http://atulley.files.wordpress.com/2009/02/contentencodinggzip.jpg?w=286&#038;h=19" /></p>
<p>The above screenshot is from a tool called Live HTTP Headers available for Firefox. It&#8217;s an extremely useful tool, showing you exactly what is being set in  both the Request and Response headers. It can be installed from <a href="https://addons.mozilla.org/en-US/firefox/addon/3829">here</a>. If you start playing with Live HTTP Headers, you may notice that in every request your browser sends to the server, it includes the following:</p>
<p><img height="20" style="margin:5px;" width="288" alt="" src="http://atulley.files.wordpress.com/2009/02/accept-encoding.jpg?w=288&#038;h=20" /></p>
<p>This indicates to the server that your browser does indeed support gzip compression (which is what you have just configured within Oracle Web Cache). If your browser did not send the Accept-Encoding header as above, then the server would not send back compressed content but rather just plain old uncompressed content which would still be displayed correctly.</p>
<p>You can see more general information about HTTP Request headers <a href="http://www.tcpipguide.com/free/t_HTTPRequestHeaders.htm">here</a> and about HTTP Response headers <a href="http://www.tcpipguide.com/free/t_HTTPResponseHeaders.htm">here</a>.</li>
</ol>
<p><strong><span style="font-size:14pt;">Taking the pills</span></strong></p>
<p>The configuration that you performed above via Oracle Web Cache Administration is just a front-end for modification to the file webcache.xml found in:</p>
<p><span style="font-family:Courier;">&lt;Oracle Middle Tier Home&gt;\webcache\webcache.xml</span></p>
<p>As such, it is possible to perform these steps via script. This may be useful if, for example, you are trying to create a silent method for installation or configuration of your application. If you are using Windows, you can use the use the batch script and accompanying text file below to perform this configuration entirely via the command prompt (you could work this into a larger installation / configuration script depending upon your requirement).</p>
<p><a href="http://andrew.tulley.co.uk/blogs/enable_web_cache_compression.bat">enable_web_cache_compression.bat</a> &#8211; You will need to modify the first line of this file to point to your Oracle Middle Tier Home.</p>
<p><a href="http://andrew.tulley.co.uk/blogs/new_webcache_entry.txt">new_webcache_entry.txt</a> &#8211; You will only need to modify this file if your DAD is something other than /pls/apex/</p>
<p>Once you have saved these files to any directory and made the changes to these files as mentioned above you can just run <em>enable_web_cache_compression</em> from a Command Prompt to perform the relevant configuration. </p>
<p><span style="text-decoration:underline;"><strong>DISCLAIMER</strong>:</span> You should only use these files as a guide to one possible way for configuring Web Cache to use compression. You should only consider using them once you have looked at their contents and understand what they do. And, as always, you should have a backup of everything before you start modifying configuration files.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/atulley.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/atulley.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/atulley.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/atulley.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/atulley.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/atulley.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/atulley.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/atulley.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/atulley.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/atulley.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/atulley.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/atulley.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/atulley.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/atulley.wordpress.com/79/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=atulley.wordpress.com&amp;blog=907573&amp;post=79&amp;subd=atulley&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://atulley.wordpress.com/2009/02/06/apex-speeding-things-up-with-oracle-web-cache-compression/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a6739a93530503423b488917f43cf9ae?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">Andy</media:title>
		</media:content>

		<media:content url="http://atulley.files.wordpress.com/2009/02/gzip.jpg" medium="image" />

		<media:content url="http://atulley.files.wordpress.com/2009/02/contentencodinggzip.jpg" medium="image" />

		<media:content url="http://atulley.files.wordpress.com/2009/02/accept-encoding.jpg" medium="image" />
	</item>
		<item>
		<title>How to stop your Apex pages being cached</title>
		<link>http://atulley.wordpress.com/2009/02/01/how-to-stop-your-apex-pages-being-cached/</link>
		<comments>http://atulley.wordpress.com/2009/02/01/how-to-stop-your-apex-pages-being-cached/#comments</comments>
		<pubDate>Sun, 01 Feb 2009 15:35:44 +0000</pubDate>
		<dc:creator>Andrew Tulley</dc:creator>
				<category><![CDATA[ApEx]]></category>

		<guid isPermaLink="false">http://atulley.wordpress.com/2009/02/01/how-to-stop-your-apex-pages-being-cached/</guid>
		<description><![CDATA[Why Browser Caching is Good Browser caching is often a very useful thing. Accessing a web site you visit often, it can greatly speed things up if much of the contents can be read from your local browser&#8217;s cache rather than having to be re-fetched from the server. Why Browser Caching is Bad Sometimes, however, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=atulley.wordpress.com&amp;blog=907573&amp;post=75&amp;subd=atulley&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="color:#008;text-align:right;" align="left"><img height="111" width="111" style="float:left;margin:8px;" class="" alt="" src="http://atulley.files.wordpress.com/2009/02/ielogo.jpg?w=111&#038;h=111" title="" /><br /><span style="font-size:14pt;"><strong>Why Browser Caching is Good</strong></span></p>
<p style="color:#008;text-align:right;" align="left">Browser caching is often a very useful thing. Accessing a web site you visit often, it can greatly speed things up if much of the contents can be read from your local browser&#8217;s cache rather than having to be re-fetched from the server.</p>
</p>
<p><span style="font-size:14pt;"><strong>Why Browser Caching is Bad</strong></span></p>
<p>Sometimes, however, caching is not what you want. For example, you may have data which is displayed in the course of a user using your application which you would not want to be cached because you would not want that potentially sensitive information to be stored locally or accessible to other users (simply clicking Back in a browser will often display a cached version of the page). In the scenario where you have logged into an application, viewed some sensitive information, clicked Log Out but left the Browser window open, another user who sits down at the same computer may well be able to click &quot;Back&quot; in their browser to look at what you were just looking at (even though they will not be able to interact with the application in any way because they are not logged in).</p>
<p><span style="font-size:14pt;"><strong>How to Stop Caching</strong></span></p>
<p><img height="109" style="float:right;margin:5px;" width="110" alt="" src="http://atulley.files.wordpress.com/2009/02/firefoxlogo.jpg?w=110&#038;h=109" />There are meta-tags (e.g. <span style="font-family:Courier;">&lt;meta http-equiv=&quot;Pragma&quot; content=&quot;no-cache&quot;/&gt;</span>) which you can specify in the HTML of your web pages whose <em>raison d&#8217;etre </em>would seem to be to prevent caching. However, as <a href="http://support.microsoft.com/kb/937479/en-us">this Microsft article</a> indicates, these, in fact, have no effect in Internet Explorer 6 (or 7 or 8). One alternative solution that this article suggests is to use SSL / HTTPS. This would indeed work but what if you don&#8217;t want to use HTTPS? The other choice is to set HTTP headers to instruct the browser not to cache.</p>
<p><strong><span style="font-size:14pt;">How to Set HTTP Headers to Stop Caching</span></strong></p>
<p>If using OHS (Oracle HTTP Server, i.e. Apache) you can modify your httpd.conf file to set such headers for only certain URLs so that, for example, your Apex pages are never cached. You would need to add something similar to the following to your httpd.conf file (found in %ORACLE_HOME%\Apache\Apache\conf\httpd.conf):</p>
<p><span style="font-family:Courier;">&lt;LocationMatch &quot;/pls/apex/f&quot;&gt;<br />&lt;IfModule mod_headers.c&gt;<br />Header set Cache-Control &quot;max-age=0, no-cache, no-store, must-revalidate&quot;<br />Header set Pragma &quot;no-cache&quot;<br />Header set Expires &quot;Wed, 11 Jan 1984 05:00:00 GMT&quot;<br />&lt;/IfModule&gt;<br />&lt;/LocationMatch&gt;</span></p>
<p>You would need to modify the &quot;/pls/apex/f&quot; value if your DAD is something other than the default of &quot;/pls/apex&quot;. The above entry will have the effect of preventing caching for all of your Apex pages accessed via this DAD (including those pages associated with Application Builder). You can add in this text pretty much anywhere in your httpd.conf file as long as it is after the call to &quot;AddModule mod_headers.c&quot;, Once you have made the change you will need to restart Apache (by running, for example, %ORACLE_HOME%\opmn\bin\opmnctl restartproc ias-component=HTTP_Server from a Command Prompt).</p>
<p>This works in Internet Explorer 6, 7 and 8 as well as in Firefox.</p></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/atulley.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/atulley.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/atulley.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/atulley.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/atulley.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/atulley.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/atulley.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/atulley.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/atulley.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/atulley.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/atulley.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/atulley.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/atulley.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/atulley.wordpress.com/75/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=atulley.wordpress.com&amp;blog=907573&amp;post=75&amp;subd=atulley&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://atulley.wordpress.com/2009/02/01/how-to-stop-your-apex-pages-being-cached/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a6739a93530503423b488917f43cf9ae?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96" medium="image">
			<media:title type="html">Andy</media:title>
		</media:content>

		<media:content url="http://atulley.files.wordpress.com/2009/02/ielogo.jpg" medium="image" />

		<media:content url="http://atulley.files.wordpress.com/2009/02/firefoxlogo.jpg" medium="image" />
	</item>
	</channel>
</rss>
