<?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>Andrew Fraser DBA</title>
	<atom:link href="http://andrewfraserdba.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://andrewfraserdba.com</link>
	<description>Oracle DBA (plus SQL Server)</description>
	<lastBuildDate>Fri, 16 Jul 2010 13:26:54 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Install latest version of Oracle ODBC</title>
		<link>http://andrewfraserdba.com/2010/06/17/install-latest-version-of-oracle-odbc/</link>
		<comments>http://andrewfraserdba.com/2010/06/17/install-latest-version-of-oracle-odbc/#comments</comments>
		<pubDate>Thu, 17 Jun 2010 16:27:29 +0000</pubDate>
		<dc:creator>Andrew Fraser</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://andrewfraserdba.com/?p=390</guid>
		<description><![CDATA[To install latest version of Oracle ODBC:
Go to http://www.oracle.com/technology/tech/oci/instantclient/ to download:

Instant Client Package &#8211; Basic
Instant Client Package &#8211; ODBC

Unzip both of them into the same folder (e.g. c:\oracle).

Add that folder name into the PATH environment variable (right click my computer, manage, system properties, advanced tab, environment variables)
Create a new environment variable called TNS_ADMIN and set [...]]]></description>
			<content:encoded><![CDATA[<p>To install latest version of Oracle ODBC:</p>
<p>Go to <a href="http://www.oracle.com/technology/tech/oci/instantclient/index.html">http://www.oracle.com/technology/tech/oci/instantclient/</a> to download:</p>
<ul>
<li>Instant Client Package &#8211; Basic</li>
<li>Instant Client Package &#8211; ODBC</li>
</ul>
<p>Unzip both of them into the same folder (e.g. c:\oracle).</p>
<ul>
<li>Add that folder name into the PATH environment variable (right click my computer, manage, system properties, advanced tab, environment variables)</li>
<li>Create a new environment variable called TNS_ADMIN and set it to that folder name.</li>
<li>Create a file tnsnames.ora in that folder with your target database details.</li>
<li>Run odb_install.exe</li>
</ul>
<p>You can then add and test oracle odbc connections in Control Panel Administrative Tools.</p>
]]></content:encoded>
			<wfw:commentRss>http://andrewfraserdba.com/2010/06/17/install-latest-version-of-oracle-odbc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>O&#8217;Reilly&#8217;s Steve Feuerstein Oracle PL/SQL Programming</title>
		<link>http://andrewfraserdba.com/2010/06/16/oreillys-steve-feuerstein-oracle-plsql-programming/</link>
		<comments>http://andrewfraserdba.com/2010/06/16/oreillys-steve-feuerstein-oracle-plsql-programming/#comments</comments>
		<pubDate>Wed, 16 Jun 2010 12:05:18 +0000</pubDate>
		<dc:creator>Andrew Fraser</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://andrewfraserdba.com/?p=388</guid>
		<description><![CDATA[O&#8217;Reilly&#8217;s Steve Feuerstein Oracle PL/SQL Programming, 2nd Edition online at http://soft.buaa.edu.cn/oracle/bookshelf/Oreilly/prog2/
]]></description>
			<content:encoded><![CDATA[<p>O&#8217;Reilly&#8217;s Steve Feuerstein Oracle PL/SQL Programming, 2nd Edition online at <a href="http://soft.buaa.edu.cn/oracle/bookshelf/Oreilly/prog2/">http://soft.buaa.edu.cn/oracle/bookshelf/Oreilly/prog2/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://andrewfraserdba.com/2010/06/16/oreillys-steve-feuerstein-oracle-plsql-programming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Plugins for Wordpress Code Display</title>
		<link>http://andrewfraserdba.com/2010/06/08/plugins-for-wordpress-code-display/</link>
		<comments>http://andrewfraserdba.com/2010/06/08/plugins-for-wordpress-code-display/#comments</comments>
		<pubDate>Tue, 08 Jun 2010 15:59:11 +0000</pubDate>
		<dc:creator>Andrew Fraser</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://andrewfraserdba.com/?p=372</guid>
		<description><![CDATA[This plugin is pretty much essential to get wordpress to display code:

Syntax Highlighter and Code Prettifier Plugin for WordPress

The other plugins I use are:

wp-table
Google XML Sitemaps
Akismet

]]></description>
			<content:encoded><![CDATA[<p>This plugin is pretty much essential to get wordpress to display code:</p>
<ul>
<li><a href="http://www.lastengine.com/syntax-highlighter-wordpress-plugin/">Syntax Highlighter and Code Prettifier Plugin for WordPress</a></li>
</ul>
<p>The other plugins I use are:</p>
<ul>
<li>wp-table</li>
<li>Google XML Sitemaps</li>
<li>Akismet</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://andrewfraserdba.com/2010/06/08/plugins-for-wordpress-code-display/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>chr(163) for £ pound character</title>
		<link>http://andrewfraserdba.com/2010/06/08/chr163-for-pound-character/</link>
		<comments>http://andrewfraserdba.com/2010/06/08/chr163-for-pound-character/#comments</comments>
		<pubDate>Tue, 08 Jun 2010 13:42:44 +0000</pubDate>
		<dc:creator>Andrew Fraser</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://andrewfraserdba.com/?p=276</guid>
		<description><![CDATA[Use chr(163) for the &#8216;£&#8217; character, especially in stored SQL such as create procedure scripts, where you can&#8217;t be sure what client character settings might be used to re-create the procedure.
SELECT m.description, chr(163)&#124;&#124;TO_CHAR(m.weekly_rate, '999.99') amount from my_table m;
This plsql gives the full list of ASCII codes:
set serveroutput on size 10240
declare
   i number;
  [...]]]></description>
			<content:encoded><![CDATA[<p>Use chr(163) for the &#8216;£&#8217; character, especially in stored SQL such as create procedure scripts, where you can&#8217;t be sure what client character settings might be used to re-create the procedure.</p>
<pre  class="brush:sql">SELECT m.description, chr(163)||TO_CHAR(m.weekly_rate, '999.99') amount from my_table m;</pre>
<p>This plsql gives the full list of ASCII codes:</p>
<pre  class="brush:sql">set serveroutput on size 10240
declare
   i number;
   j number;
   k number;
begin
   for i in 2..15 loop
       for j in 1..16 loop
           k:=i*16+j;
           dbms_output.put((to_char(k,'000'))||':'||chr(k)||'  ');
           if k mod 8 = 0 then
              dbms_output.put_line(' ');
           end if;
       end loop;
   end loop;
end;
/</pre>
<p>(From <a href="http://www.orafaq.com/wiki/ASCII">http://www.orafaq.com/wiki/ASCII</a> )</p>
]]></content:encoded>
			<wfw:commentRss>http://andrewfraserdba.com/2010/06/08/chr163-for-pound-character/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>chr(13) chr(10) carriage return line feed CR LF</title>
		<link>http://andrewfraserdba.com/2010/06/08/chr13-chr10-carriage-return-line-feed-cr-lf/</link>
		<comments>http://andrewfraserdba.com/2010/06/08/chr13-chr10-carriage-return-line-feed-cr-lf/#comments</comments>
		<pubDate>Tue, 08 Jun 2010 09:56:54 +0000</pubDate>
		<dc:creator>Andrew Fraser</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://andrewfraserdba.com/?p=273</guid>
		<description><![CDATA[chr(13) and chr(10) are the carriage return line feed CR LF characters, so to strip them out:
select replace(replace(m.long_notes,chr(10),' '),chr(13),' ') from mytable m;
]]></description>
			<content:encoded><![CDATA[<p>chr(13) and chr(10) are the carriage return line feed CR LF characters, so to strip them out:</p>
<pre  class="brush:sql">select replace(replace(m.long_notes,chr(10),' '),chr(13),' ') from mytable m;</pre>
]]></content:encoded>
			<wfw:commentRss>http://andrewfraserdba.com/2010/06/08/chr13-chr10-carriage-return-line-feed-cr-lf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>sqltrpt readable formatting</title>
		<link>http://andrewfraserdba.com/2010/06/03/sqltrpt-readable-formatting/</link>
		<comments>http://andrewfraserdba.com/2010/06/03/sqltrpt-readable-formatting/#comments</comments>
		<pubDate>Thu, 03 Jun 2010 17:35:23 +0000</pubDate>
		<dc:creator>Andrew Fraser</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://andrewfraserdba.com/?p=271</guid>
		<description><![CDATA[Output of sqltrpt is more readable with these settings:
set pages 9999 lines 192
col plan_plus_exp form a132
@?/rdbms/admin/sqltrpt
]]></description>
			<content:encoded><![CDATA[<p>Output of sqltrpt is more readable with these settings:</p>
<pre  class="brush:sql">set pages 9999 lines 192
col plan_plus_exp form a132
@?/rdbms/admin/sqltrpt</pre>
]]></content:encoded>
			<wfw:commentRss>http://andrewfraserdba.com/2010/06/03/sqltrpt-readable-formatting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting bind variables in sql*plus</title>
		<link>http://andrewfraserdba.com/2010/06/03/setting-bind-variables-in-sqlplus/</link>
		<comments>http://andrewfraserdba.com/2010/06/03/setting-bind-variables-in-sqlplus/#comments</comments>
		<pubDate>Thu, 03 Jun 2010 14:43:16 +0000</pubDate>
		<dc:creator>Andrew Fraser</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://andrewfraserdba.com/?p=269</guid>
		<description><![CDATA[variable b1 varchar2(6) ;
exec :b1 := '2009'
Used mainly for sql tuning rather than in real code.
]]></description>
			<content:encoded><![CDATA[<pre  class="brush:sql">variable b1 varchar2(6) ;
exec :b1 := '2009'</pre>
<p>Used mainly for sql tuning rather than in real code.</p>
]]></content:encoded>
			<wfw:commentRss>http://andrewfraserdba.com/2010/06/03/setting-bind-variables-in-sqlplus/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQL profile drop</title>
		<link>http://andrewfraserdba.com/2010/06/03/sql-profile-drop/</link>
		<comments>http://andrewfraserdba.com/2010/06/03/sql-profile-drop/#comments</comments>
		<pubDate>Thu, 03 Jun 2010 14:31:11 +0000</pubDate>
		<dc:creator>Andrew Fraser</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://andrewfraserdba.com/?p=267</guid>
		<description><![CDATA[If you have accepted a sql profile from a tuning advisor recommandation like:
execute dbms_sqltune.accept_sql_profile(task_name => 'TASK_239607', replace => TRUE);
Then the regression commands to back it out are like:
select name from dba_sql_profiles;
exec dbms_sqltune.drop_sql_profile('MYNAME')
]]></description>
			<content:encoded><![CDATA[<p>If you have accepted a sql profile from a tuning advisor recommandation like:</p>
<pre  class="brush:sql">execute dbms_sqltune.accept_sql_profile(task_name => 'TASK_239607', replace => TRUE);</pre>
<p>Then the regression commands to back it out are like:</p>
<pre  class="brush:sql">select name from dba_sql_profiles;
exec dbms_sqltune.drop_sql_profile('MYNAME')</pre>
]]></content:encoded>
			<wfw:commentRss>http://andrewfraserdba.com/2010/06/03/sql-profile-drop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Change oracle password temporarily</title>
		<link>http://andrewfraserdba.com/2010/06/03/change-oracle-password-temporarily/</link>
		<comments>http://andrewfraserdba.com/2010/06/03/change-oracle-password-temporarily/#comments</comments>
		<pubDate>Thu, 03 Jun 2010 10:48:25 +0000</pubDate>
		<dc:creator>Andrew Fraser</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://andrewfraserdba.com/?p=263</guid>
		<description><![CDATA[Want to connect as a particular user but don&#8217;t know their password? You can temporarily change it and then reset it back, if you have DBA/alter any user privilege:
SQL> select password from dba_users where username = 'MYUSER';

PASSWORD
------------------------------
086FAA387C794B46

SQL> alter user MYUSER identified by mypassword ;

User altered.

SQL> conn MYUSER/mypassword
Connected.
SQL> alter user MYUSER identified by values '086FAA387C794B46';

User altered.

SQL> [...]]]></description>
			<content:encoded><![CDATA[<p>Want to connect as a particular user but don&#8217;t know their password? You can temporarily change it and then reset it back, if you have DBA/alter any user privilege:</p>
<pre  class="brush:sql">SQL> select password from dba_users where username = 'MYUSER';

PASSWORD
------------------------------
086FAA387C794B46

SQL> alter user MYUSER identified by mypassword ;

User altered.

SQL> conn MYUSER/mypassword
Connected.
SQL> alter user MYUSER identified by values '086FAA387C794B46';

User altered.

SQL> sho user
USER is "MYUSER"</pre>
<p>The above works for versions up to 10g. For 11g, instead use:</p>
<pre  class="brush:sql">SQL> set long 9999
SQL> select dbms_metadata.get_ddl ('USER', 'MYUSER') from dual ;
</pre>
<p>Source: <a href="http://laurentschneider.com/wordpress/2007/08/the-password-is-not-longer-displayed-in-dba_userspassword.html">Laurent Schneider</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://andrewfraserdba.com/2010/06/03/change-oracle-password-temporarily/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle Forms Dropdown List Item values populated from database table</title>
		<link>http://andrewfraserdba.com/2010/05/27/oracle-forms-dropdown-list-item-values-populated-from-database-table/</link>
		<comments>http://andrewfraserdba.com/2010/05/27/oracle-forms-dropdown-list-item-values-populated-from-database-table/#comments</comments>
		<pubDate>Thu, 27 May 2010 17:19:48 +0000</pubDate>
		<dc:creator>Andrew Fraser</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://andrewfraserdba.com/?p=259</guid>
		<description><![CDATA[Popup LOV boxes that retrieve their list from a database table are relatively easy to set up in oracle forms, the equivalent for a dropdown list item takes a bit more work.
1) First, create a new item in the canvas with item type as &#8216;List Item&#8217; &#8211; or, in my case I changed the item [...]]]></description>
			<content:encoded><![CDATA[<p>Popup LOV boxes that retrieve their list from a database table are relatively easy to set up in oracle forms, the equivalent for a dropdown list item takes a bit more work.</p>
<p>1) First, create a new item in the canvas with item type as &#8216;List Item&#8217; &#8211; or, in my case I changed the item type of an existing &#8216;text item&#8217; called CONTROL.CAS_UPLOAD to be a &#8216;list item&#8217;.</p>
<p>2) Second, create a procedure like the below. This is a procedure within the form, listed under program units, <strong>not</strong> a database stored procedure.</p>
<p>The second column selected here is the one that is actually passed into the form control, even although slightly confusingly the box will display the first column value after selection is made. Only the first column is shown in the drop down.</p>
<p>CONTROL.CAS_UPLOAD here is the name of my list item (cas_upload), qualified by block name (control).</p>
<pre  class="brush:sql">PROCEDURE CREATE_Filenames_RG  IS
-- Andrew Fraser v2.2 27th May 2010
-- Populate dynamic lookup

    it_id1   Item := Find_Item('CONTROL.CAS_UPLOAD');  

    group1_id    RecordGroup;

    GRP_status       NUMBER; 

    V_Space varchar2(10) := ''''||'0'||'''';

BEGIN

  group1_id := Find_Group('FILENAMES_RG');  

  IF NOT Id_Null(group1_id) THEN
  	delete_group(group1_id);
  END IF;
  group1_id := Create_Group_From_Query('FILENAMES_RG',
        'SELECT TO_CHAR(f.date_created, ''DD-Mon-YYYY HH24:MI'')||'||''''||' -- '||''''||'||f.file_name , f.file_name '
     ||' FROM filename_table f'
     ||' WHERE f.flag_processed = ''N'''
     ||' ORDER BY f.date_created, f.file_name') ; 

    Grp_status := Populate_Group('FILENAMES_RG');
  	IF Grp_status = 0 THEN
			If Not Id_Null(it_id1) THEN
		  	If Get_Item_Property(it_id1,Item_Type) = 'LIST' Then
	  	 	  Clear_List(it_id1);
	   		  Populate_List(it_id1,'FILENAMES_RG');
  		  END IF;
			END IF;
			END IF;

End;
</pre>
<p>3) Create/edit triggers to call this:</p>
<p>On form startup:</p>
<p><strong>When-New-Form-Instance</strong> on the form as a whole:</p>
<pre  class="brush:sql">-- Andrew Fraser v2.2 27-May-2010
CREATE_Filenames_RG;</pre>
<p>And/or on mouse click if you want the database table requeried every single time the user clicks on the dropdown:</p>
<p><strong>When-Mouse-Click</strong> on the new item itself:</p>
<pre  class="brush:sql">-- Andrew Fraser v2.2 27-May-2010
Clear_List('CAS_UPLOAD');
Clear_Item;
CREATE_Filenames_RG;</pre>
<p>4) Note that hard-coded lists get created with a record group and an associated LOV. Counter-intuitively, these are <strong>not</strong> used at all in the above method for database lookups.</p>
]]></content:encoded>
			<wfw:commentRss>http://andrewfraserdba.com/2010/05/27/oracle-forms-dropdown-list-item-values-populated-from-database-table/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
