<?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>Onlydarksets &#187; Oracle</title>
	<atom:link href="http://onlydarksets.com/tag/oracle/feed/" rel="self" type="application/rss+xml" />
	<link>http://onlydarksets.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Wed, 04 Aug 2010 14:05:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Oracle syntax reference</title>
		<link>http://onlydarksets.com/2008/08/11/oracle-syntax-reference/</link>
		<comments>http://onlydarksets.com/2008/08/11/oracle-syntax-reference/#comments</comments>
		<pubDate>Mon, 11 Aug 2008 16:53:12 +0000</pubDate>
		<dc:creator>onlydarksets</dc:creator>
				<category><![CDATA[Applications]]></category>
		<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://onlydarksets.wordpress.com/?p=345</guid>
		<description><![CDATA[After using SQL Server forever, I&#8217;m finally on a project that uses Oracle.  This is just a dumping ground for various syntax.  Note this is for 9i (yes, it&#8217;s a bit behind the current release). Switch schemas: ALTER SESSION SET CURRENT_SCHEMA = SchemaName Format dates (including convert string to date): TO_DATE(&#60;string&#62;, &#8216;&#60;format&#62;&#8217;) to_date(&#8217;1998/05/31:12:00:00AM&#8217;, &#8216;yyyy/mm/dd:hh:mi:ssam&#8217;)); Format [...]]]></description>
			<content:encoded><![CDATA[<p>After using SQL Server forever, I&#8217;m finally on a project that uses Oracle.  This is just a dumping ground for various syntax.  Note this is for 9i (yes, it&#8217;s a bit behind the current release).</p>
<p>Switch schemas:</p>
<blockquote><p>ALTER SESSION SET CURRENT_SCHEMA = <em>SchemaName</em></p></blockquote>
<p>Format dates (including convert string to date):</p>
<blockquote><p>TO_DATE(&lt;string&gt;, &#8216;&lt;format&gt;&#8217;)</p>
<p><em>to_date(&#8217;1998/05/31:12:00:00AM&#8217;, &#8216;yyyy/mm/dd:hh:mi:ssam&#8217;));</em></p></blockquote>
<p>Format strings (including convert date to string):</p>
<blockquote><p>TO_CHAR(&lt;date&gt;, &#8216;&lt;format&gt;&#8217;)</p>
<p><em>TO_CHAR(SYSDATE, &#8216;YYYY&#8217;)</em></p></blockquote>
<p><a href="http://www.techonthenet.com/oracle/functions/case.php" target="_blank">CASE in select</a>:</p>
<blockquote><p>CASE<br />
WHEN owner=&#8217;SYS&#8217; THEN &#8216;The owner is SYS&#8217;<br />
WHEN owner=&#8217;SYSTEM&#8217; THEN &#8216;The owner is SYSTEM&#8217;<br />
ELSE &#8216;The owner is another value&#8217;<br />
END</p>
<p>DECODE</p></blockquote>
<p>List all tables in current schema:</p>
<blockquote><p>SELECT table_name FROM user_tables;</p></blockquote>
<p>List all tables current user has access to:</p>
<blockquote><p>SELECT table_name FROM all_tables;</p></blockquote>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save">Share/Save</a> </p>]]></content:encoded>
			<wfw:commentRss>http://onlydarksets.com/2008/08/11/oracle-syntax-reference/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
