<?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>Creativz Lab &#187; PL/SQL</title>
	<atom:link href="http://creativeslab.net/category/plsql/feed" rel="self" type="application/rss+xml" />
	<link>http://creativeslab.net</link>
	<description>weblog for Developers &#38; Designers</description>
	<lastBuildDate>Sun, 18 Jul 2010 16:37:15 +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>Retrieve active users in Oracle Applications</title>
		<link>http://creativeslab.net/retrieve-active-users-in-oracle-applications</link>
		<comments>http://creativeslab.net/retrieve-active-users-in-oracle-applications#comments</comments>
		<pubDate>Fri, 26 Jun 2009 04:19:43 +0000</pubDate>
		<dc:creator>chetanz</dc:creator>
				<category><![CDATA[Oracle Applications]]></category>
		<category><![CDATA[Oracle Database]]></category>
		<category><![CDATA[PL/SQL]]></category>
		<category><![CDATA[active oracle user]]></category>
		<category><![CDATA[Fnd user]]></category>
		<category><![CDATA[Oracle Apps]]></category>
		<category><![CDATA[oracle user]]></category>

		<guid isPermaLink="false">http://creativeslab.net/?p=49</guid>
		<description><![CDATA[retrieve currently active and valid fnd user from oracle applications]]></description>
			<content:encoded><![CDATA[<p>If you want to retrieve only active users from fnd_user table in Oracle Applications, i.e, discarding users who have end_date greater than today&#8217;s date, you can use following query.</p>
<p>SELECT *<br />
      FROM apps.fnd_user<br />
      WHERE trunc(SYSDATE) BETWEEN trunc(start_date) AND<br />
            nvl(end_date,trunc(SYSDATE));</p>
]]></content:encoded>
			<wfw:commentRss>http://creativeslab.net/retrieve-active-users-in-oracle-applications/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Split String using Oracle PL/SQL</title>
		<link>http://creativeslab.net/split-string-using-oracle-plsql</link>
		<comments>http://creativeslab.net/split-string-using-oracle-plsql#comments</comments>
		<pubDate>Thu, 25 Jun 2009 20:45:38 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Oracle Database]]></category>
		<category><![CDATA[PL/SQL]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Software Programming]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Oracle Strings]]></category>
		<category><![CDATA[pl/sql procedure]]></category>
		<category><![CDATA[PL/SQL SPLIT]]></category>
		<category><![CDATA[split string]]></category>
		<category><![CDATA[string functions]]></category>
		<category><![CDATA[string split]]></category>

		<guid isPermaLink="false">http://creativeslab.net/?p=47</guid>
		<description><![CDATA[Oracle PL/SQL provides various string functions, but there is no direct function to split a string into substrings, we need to write a custom code to do this task.]]></description>
			<content:encoded><![CDATA[<p>Oracle PL/SQL provides various string functions, but there is no direct function to split a string into substrings, where as 4GL languages have direct functions to split strings.</p>
<p>We can split a string into substrings using PL/SQL built in functions SUBSTR(), INSTR() and LENGTH() together.</p>
<p>Follwing code snippets helps you in splitting a string into substrings.</p>
<p>Snippet to split string into pieces:::</p>
<p><strong>CREATE OR REPLACE FUNCTION func_str_split(str_to_split   IN OUT VARCHAR2<br />
                 ,str_delimiter IN     VARCHAR2) RETURN VARCHAR2<br />
IS<br />
  t_pos   NUMBER;<br />
  t_len   NUMBER;<br />
  t_strlen   NUMBER;<br />
  t_strresult VARCHAR2(2000);<br />
BEGIN<br />
  t_strresult := NULL;<br />
  IF str_to_split IS NOT NULL THEN<br />
    t_len := LENGTH(str_delimiter);<br />
    t_strlen := LENGTH(str_to_split);<br />
    t_pos := INSTR(str_to_split,str_delimiter);<br />
    IF t_pos &gt; 0 THEN<br />
      t_strresult := SUBSTR(str_to_split,1,t_pos-1);<br />
      str_to_split := SUBSTR(str_to_split,t_pos+t_len,t_strlen);<br />
    ELSE<br />
      t_strresult := str_to_split;<br />
      str_to_split := NULL;<br />
    END IF;<br />
  END IF;<br />
  RETURN t_strresult;<br />
END func_str_split;</strong></p>
<p>Use following procedure to call above function:::</p>
<p><strong>CREATE OR REPLACE PROCEDURE proc_str_split(str_to_split   IN OUT VARCHAR2<br />
                 ,str_delimiter IN  VARCHAR2)<br />
IS<br />
 declare </p>
<p> RetVal varchar2(150);</p>
<p>BEGIN</p>
<p>WHILE str_to_split IS NOT NULL LOOP<br />
     RetVal := func_str_split ( str_to_split, str_delimiter );<br />
     dbms_output.put_line(RetVal);<br />
END LOOP;</p>
<p>END proc_str_split;</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://creativeslab.net/split-string-using-oracle-plsql/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to know Request Group name of Concurrent Programs in Oracle Applications</title>
		<link>http://creativeslab.net/how-to-know-request-group-name-of-concurrent-programs-oracle-applications</link>
		<comments>http://creativeslab.net/how-to-know-request-group-name-of-concurrent-programs-oracle-applications#comments</comments>
		<pubDate>Wed, 27 May 2009 13:15:20 +0000</pubDate>
		<dc:creator>chetanz</dc:creator>
				<category><![CDATA[Oracle Applications]]></category>
		<category><![CDATA[Oracle Database]]></category>
		<category><![CDATA[PL/SQL]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Software Programming]]></category>
		<category><![CDATA[concurrent program]]></category>
		<category><![CDATA[Oracle Apps]]></category>
		<category><![CDATA[Oracle EBS]]></category>
		<category><![CDATA[Oracle ERP]]></category>
		<category><![CDATA[request group]]></category>

		<guid isPermaLink="false">http://creativeslab.net/?p=30</guid>
		<description><![CDATA[knowing request group name to which a concurrent program is associated helps in oracle apps.....]]></description>
			<content:encoded><![CDATA[<p>To know request group name, to which a concurrent program is associated and also executable name of the concurrent program, following query will be useful. For seeded concurrent programs it is known to everybody, but for custom concurrent programs it will be very difficult to memorize.</p>
<p>select<br />
fg.request_group_name,e.executable_name,responsibility_key,user_concurrent_program_name<br />
from fnd_responsibility r,<br />
fnd_concurrent_programs_tl p,<br />
fnd_request_group_units u,<br />
fnd_request_groups fg,<br />
fnd_executables e,<br />
fnd_concurrent_programs fcp<br />
where r.request_group_id=u.request_group_id<br />
and u.request_group_id = fg.request_group_id<br />
and u.request_unit_id = p.concurrent_program_id<br />
and fcp.executable_id = e.executable_id<br />
and user_concurrent_program_name like &#8216;%Period close value summary%&#8217;<br />
and fcp.concurrent_program_id = p.concurrent_program_id</p>
]]></content:encoded>
			<wfw:commentRss>http://creativeslab.net/how-to-know-request-group-name-of-concurrent-programs-oracle-applications/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Find concurrent programs associated with responsibility in Oracle Applications</title>
		<link>http://creativeslab.net/how-to-find-concurrent-programs-associated-with-responsibility-in-oracle-applications</link>
		<comments>http://creativeslab.net/how-to-find-concurrent-programs-associated-with-responsibility-in-oracle-applications#comments</comments>
		<pubDate>Wed, 27 May 2009 10:46:03 +0000</pubDate>
		<dc:creator>chetanz</dc:creator>
				<category><![CDATA[Oracle Applications]]></category>
		<category><![CDATA[Oracle Database]]></category>
		<category><![CDATA[Oracle Inventory]]></category>
		<category><![CDATA[PL/SQL]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[concurrent program]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Oracle EBS]]></category>
		<category><![CDATA[Oracle ERP]]></category>
		<category><![CDATA[responsibility]]></category>

		<guid isPermaLink="false">http://creativeslab.net/?p=28</guid>
		<description><![CDATA[Know concurrent programs associated with responsibility using responsiblity key]]></description>
			<content:encoded><![CDATA[<p>Oracle ERP system has n number of seeded concurrent programs and while implementation custom concurrent programs may come.</p>
<p>To find out various concurrent programs associated with certain responsibility, following query will be useful.</p>
<p>select user_concurrent_program_name  from fnd_concurrent_programs_tl<br />
where concurrent_program_id in (<br />
select request_unit_id from fnd_request_group_units<br />
where request_group_id in (<br />
select request_group_id from fnd_request_groups where request_group_id in (<br />
select request_group_id from fnd_responsibility where responsibility_key like &#8216;%ORACLE_INVENTORY%&#8217;)<br />
));</p>
]]></content:encoded>
			<wfw:commentRss>http://creativeslab.net/how-to-find-concurrent-programs-associated-with-responsibility-in-oracle-applications/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>File contents into BLOB in Oracle Database, using PL/SQL</title>
		<link>http://creativeslab.net/file-contents-into-blob-in-oracle-database-using-plsql</link>
		<comments>http://creativeslab.net/file-contents-into-blob-in-oracle-database-using-plsql#comments</comments>
		<pubDate>Tue, 16 Dec 2008 00:19:54 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Oracle Applications]]></category>
		<category><![CDATA[Oracle Database]]></category>
		<category><![CDATA[PL/SQL]]></category>
		<category><![CDATA[BLOB]]></category>
		<category><![CDATA[file BLOB]]></category>
		<category><![CDATA[Oracle Applicaions]]></category>
		<category><![CDATA[Oracle Technical]]></category>
		<category><![CDATA[pl/sql procedure]]></category>
		<category><![CDATA[PL/SQL. file reading]]></category>

		<guid isPermaLink="false">http://creativeslab.net/?p=15</guid>
		<description><![CDATA[Often there will be a requirement for reading .out files generated by Oracle Applications and converting into pdf files and send as mail attachment.
 
Here is a sample PL/SQL procedure which can read a file from a specified location, into a BLOB and returns it.
 
The calling program can convert this blob data into any form.
 
Calling program [...]]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal" style="margin: 0in 0in 0pt"><span style="font-size: small;font-family: Times New Roman">Often there will be a requirement for reading .out files generated by Oracle Applications and converting into pdf files and send as mail attachment.</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt"><span style="font-size: small;font-family: Times New Roman"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt"><span style="font-size: small;font-family: Times New Roman">Here is a sample PL/SQL procedure which can read a file from a specified location, into a BLOB and returns it.</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt"><span style="font-size: small;font-family: Times New Roman"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt"><span style="font-size: small;font-family: Times New Roman">The calling program can convert this blob data into any form.</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt"><span style="font-size: small;font-family: Times New Roman"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt"><span style="font-size: small;font-family: Times New Roman">Calling program can be another PL/SQL procedure or a Java Program or some other language program.</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt"><span style="font-size: small;font-family: Times New Roman"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt"><span style="font-size: small;font-family: Times New Roman">Note: following procedure works only on Oracle Database.</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt"><span style="font-size: small;font-family: Times New Roman"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt"><span style="font-size: small;font-family: Times New Roman">=============================================================</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt"><span style="font-size: small;font-family: Times New Roman"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt"><span style="font-size: small;font-family: Times New Roman">create or replace procedure READ_FILE_TO_BLOB(</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1.5in"><span style="font-size: small;font-family: Times New Roman">dest_lob_return OUT BLOB, </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt 1.5in"><span style="font-size: small"><span style="font-family: Times New Roman">file_name IN VARCHAR2)</span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt"><span style="font-size: small"><span style="font-family: Times New Roman">is</span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt"><span><span style="font-size: small;font-family: Times New Roman">   </span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt"><span style="font-size: small"><span style="font-family: Times New Roman"><span>   </span><span> </span>&#8211; BFILE_LOC is the directory created, with help of </span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt"><span style="font-size: small"><span style="font-family: Times New Roman"><span>    </span>&#8211;create directory BFILE_LOC as &#8216;/export/home/test/d01/oratst/testcomn/admin/out/TEST_xxxxxxr06/&#8217;;</span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt"><span style="font-size: small"><span style="font-family: Times New Roman"><span>    </span>src_lob<span>  </span>BFILE := BFILENAME(‘BFILE_LOC’, file_name);<span>  </span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt"><span style="font-size: small"><span style="font-family: Times New Roman"><span>    </span>dest_lob BLOB;</span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt"><span style="font-size: small"><span style="font-family: Times New Roman"><span>    </span>v_lob_len INTEGER;</span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt"><span style="font-size: small"><span style="font-family: Times New Roman"><span>    </span>v_offset NUMBER := 1; </span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt"><span style="font-size: small"><span style="font-family: Times New Roman"><span>    </span>v_buffer<span>       </span>RAW(20);</span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt"><span style="font-size: small"><span style="font-family: Times New Roman"><span>    </span>v_buffer_size<span>  </span>BINARY_INTEGER := 20;</span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt"><span style="font-size: small;font-family: Times New Roman"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt"><span style="font-size: small"><span style="font-family: Times New Roman">BEGIN</span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt"><span style="font-size: small"><span style="font-family: Times New Roman"><span>   </span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt"><span style="font-size: small"><span style="font-family: Times New Roman"><span>   </span>DBMS_LOB.CREATETEMPORARY(dest_lob, TRUE, DBMS_LOB.SESSION); </span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt"><span style="font-size: small"><span style="font-family: Times New Roman"><span>   </span>DBMS_LOB.OPEN(src_lob, DBMS_LOB.LOB_READONLY);</span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt"><span style="font-size: small"><span style="font-family: Times New Roman"><span>   </span>DBMS_LOB.LoadFromFile( DEST_LOB =&gt; dest_lob,</span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt"><span style="font-size: small"><span style="font-family: Times New Roman"><span>     </span><span>                     </span>SRC_LOB<span>  </span>=&gt; src_lob,</span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt"><span style="font-size: small"><span style="font-family: Times New Roman"><span>                          </span>AMOUNT<span>   </span>=&gt; DBMS_LOB.GETLENGTH(src_lob) );</span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt"><span style="font-size: small"><span style="font-family: Times New Roman"><span>   </span>DBMS_LOB.CLOSE(src_lob);</span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt"><span style="font-size: small"><span style="font-family: Times New Roman"><span>   </span>dest_lob_return := dest_lob;</span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt"><span style="font-size: small"><span style="font-family: Times New Roman"><span>   </span></span></span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt"><span style="font-size: small;font-family: Times New Roman">end READ_FILE_TO_BLOB;</span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt"><span style="font-size: small;font-family: Times New Roman"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in 0pt"><span style="font-size: small;font-family: Times New Roman">===============================================================</span></p>
]]></content:encoded>
			<wfw:commentRss>http://creativeslab.net/file-contents-into-blob-in-oracle-database-using-plsql/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
