<?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>Ladysign Dev Blog &#187; sql</title>
	<atom:link href="http://www.ladysign-apps.com/blog/tag/sql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ladysign-apps.com/blog</link>
	<description>Girls can code.</description>
	<lastBuildDate>Mon, 12 Dec 2011 16:58:15 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Mash-ups with YQL</title>
		<link>http://www.ladysign-apps.com/blog/code/javascript/mash-ups-with-yql/</link>
		<comments>http://www.ladysign-apps.com/blog/code/javascript/mash-ups-with-yql/#comments</comments>
		<pubDate>Sat, 07 Nov 2009 11:00:32 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[YUI Library]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[corizon]]></category>
		<category><![CDATA[mash-ups]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[yql]]></category>

		<guid isPermaLink="false">http://www.ladysign-apps.com/blog/?p=923</guid>
		<description><![CDATA[<h5>&#8230;and why Corizon mashups suck.</h5>
<p><strong>Difficulty:</strong> 2 out of 5 stars<br />
It was because of working with Corizon that I became more interested in creating Mas[......]</p><p class='read-more'><a href='http://www.ladysign-apps.com/blog/code/javascript/mash-ups-with-yql/'>继续阅读</a></p>]]></description>
			<content:encoded><![CDATA[<h5>&#8230;and why Corizon mashups suck.</h5>
<p><strong>Difficulty:</strong> 2 out of 5 stars<br />
It was because of working with Corizon that I became more interested in creating Mash-ups*.<br />
During the last 2 years, I&#8217;ve seen a lot of mash-up tools, From the easy (&#8221;Lego-like&#8221;) Popfly from Microsoft which is recently discontinued, to large handy API&#8217;s or serverside Java frameworks; such as the nice but heavy <a title="SiteMesh" href="http://www.opensymphony.com/sitemesh/" id="i2v4">SiteMesh</a> framework.<br />
But it was the <a href="http://www.corizon.com/">Corizon mash-up</a> toolkit that I started to realize, coding mash-ups can have it&#8217;s ups and downs.</p>
<p>In my opinion creating a mash-up should be easy &amp; fast. Not buggy and heavy (running 2 or 3 Tomcat servers in the background *kuch*). Also it&#8217;s an unwritten rule that for a mash-up you should not first destroy and rebuild it&#8217;s components before you gonna mix them up. This means you can only mash-up content what&#8217;s in your maintenance and when one of your components changes, your mash-up is broken.<br />
It&#8217;s not a wonder that I became extremely positive about YQL, when I first saw this working.<br />
And now, after <a href="http://www.fronteers.nl">Fronteers 2009</a>, where I had a presentation and talk with <a href="http://icant.co.uk">Chris Heilmann</a> from Yahoo.</p>
<p>With YQL (Yahoo Query Language), you can make the same mash-ups, client or serverside and you don&#8217;t need thousands lines of code.<br />
<b>Why you should use YQL for a mash-up?</b></p>
<ul>
<li>You won’t use your own bandwidth, but the bandwidth from Yahoo.</li>
<li>It’s easy, just the basic SQL knowledge is required.</li>
<li>It’s lightweight.</li>
<li>It’s fast.</li>
</ul>
<p>But like every Mashup tool, there are also downside&#8217;s. So it&#8217;s good to consider:</p>
<p><b>Why you shouldn&#8217;t use YQL for a mash-up?</b></p>
<ul>
<li>When one of the including components is slow or has timeouts, you result object will be <strong>null</strong>.</li>
</ul>
<h5>Mash-ups with YQL</h5>
<p>Ok enough with the theory. Let&#8217;s practice with a simple YQL mash-up. As you might know, I like videogames. So I want to have a website with the release dates of games on my website, which I can watch on YouTube. Fokzine Games (<a href="http://games.fok.nl/overzicht.php?action=release">http://games.fok.nl/overzicht.php?action=release</a>) has a nice game release list.</p>
<ul>
<li>For using this tutorial, you will need a Yahoo Developer Account, which you can create for free. </li>
<li>Unless you like to write full XPath lines without any help,<br />
you’ll also need <a title="Mozilla Firefox" href="http://www.mozilla-europe.org/nl/firefox/" id="me3x">Mozilla Firefox</a> browser with the <a title="Firebug" href="https://addons.mozilla.org/en-US/firefox/addon/1843" id="f_1b">Firebug</a> plugin installed.</li>
</ul>
<ol>
<li><b>Register your Yahoo Dev account.</b><br />
Go to the below URL, register your Yahoo account and login<br />
to the YQL console:&nbsp;<a href="http://developer.yahoo.com/yql/console/" target="_blank">http://developer.yahoo.com/yql</a>
</li>
<li><b>Query the content.</b><br />
YQL is quite similar to SQL. To query content (the videogame<br />
release list) from an external website, I will select all the HTML nodes from an URL. With Xpath I can point to the part of the website I will need. (Now you’ll need Firebug, inspect the website, till you’ll reach the table tag of the release list. – In top of your Firebug screen, you will see the full Xpath line.<br />
– Just right click, and “Copy Xpath”. This will be your YQL query for selecting the table tag on Fok.nl Game Release Page:</p>
<pre class="brush: sql; title: ;">
select * from html where url ='http://games.fok.nl/overzicht.php?action=release' and xpath ='//*[@id=&quot;itemtext&quot;]'
//or select the tr tag on Fok.nl Game Release page
//(note that I removed “tbody” from the xpath line to make it work)
select * from html where url ='http://games.fok.nl/overzicht.php?action=release' and xpath ='/html/body/div[4]/table/tr/td[2]/div[2]/div/table/tr'
</pre>
<p>Hit enter (or press “Test”) and you can switch between formatted view or tree view to see the result. Result can be in XML of JSON.<br />
Also note that you can copy the REST URL Query, from the console:<br />
<strong><br />
http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20html%20where%20url%20%3D%20&#8242;http%3A%2F%2Fgames.fok.nl%2Foverzicht.php%3Faction%3Drelease&#8217;%20and%20xpath%20%3D%20&#8242;%2Fhtml%2Fbody%2Fdiv%5B4%5D%2Ftable%2Ftr%2Ftd%5B2%5D%2Fdiv%5B2%5D%2Fdiv%2Ftable%2Ftr&#8217;&amp;format=xml<br />
</strong><br />
<img src="yql.jpg" alt="YQL Console" />
</li>
<li>
<b>How the retrieved XML looks like:</b></p>
<pre class="brush: xml; title: ;">&lt;query xmlns:yahoo=&quot;http://www.yahooapis.com/v1/base.rng&quot;yahoo:count=&quot;50&quot; yahoo:created=&quot;2009-09-25T12:14:12Z&quot;yahoo:lang=&quot;en-US&quot; yahoo:updated=&quot;2009-09-25T12:14:12Z&quot;
yahoo:uri=&quot;http://query.yahooapis.com/v1/yql?q=select+*+from+html+where+url+%3D+%27http%3A%2F%2Fgames.fok.nl%2Foverzicht.php%3Faction%3Drelease%27+and+xpath+%3D+%27%2Fhtml%2Fbody%2Fdiv%5B4%5D%2Ftable%2Ftr%2Ftd%5B2%5D%2Fdiv%5B2%5D%2Fdiv%2Ftable%2Ftr%27&quot;&gt;
&lt;diagnostics&gt;
&lt;publiclyCallable&gt;true&lt;/publiclyCallable&gt;
&lt;url execution-time=&quot;263&quot; proxy=&quot;DEFAULT&quot;&gt;&lt;![CDATA[http://games.fok.nl/overzicht.php?action=release]]&gt;&lt;/url&gt;
&lt;user-time&gt;272&lt;/user-time&gt;
&lt;service-time&gt;263&lt;/service-time&gt;
&lt;build-version&gt;3130&lt;/build-version&gt;
&lt;/diagnostics&gt;
&lt;results&gt;
 &lt;tr bgcolor=&quot;#E0E0E0&quot;&gt;
  &lt;td&gt;
   &lt;img alt=&quot;PC&quot; src=&quot;http://images.fok.nl/ads/games/IB_PC.png&quot;/&gt;
  &lt;/td&gt;
  &lt;td&gt;
   &lt;p&gt;29-09-2009&lt;/p&gt;
  &lt;/td&gt;
  &lt;td&gt;
   &lt;a class=&quot;invisiblelink&quot; href=&quot;gameinfo.php?gameid=9985&quot;&gt;Tales of Monkey Island episode 3&lt;/a&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
  ..
&lt;/results&gt;
&lt;/query&gt;</pre>
<p><b>How your JSON (Javascript object looks like:</b></p>
<pre class="brush: jscript; title: ;">releaseList({
 &quot;query&quot;:{
 &quot;count&quot;:&quot;50&quot;,
 &quot;created&quot;:&quot;2009-09-25T12:10:17Z&quot;,
 &quot;lang&quot;:&quot;en-US&quot;,
 &quot;updated&quot;:&quot;2009-09-25T12:10:17Z&quot;,
 &quot;uri&quot;:&quot;http://query.yahooapis.com/v1/yql?q=select+*+from+html+where+url+%3D+%27http%3A%2F%2Fgames.fok.nl%2Foverzicht.php%3Faction%3Drelease%27+and+xpath+%3D+%27%2Fhtml%2Fbody%2Fdiv%5B4%5D%2Ftable%2Ftr%2Ftd%5B2%5D%2Fdiv%5B2%5D%2Fdiv%2Ftable%2Ftr%27&quot;,
 &quot;diagnostics&quot;:{
  &quot;publiclyCallable&quot;:&quot;true&quot;,
  &quot;url&quot;:{
   &quot;execution-time&quot;:&quot;28&quot;,
   &quot;proxy&quot;:&quot;DEFAULT&quot;,
   &quot;content&quot;:&quot;http://games.fok.nl/overzicht.php?action=release&quot;
  },
 &quot;user-time&quot;:&quot;36&quot;,
 &quot;service-time&quot;:&quot;28&quot;,
 &quot;build-version&quot;:&quot;3130&quot;
 },
&quot;results&quot;:{
 &quot;tr&quot;:[{
 &quot;bgcolor&quot;:&quot;#E0E0E0&quot;,
 &quot;td&quot;:[.. ]
 }
..
 ]
}}});</pre>
</li>
<li><b>Use the YQL widget.</b><br />
Create a new HTML page. In this page, you&#8217;ll include the YQL JS Widget:<br />
<a href="http://github.com/sh1mmer/dotnet-yql-tutorial/blob/master/yql_js_widget.js" target="_blank">http://github.com/sh1mmer/dotnet-yql-tutorial/blob/master/yql_js_widget.js</a><br />
This is a pre-made Javascript widget. If you check out the links on the end of this article, you can check out other implementations as well. (Such as Dojo-YQL or JQuery YQL).<br />
For this article, we will use vanilla Javascript.</li>
<li><b>Create the Mash-up.</b><br />
The only think what you&#8217;ll need now is the logic to implement the previous made YQL query, to have the YQL results in your Document Object Model (DOM).<br />
With the Firebug plug-in, you can check the &#8220;Net&#8221; tab, to see if the correct object is retrieved. You can walk through the results, and implement it in your Javascript to do fancy things with it.</li>
<pre class="brush: xml; title: ;">
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;YQL - Game Release&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;yql-js-widget.js&quot; &gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
var config = {};
var format = '&lt;li class=&quot;{td[0].img.alt}&quot;&gt;{td[1].p} - &lt;a href=&quot;http://games.fok.nl/{td[2].a.href}&quot; target=&quot;_blank&quot;&gt;{td[2].a.content}&lt;/a&gt; - &lt;a href=&quot;http://www.youtube.com/results?search_query={td[2].a.content}&quot; target=&quot;_blank&quot;&gt;Watch on YouTube&lt;/a&gt;&lt;/li&gt;';
var gameQuery = &quot;select * from html where url = 'http://games.fok.nl/overzicht.php?action=release' and xpath = '/html/body/div[4]/table/tr/td[2]/div[2]/div/table/tr'&quot;;
yqlWidget.push(gameQuery, config, format, &quot;widgetContainer&quot;);
yqlWidget.render();
&lt;/script&gt;&lt;ul id=&quot;widgetContainer&quot;&gt;&lt;/ul&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>Well that&#8217;s it. See how easy it is to create a nice Mash-up? As long as you can reach the DOM, you can mash-up everything. Below my article, I&#8217;ve written some nice links. If you liked my article or you would like to discuss with me about YQL or Mash-up technologies; feel free to add me on <a title="LinkedIn" href="http://www.linkedin.com/in/leeboonstra" id="a93_">LinkedIn</a> or <a title="Twitter" href="http://twitter.com/ladysign" id="e:f5">Twitter</a>.</p>
<ul>
<li>YQL Community:<a href="http://github.com/yql/" target="_blank"> http://github.com/yql/</a></li>
<li>YQL video by Jonathan LeBlanc: <a href="http://developer.yahoo.com/yui/theater/video.php?v=leblanc-yql" target="_blank">http://developer.yahoo.com/yui/theater/video.php?v=leblanc-yql</a></li>
</ul>
<h6>* In webdevelopment, a mashup is a web page or application that combines<br />
data or functionality from two or more external sources to create a new<br />
service. An example of a Mash-up is a Google Map combined with Wikipedia<br />
town information and a (accuweather.com) Weather indicator.</h6>
</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.ladysign-apps.com/blog/code/javascript/mash-ups-with-yql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Migrating from Joomla to Wordpress</title>
		<link>http://www.ladysign-apps.com/blog/code/sql/migrating-from-joomla-to-wordpress/</link>
		<comments>http://www.ladysign-apps.com/blog/code/sql/migrating-from-joomla-to-wordpress/#comments</comments>
		<pubDate>Sun, 03 May 2009 09:09:29 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[joomla]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Joomla to Wordpress]]></category>
		<category><![CDATA[Mambo]]></category>
		<category><![CDATA[Mambo to Joomla]]></category>
		<category><![CDATA[MD5]]></category>
		<category><![CDATA[Migration]]></category>
		<category><![CDATA[password encryption]]></category>
		<category><![CDATA[phpmyadmin]]></category>
		<category><![CDATA[Porting]]></category>

		<guid isPermaLink="false">http://ladysign-apps.com/blog/?p=664</guid>
		<description><![CDATA[<p><strong>Difficulty:</strong> 2 out of 5 stars</p>
<p>One of my websites is build on the CMS Joomla. These days I&#8217;m much more comfortable with Wordpress.<br />
Today I will gu[......]</p><p class='read-more'><a href='http://www.ladysign-apps.com/blog/code/sql/migrating-from-joomla-to-wordpress/'>继续阅读</a></p>]]></description>
			<content:encoded><![CDATA[<p><strong>Difficulty:</strong> 2 out of 5 stars</p>
<p>One of my websites is build on the CMS Joomla. These days I&#8217;m much more comfortable with Wordpress.<br />
Today I will guide you, how to easy migrate from Joomla/Mambo to Wordpress.</p>
<p><strong>Migrating Articles from Mambo/Joomla to Wordpress</strong><br />
With <a href="http://www.blevins.nl/missiontech/">this wizzard from Rodney Blevins </a>you can migrate Mambo/Joomla articles and links very easy to Wordpress.<br />
Unfortunately migrating the links didn&#8217;t really work for my Wordpress 2.7.</p>
<p><em>Notice that for this wizzard, both installations of Mambo/Joomla and Wordpress need to be on the same webserver installed.</em></p>
<ol>
<li>Download the wizzard from the above link.</li>
<li>Create a new folder &#8220;export&#8221; in the root of your Wordpress installation.</li>
<li>Edit the config.php file, with the database name, username, password of Mambo/Joomla and Wordpress database settings.</li>
<li>Incase you have Joomla installed, or you changed the database prefix; you&#8217;ll have to edit the var: &#8220;$dbprefix&#8221; to your prefix. For example: &#8220;mos_&#8221; to: &#8220;jos_&#8221;.</li>
<li>Incase the database prefix for the Wordpress DB is different then &#8220;wp_&#8221;; open up the index.php file, and search / replace all: &#8220;wp_&#8221; and change it manually to your prefix. For example: &#8220;wp_&#8221; to &#8220;lee_&#8221;.</li>
<li>Now save and upload the index.php and config.php files to the export folder</li>
<li>Surf to http://your-wp-installation/export and follow the steps to import your articles or links into Wordpress.</li>
</ol>
<p><strong>Removing Mambo/Joomla tags from Wordpress posts</strong><br />
Now when your done, it could be that your Wordpress post message contain Joomla tags in the post.<br />
Tags like: &#8220;{mosimage}&#8221; or plugin based tags like: &#8220;{rokaccess}&#8221;.<br />
You can easily remove these tags from all your post with some database queries.<br />
Open phpMyAdmin and within your Wordpress database, press the SQL tab.</p>
<p>To see how many post I have with Mambo/Joomla tags, I used this query:</p>
<pre class="brush: sql; title: ;">
SELECT * FROM wp_posts WHERE post_content LIKE &amp;quot;%{%&amp;quot;
</pre>
<p>I noticed by the retrieved list, that some of my posts contain the {mosimage} tag.<br />
To remove (replace to empty string) these tags and update my posts, I used the following query:</p>
<pre class="brush: sql; title: ;">
UPDATE wp_posts SET post_content = replace(post_content, &amp;quot;{mosimage}&amp;quot;, &amp;quot;&amp;quot;);
</pre>
<p>Just another check, to see if 0 posts return, if I search in my Wordpress database for the {mosimage} tag:</p>
<pre class="brush: sql; title: ;">
SELECT * FROM wp_posts WHERE post_content LIKE &amp;quot;{mosimage}&amp;quot;
</pre>
<p><strong>Migrating users</strong><br />
The next important thing to migrate, will be the user database.<br />
Let&#8217;s compare both XML exports from phpMyAdmin, to see the table structures:</p>
<p>Joomla Export:</p>
<pre class="brush: xml; title: ;">
&amp;lt;jos_users&amp;gt;
    &amp;lt;id&amp;gt;64&amp;lt;/id&amp;gt;
    &amp;lt;name&amp;gt;Lee&amp;lt;/name&amp;gt;
    &amp;lt;username&amp;gt;Lee&amp;lt;/username&amp;gt;
    &amp;lt;email&amp;gt;my@email.nl&amp;lt;/email&amp;gt;
    &amp;lt;password&amp;gt;###&amp;lt;/password&amp;gt;
    &amp;lt;usertype&amp;gt;Super Administrator&amp;lt;/usertype&amp;gt;
    &amp;lt;block&amp;gt;0&amp;lt;/block&amp;gt;
    &amp;lt;sendEmail&amp;gt;0&amp;lt;/sendEmail&amp;gt;
    &amp;lt;gid&amp;gt;25&amp;lt;/gid&amp;gt;
    &amp;lt;registerDate&amp;gt;2007-07-25 21:57:51&amp;lt;/registerDate&amp;gt;
    &amp;lt;lastvisitDate&amp;gt;2009-05-01 18:01:52&amp;lt;/lastvisitDate&amp;gt;
    &amp;lt;activation&amp;gt;&amp;lt;/activation&amp;gt;
    &amp;lt;params&amp;gt;editor=none&amp;lt;/params&amp;gt;
&amp;lt;/jos_users&amp;gt;
</pre>
<p>Same Export in Wordpress would be:</p>
<pre class="brush: xml; title: ;">
&amp;lt;wp_users&amp;gt;
    &amp;lt;user_login&amp;gt;Lee&amp;lt;/user_login&amp;gt;
    &amp;lt;user_pass&amp;gt;&amp;lt;/user_pass&amp;gt;
    &amp;lt;user_nicename&amp;gt;Lee&amp;lt;/user_nicename&amp;gt;
    &amp;lt;user_email&amp;gt;my@email.nl&amp;lt;/user_email&amp;gt;
    &amp;lt;user_url&amp;gt;http://www.ladysign.nl&amp;lt;/user_url&amp;gt;
    &amp;lt;user_registered&amp;gt;2007-07-25 21:57:51&amp;lt;&amp;lt;/user_registered&amp;gt;
    &amp;lt;user_activation_key&amp;gt;&amp;lt;/user_activation_key&amp;gt;
    &amp;lt;user_status&amp;gt;0&amp;lt;/user_status&amp;gt;
    &amp;lt;display_name&amp;gt;Lee&amp;lt;/display_name&amp;gt;
&amp;lt;/wp_users&amp;gt;
</pre>
<p>Be replacing the table names in the export, or writing a nice script which creates a INSERT INTO query,<br />
you can prefill the Wordpress database with the users from the Mambo/Joomla user table.<br />
However, there will be one problem.</p>
<p><strong>Password encryption</strong><br />
And that problem is setting over the passwords.<br />
Joomla! 1.5 uses MD5 to hash the passwords.  When the passwords are created, they are hashed with a 32 character salt that is appended to the end of the password string.<br />
The password is stored as {TOTAL HASH}:{ORIGINAL SALT}.<br />
That&#8217;s diffrent then the MD5 encryption of Wordpress.<br />
For now I&#8217;ll solve this, by removing all the Wordpress passwords, and let the user recreate a new one via &#8216;lost password&#8217;.<br />
This is ofcourse not a nice solution. Does anyone has an idea?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ladysign-apps.com/blog/code/sql/migrating-from-joomla-to-wordpress/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>4 checks for diagnosing remote database connection problems</title>
		<link>http://www.ladysign-apps.com/blog/code/sql/4-checks-for-diagnosing-oracle-db-connection-problems/</link>
		<comments>http://www.ladysign-apps.com/blog/code/sql/4-checks-for-diagnosing-oracle-db-connection-problems/#comments</comments>
		<pubDate>Mon, 06 Apr 2009 09:51:42 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[sql]]></category>
		<category><![CDATA[database problems]]></category>
		<category><![CDATA[db]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[tns]]></category>
		<category><![CDATA[tns listener]]></category>
		<category><![CDATA[tnsping]]></category>

		<guid isPermaLink="false">http://ladysign-apps.com/blog/?p=552</guid>
		<description><![CDATA[<p><strong>Difficulty:</strong> 1 out of 5 stars</p>
<p>There are 4 main checks for diagnosing remote database connection problems:</p>
<ul>
<li>tnsnames.ora</li>
<li>Oracle class path</li>
<li>ping</li>
<li>tnsping</li>
[......]</ul><p class='read-more'><a href='http://www.ladysign-apps.com/blog/code/sql/4-checks-for-diagnosing-oracle-db-connection-problems/'>继续阅读</a></p>]]></description>
			<content:encoded><![CDATA[<p><strong>Difficulty:</strong> 1 out of 5 stars</p>
<p>There are 4 main checks for diagnosing remote database connection problems:</p>
<ul>
<li>tnsnames.ora</li>
<li>Oracle class path</li>
<li>ping</li>
<li>tnsping</li>
</ul>
<h4>tnsnames.ora</h4>
<p>First check if the tnsnames.ora file has the correct database information/credentials.<br />
The tnsnames.ora file can be found in: \ORACLE\ora92\network\ADMIN<br />
These credentials should look like:</p>
<pre class="brush: sql; title: ;">
MYDATABSENAME =
	(DESCRIPTION=
		(ADDRESS_LIST=
			(ADDRESS=(PROTOCOL=TCP)(HOST=ladysign)(PORT=&lt;port 1111&gt;))
		)
		(CONNECT_DATA=
			(SERVICE_NAME=myServiceName)
		)
	)
</pre>
<h4>Oracle Class path</h4>
<p>Make sure oracle is in your class path.<br />
Press Windows Key + Break key; Advanced Tab > Environment Variables<br />
Make sure there is a ORACLE_HOME system variable. For example:<br />
ORACLE_HOME = C:\\ORACLE\ora92</p>
<h4>Ping</h4>
<p>The ping utility is used to test the connectivity to a remote machine.  ping will indicate whether a remote server is accessible and responding.  If the ping command indicates that a machine cannot be accessed, the other connectivity tests will also fail.<br />
U can use the ping command via the (DOS) command line; <em>ping <host name></em>. For example:</p>
<pre class="brush: jscript; title: ;">
C:\&gt;ping ladysign
Pinging ladysign [198.64.245.67] with 32 bytes of data:

Reply from 198.64.245.67: bytes=32 time&lt;10ms TTL=254
Reply from 198.64.245.67: bytes=32 time&lt;10ms TTL=254
Reply from 198.64.245.67: bytes=32 time&lt;10ms TTL=254
Reply from 198.64.245.67: bytes=32 time&lt;10ms TTL=254
</pre>
<h4>TNSPing</h4>
<p>When the connectivity to the host is confirmed with the ping command, the next connection to check is the listener.<br />
You can do this with the tnsping utility, which determines wheter or not an Oracle service can be succesfully reached.<br />
However, tnssping will only report if the listener process is up and provides no indication of the state of the database:<br />
For example:</p>
<pre class="brush: jscript; title: ;">
C:\&gt;tnsping MYDATABASENAME

TNS Ping Utility for 32-bit Windows: Version 9.2.0.1.0 - Production on 06-APR-2009 11:02:32

Copyright (c) 1997 Oracle Corporation.  All rights reserved.

Used parameter files:
C:\ORACLE\ora92\network\admin\sqlnet.ora

Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION= (ADDRESS_LIST= (ADDRESS=(PROTOCOL=TCP)(HOST=ladysign)(PORT=1111))) (CONNECT_DATA= (SERVICE_NAME=myDatabaseService)))
OK (80 msec)
OK (10 msec)
OK (10 msec)
OK (0 msec)
OK (10 msec)
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.ladysign-apps.com/blog/code/sql/4-checks-for-diagnosing-oracle-db-connection-problems/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQL oracle: don&#8217;t show empty values.</title>
		<link>http://www.ladysign-apps.com/blog/code/sql/sql-oracle-dont-show-empty-values/</link>
		<comments>http://www.ladysign-apps.com/blog/code/sql/sql-oracle-dont-show-empty-values/#comments</comments>
		<pubDate>Thu, 29 Jan 2009 15:44:35 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[sql]]></category>
		<category><![CDATA[empty values]]></category>
		<category><![CDATA[not null]]></category>
		<category><![CDATA[oracle]]></category>

		<guid isPermaLink="false">http://ladysign-apps.com/blog/?p=357</guid>
		<description><![CDATA[<p><strong>Difficulty:</strong> 2 out of 5 stars</p>
<p>Ever wanted to query a resultset and received a whole bunch of results with empty values?<br />
Just query on select no empty v[......]</p><p class='read-more'><a href='http://www.ladysign-apps.com/blog/code/sql/sql-oracle-dont-show-empty-values/'>继续阅读</a></p>]]></description>
			<content:encoded><![CDATA[<p><strong>Difficulty:</strong> 2 out of 5 stars</p>
<p>Ever wanted to query a resultset and received a whole bunch of results with empty values?<br />
Just query on select no empty values.<br />
The query can look like this:</p>
<pre class="brush: sql; title: ;">
SELECT * FROM MY_TABLE WHERE CD_VAL = 'something' AND CD_VAL IS NOT NULL;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.ladysign-apps.com/blog/code/sql/sql-oracle-dont-show-empty-values/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SQL &#8211; query on date</title>
		<link>http://www.ladysign-apps.com/blog/code/sql/sql-query-on-date/</link>
		<comments>http://www.ladysign-apps.com/blog/code/sql/sql-query-on-date/#comments</comments>
		<pubDate>Thu, 15 Jan 2009 12:43:21 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[sql]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[query]]></category>
		<category><![CDATA[to_date]]></category>

		<guid isPermaLink="false">http://ladysign-apps.com/blog/?p=264</guid>
		<description><![CDATA[<p><strong>Difficulty:</strong> 1 out of 5 stars</p>
<p>Say you want to query all the fields after a specific date.<br />
You&#8217;ll just write a sql with a value > then the filled i[......]</p><p class='read-more'><a href='http://www.ladysign-apps.com/blog/code/sql/sql-query-on-date/'>继续阅读</a></p>]]></description>
			<content:encoded><![CDATA[<p><strong>Difficulty:</strong> 1 out of 5 stars</p>
<p>Say you want to query all the fields after a specific date.<br />
You&#8217;ll just write a sql with a value > then the filled in date.<br />
But how do you specify a date? You need the to_Date function for doing this.</p>
<pre class="brush: sql; title: ;">
TIMESTAMP &gt;= to_Date('20081203','yyyymmdd')
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.ladysign-apps.com/blog/code/sql/sql-query-on-date/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

