<?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>MemoSoup &#187; sqlplus</title>
	<atom:link href="http://www.memosoup.com/tag/sqlplus/feed" rel="self" type="application/rss+xml" />
	<link>http://www.memosoup.com</link>
	<description>Mix of the things I always forget</description>
	<lastBuildDate>Tue, 07 Feb 2012 00:03:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Oracle: using substitution variables in sqlplus</title>
		<link>http://www.memosoup.com/20091216/oracle-using-substitution-variables-in-sqlplus.html</link>
		<comments>http://www.memosoup.com/20091216/oracle-using-substitution-variables-in-sqlplus.html#comments</comments>
		<pubDate>Wed, 16 Dec 2009 14:50:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[sqlplus]]></category>
		<category><![CDATA[variable]]></category>

		<guid isPermaLink="false">http://www.memosoup.com/?p=222</guid>
		<description><![CDATA[<p>Get the value:</p> ACCEPT my_password CHAR PROMPT 'Password: &#160;' HIDE ACCEPT birthday DATE FORMAT 'dd/mm/yyyy' DEFAULT '01/01/1950' PROMPT 'Enter birthday date: &#160;' <p>Declaring the variable</p> DEFINE the_answer = 42 <p>Undefine the variable</p> UNDEFINE the_answer <p>How to remember the result of the query</p> COLUMN the_date new_value the_rundate noprint; SELECT TO_CHAR&#40;SYSDATE, 'DDMMYYYY_HH24MI'&#41; the_date FROM dual; SELECT '&#38;the_rundate' [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Get the value:</strong></p>
<div class="codecolorer-container oracle8 default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div class="oracle8 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">ACCEPT my_password <span style="color: #993333; font-weight: bold; text-transform: uppercase;">CHAR</span> PROMPT <span style="color: #ff0000;">'Password: &nbsp;'</span> HIDE<br />
ACCEPT birthday <span style="color: #993333; font-weight: bold; text-transform: uppercase;">DATE</span> FORMAT <span style="color: #ff0000;">'dd/mm/yyyy'</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">DEFAULT</span> <span style="color: #ff0000;">'01/01/1950'</span> PROMPT <span style="color: #ff0000;">'Enter birthday date: &nbsp;'</span></div></div>
<p><strong>Declaring the variable</strong></p>
<div class="codecolorer-container oracle8 default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div class="oracle8 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">DEFINE the_answer <span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">42</span></div></div>
<p><strong>Undefine the variable</strong></p>
<div class="codecolorer-container oracle8 default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div class="oracle8 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">UNDEFINE the_answer</div></div>
<p><strong>How to remember the result of the query</strong></p>
<div class="codecolorer-container oracle8 default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div class="oracle8 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #993333; font-weight: bold; text-transform: uppercase;">COLUMN</span> the_date new_value the_rundate noprint;<br />
<span style="color: #993333; font-weight: bold; text-transform: uppercase;">SELECT</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">TO_CHAR</span><span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold; text-transform: uppercase;">SYSDATE</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'DDMMYYYY_HH24MI'</span><span style="color: #66cc66;">&#41;</span> the_date <span style="color: #993333; font-weight: bold; text-transform: uppercase;">FROM</span> dual;<br />
<br />
<span style="color: #993333; font-weight: bold; text-transform: uppercase;">SELECT</span> <span style="color: #ff0000;">'&amp;the_rundate'</span> <span style="color: #993333; font-weight: bold; text-transform: uppercase;">FROM</span> dual ;</div></div>
<p><strong>Save the variables to the file</strong></p>
<div class="codecolorer-container oracle8 default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div class="oracle8 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">store <span style="color: #993333; font-weight: bold; text-transform: uppercase;">SET</span> myvars.txt <span style="color: #993333; font-weight: bold; text-transform: uppercase;">CREATE</span><br />
store <span style="color: #993333; font-weight: bold; text-transform: uppercase;">SET</span> myvars.txt <span style="color: #993333; font-weight: bold; text-transform: uppercase;">REPLACE</span><br />
store <span style="color: #993333; font-weight: bold; text-transform: uppercase;">SET</span> myvars.txt append</div></div>
<p><strong>Assign several values to the variable</strong></p>
<div class="codecolorer-container oracle8 default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div class="oracle8 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">DEFINE my_list <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">&quot; 'the Life', 'the Universe', 'and Everything'&quot;</span><br />
<br />
<span style="color: #993333; font-weight: bold; text-transform: uppercase;">SELECT</span> <span style="color: #66cc66;">*</span><br />
<span style="color: #993333; font-weight: bold; text-transform: uppercase;">FROM</span> Book<br />
<span style="color: #993333; font-weight: bold; text-transform: uppercase;">WHERE</span> answer <span style="color: #993333; font-weight: bold; text-transform: uppercase;">IN</span> <span style="color: #66cc66;">&#40;</span> &amp;my_list <span style="color: #66cc66;">&#41;</span>;</div></div>
<div style="height:33px; padding-top:2px; padding-bottom:2px; clear:both;" class="zare366"><div style="float:left; width:100px; " class="zare366_facebook_like"> 
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.memosoup.com%2F20091216%2Foracle-using-substitution-variables-in-sqlplus.html&amp;layout=button_count&amp;show_faces=false&amp;width=100&amp;action=like&amp;colorscheme=light&amp;height=27" 
					scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:27px;" allowTransparency="true"></iframe>
			</div><div style="float:left; width:90px; padding-left:10px;" class="zare366_google1"> 
				<g:plusone size="medium" href="http://www.memosoup.com/20091216/oracle-using-substitution-variables-in-sqlplus.html" ></g:plusone>
			</div><div style="float:left; width:110px; padding-left:10px;" class="zare366_twitter"> 
				<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
					data-text="Oracle: using substitution variables in sqlplus" data-url="http://www.memosoup.com/20091216/oracle-using-substitution-variables-in-sqlplus.html">Tweet</a> 
			</div></div>
		<div style="display:none;"><a href="http://www.news365live.com">news and informations</a>&nbsp;<a href="http://news365online.com">automotive,business,crime,health,life,politics,science,technology,travel</a><a href="http://worldnews365online.com">automotive,business,crime,health,life,politics,science,technology,travel</a></div><div style="clear:both;"></div>]]></content:encoded>
			<wfw:commentRss>http://www.memosoup.com/20091216/oracle-using-substitution-variables-in-sqlplus.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

