<?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>ORACLE-BASE Blog Aggregator &#187; Dimitri Gielis</title>
	<atom:link href="http://www.oracle-base.com/aggregator/author/dimitri-gielis/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.oracle-base.com/aggregator</link>
	<description>Blogs I follow...</description>
	<lastBuildDate>Mon, 06 Feb 2012 11:08:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>E-Business Suite and APEX integration using APIs (1)</title>
		<link>http://feedproxy.google.com/~r/DimitriGielisBlog/~3/6ZkmYOj4T5A/e-business-suite-and-apex-integration_05.html</link>
		<comments>http://feedproxy.google.com/~r/DimitriGielisBlog/~3/6ZkmYOj4T5A/e-business-suite-and-apex-integration_05.html#comments</comments>
		<pubDate>Sun, 05 Feb 2012 22:07:00 +0000</pubDate>
		<dc:creator>Dimitri Gielis</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.oracle-base.com/aggregator/?guid=128aa21235e3c73095ff30f720a7affc</guid>
		<description><![CDATA[I didn't expect to many technical issues using E-Business Suite (EBS) APIs in APEX as it's basically a call to PL/SQL packages.Next to that the EBS APIs seems to be well documented. I first didn't realise, but for a long time I was using the Oracle Int...]]></description>
			<content:encoded><![CDATA[<div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/-puu8o7sMzZM/Ty7L0PqT_vI/AAAAAAAAGQ0/pfrqrk6fkv8/s1600/ebs_apis.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="133" src="http://3.bp.blogspot.com/-puu8o7sMzZM/Ty7L0PqT_vI/AAAAAAAAGQ0/pfrqrk6fkv8/s320/ebs_apis.png" width="320" /></a></div>I didn't expect to many technical issues using E-Business Suite (EBS) APIs in APEX as it's basically a call to PL/SQL packages.<br /><br />Next to that the EBS APIs seems to be well documented. I first didn't realise, but for a long time I was using the <a href="http://irep.oracle.com/index.html" >Oracle Integration Repository for EBS R11</a>&nbsp;(whereas I'm using R12).<br /><br /><a href="http://2.bp.blogspot.com/-ByU1GP0Ih1c/Ty7QhXKbzsI/AAAAAAAAGRA/EgBRg-ffRak/s1600/Screen+Shot+2012-02-05+at+19.54.39.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="316" src="http://2.bp.blogspot.com/-ByU1GP0Ih1c/Ty7QhXKbzsI/AAAAAAAAGRA/EgBRg-ffRak/s640/Screen+Shot+2012-02-05+at+19.54.39.png" width="640" /></a><br /><br />For EBS R12 the Oracle Integration Repository ships as part of the E-Business Suite. To access it, in&nbsp;the Navigator menu, select the Integrated SOA Gateway responsibility, then click on the Integration Repository link.<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/-PQg6ktZZz48/Ty7VdjHfaXI/AAAAAAAAGRM/o5USCkNRMBE/s1600/Screen+Shot+2012-02-05+at+20.15.26.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="352" src="http://2.bp.blogspot.com/-PQg6ktZZz48/Ty7VdjHfaXI/AAAAAAAAGRM/o5USCkNRMBE/s640/Screen+Shot+2012-02-05+at+20.15.26.png" width="640" /></a></div><br />Using the Oracle Integration Repository I would have found it more useful if I could define the number of results (maybe you can, but I didn't find that setting). At the moment I get only 10 results at a time, which is too low for me.<br /><br />I also found it not that easy to find the right API to use. I guess it comes by experience. Next to that, the parameters are not always the same, so the API could be more consistent.<br /><br />For example I want to create and edit a person. In the navigator I went to Human Resources Suite &gt; Human Resource. That was logic for me. Next I looked into the list and saw Employee, so that was a logic choice for me. In there I found the HR_EMPLOYEE_API. That API allows to create an employee. So far so good, but where is the edit? I couldn't really find it, until I asked a friend and he told me to look for person. So when I went to HR Person(1) in the navigator I saw the HR_PERSON_API and in there you find the update and delete of a person.<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="http://4.bp.blogspot.com/-xKLwefsiplU/Ty7czC3VeAI/AAAAAAAAGRY/U0xVz74GnzE/s1600/Screen+Shot+2012-02-05+at+20.46.49.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="346" src="http://4.bp.blogspot.com/-xKLwefsiplU/Ty7czC3VeAI/AAAAAAAAGRY/U0xVz74GnzE/s640/Screen+Shot+2012-02-05+at+20.46.49.png" width="640" /></a></div><br />When you look at the parameters; in HR_EMPLOYEE_API.CREATE_EMPLOYEE you see a parameter p_per_comments, in HR_PERSON_API.UPDATE_PERSON you see a parameter p_comments. It would have been easier if the parameters were consistent.<br /><br />So once I got familiar with APIs, I started with the integration in my APEX app. Here are the steps to drill-down into a person from the people report (see <a href="http://dgielis.blogspot.com/2012/02/e-business-suite-and-apex-integration_03.html" >previous post</a>) and edit his or her email address.<br /><br />Just as with the views I find it a good practice to not grant execute on the entire libraries of EBS to your own schema. I prefer to create my own packages in the APPS schema e.g. apex_api_pkg and call the correct API calls from there. The advantage is that you can add logging to your own package or do some other extra logic in there. For example APEX passes typically back values as strings, but some API calls need to be passed (next to varchar2) as a date, a number or a boolean. So you could choose to have all input strings in varchar2 in the apex_api_pkg and do the conversion inside the package to the correct one. In the below code I didn't do that, instead I went for an almost 1-on-1 mapping.<br /><br /><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">create or replace package apex_api_pkg</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">as</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">procedure update_person_email (</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; &nbsp; p_effective_date &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;in date,</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; &nbsp; p_datetrack_update_mode &nbsp; &nbsp; in varchar2,</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; &nbsp; p_person_id &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; in number,</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; &nbsp; p_email_address &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; in varchar2,</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; &nbsp; p_object_version_number &nbsp; &nbsp; in out number,</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; &nbsp; p_employee_number &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; out varchar2,</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; &nbsp; p_effective_start_date &nbsp; &nbsp; &nbsp;out date,</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; &nbsp; p_effective_end_date &nbsp; &nbsp; &nbsp; &nbsp;out date,</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; &nbsp; p_full_name &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; out varchar2,</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; &nbsp; p_comment_id &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;out number,</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; &nbsp; p_name_combination_warning &nbsp;out boolean,</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; &nbsp; p_assign_payroll_warning &nbsp; &nbsp;out boolean,</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; &nbsp; p_orig_hire_warning &nbsp; &nbsp; &nbsp; &nbsp; out boolean</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">);</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">end apex_api_pkg;</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">/</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">create or replace package body apex_api_pkg</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">as</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">procedure update_person_email (</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; &nbsp; p_effective_date &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;in date,</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; &nbsp; p_datetrack_update_mode &nbsp; &nbsp; in varchar2,</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; &nbsp; p_person_id &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; in number,</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; &nbsp; p_email_address &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; in varchar2,</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; &nbsp; p_object_version_number &nbsp; &nbsp; in out number,</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; &nbsp; p_employee_number &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; out varchar2,</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; &nbsp; p_effective_start_date &nbsp; &nbsp; &nbsp;out date,</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; &nbsp; p_effective_end_date &nbsp; &nbsp; &nbsp; &nbsp;out date,</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; &nbsp; p_full_name &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; out varchar2,</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; &nbsp; p_comment_id &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;out number,</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; &nbsp; p_name_combination_warning &nbsp;out boolean,</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; &nbsp; p_assign_payroll_warning &nbsp; &nbsp;out boolean,</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; &nbsp; p_orig_hire_warning &nbsp; &nbsp; &nbsp; &nbsp; out boolean</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">)</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">is</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; l_object_version_number &nbsp; &nbsp; number;</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; l_employee_number &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; varchar2(4000);</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; l_effective_start_date &nbsp; &nbsp; &nbsp;date;</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; l_effective_end_date &nbsp; &nbsp; &nbsp; &nbsp;date;</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; l_full_name &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; varchar2(4000);</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; l_comment_id &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;number;</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; l_name_combination_warning &nbsp;boolean;</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; l_assign_payroll_warning &nbsp; &nbsp;boolean;</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; l_orig_hire_warning &nbsp; &nbsp; &nbsp; &nbsp; boolean; &nbsp;</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">begin</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; l_object_version_number := p_object_version_number;</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; hr_person_api.update_person (</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; &nbsp; p_effective_date &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=&gt; p_effective_date,</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; &nbsp; p_datetrack_update_mode &nbsp; &nbsp; =&gt; p_datetrack_update_mode,</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; &nbsp; p_person_id &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =&gt; p_person_id,</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; &nbsp; p_email_address &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =&gt; p_email_address,</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; &nbsp; p_object_version_number &nbsp; &nbsp; =&gt; l_object_version_number,</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; &nbsp; p_employee_number &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =&gt; l_employee_number,</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; &nbsp; p_effective_start_date &nbsp; &nbsp; &nbsp;=&gt; l_effective_start_date,</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; &nbsp; p_effective_end_date &nbsp; &nbsp; &nbsp; &nbsp;=&gt; l_effective_end_date,</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; &nbsp; p_full_name &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =&gt; l_full_name,</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; &nbsp; p_comment_id &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=&gt; l_comment_id,</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; &nbsp; p_name_combination_warning &nbsp;=&gt; l_name_combination_warning,</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; &nbsp; p_assign_payroll_warning &nbsp; &nbsp;=&gt; l_assign_payroll_warning,</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; &nbsp; p_orig_hire_warning &nbsp; &nbsp; &nbsp; &nbsp; =&gt; l_orig_hire_warning</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; );</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">end update_person_email;</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">end apex_api_pkg;</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">/</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-family: Times;">The next thing is to grant execute privileges on this package to your own user which is linked to your APEX workspace:</span></span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><span class="Apple-style-span" style="font-family: Times;"><br /></span></span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">grant execute on apex_api_pkg to apex_ebs;</span><br /><br /><br />In the APEX application we create a new Form based on this procedure. I found that the APEX wizard didn't work in my case (but more on that in another post). I created a new Blank Page, add a region to it and a couple of items.<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/-Da8_M5SGEeQ/Ty730SaB2PI/AAAAAAAAGRk/6PXdm35h0WM/s1600/Screen+Shot+2012-02-05+at+22.42.15.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="480" src="http://2.bp.blogspot.com/-Da8_M5SGEeQ/Ty730SaB2PI/AAAAAAAAGRk/6PXdm35h0WM/s640/Screen+Shot+2012-02-05+at+22.42.15.png" width="640" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: left;">From my report I created an edit link to this new page and I pass the value of PERSON_ID to this page.</div>As I want to see the original data in my form (note that I didn't include all fields available in the API) I added a Fetch data process of type PL/SQL anonymous block with this code:<br /><br /><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">select full_name, email_address, effective_start_date, employee_number, object_version_number</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; into :P2_FULL_NAME, :P2_EMAIL_ADDRESS, :P2_EFFECTIVE_DATE, :P2_EMPLOYEE_NUMBER, :P2_OBJECT_VERSION_NUMBER</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; from apex_per_people_vw</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp;where person_id = :P2_PERSON_ID;</span><br /><br />When you hit the Apply Changes button I want the email address to update, that is why we have the Update email Process in Page Processing. The PL/SQL code is as follows:<br /><br /><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">declare</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; l_object_version_number &nbsp; &nbsp; number;</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; l_employee_number &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; varchar2(4000);</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; l_effective_start_date &nbsp; &nbsp; &nbsp;date;</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; l_effective_end_date &nbsp; &nbsp; &nbsp; &nbsp;date;</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; l_full_name &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; varchar2(4000);</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; l_comment_id &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;number;</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; l_name_combination_warning &nbsp;boolean;</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; l_assign_payroll_warning &nbsp; &nbsp;boolean;</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; l_orig_hire_warning &nbsp; &nbsp; &nbsp; &nbsp; boolean; &nbsp;</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">begin</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; l_object_version_number := to_number(:P2_OBJECT_VERSION_NUMBER);</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br /></span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; apps.apex_api_pkg.update_person_email (</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; &nbsp; p_effective_date &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=&gt; to_date(:P2_EFFECTIVE_DATE, 'DD-MON-YYYY'),</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; &nbsp; p_datetrack_update_mode &nbsp; &nbsp; =&gt; :P2_UPDATE_MODE,</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; &nbsp; p_person_id &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =&gt; to_number(:P2_PERSON_ID),</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; &nbsp; p_email_address &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =&gt; :P2_EMAIL_ADDRESS,</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; &nbsp; p_object_version_number &nbsp; &nbsp; =&gt; l_object_version_number,</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; &nbsp; p_employee_number &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =&gt; l_employee_number,</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; &nbsp; p_effective_start_date &nbsp; &nbsp; &nbsp;=&gt; l_effective_start_date,</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; &nbsp; p_effective_end_date &nbsp; &nbsp; &nbsp; &nbsp;=&gt; l_effective_end_date,</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; &nbsp; p_full_name &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =&gt; l_full_name,</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; &nbsp; p_comment_id &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=&gt; l_comment_id,</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; &nbsp; p_name_combination_warning &nbsp;=&gt; l_name_combination_warning,</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; &nbsp; p_assign_payroll_warning &nbsp; &nbsp;=&gt; l_assign_payroll_warning,</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; &nbsp; p_orig_hire_warning &nbsp; &nbsp; &nbsp; &nbsp; =&gt; l_orig_hire_warning</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&nbsp; );</span><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">end;</span><br /><br />I just do the necessary to update the email, I don't do that much yet with the output parameters, but you could transfer that back to the page if you wanted to. Also note that the package is in the APPS schema, so don't forget to add the owner in front of it. You could create a synonym in your own schema if you preferred. For the view I find it important to have those in my own schema too, for packages only if I wanted to add some extra logic to it.<br /><br />Running the page shows you the below form.<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="http://4.bp.blogspot.com/-ETZ98j-3sEs/Ty751y5GeMI/AAAAAAAAGRw/wfFgptdxYgU/s1600/Screen+Shot+2012-02-05+at+22.50.55.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="269" src="http://4.bp.blogspot.com/-ETZ98j-3sEs/Ty751y5GeMI/AAAAAAAAGRw/wfFgptdxYgU/s640/Screen+Shot+2012-02-05+at+22.50.55.png" width="640" /></a></div>In EBS there are different ways (UPDATE, CORRECTION, UPDATE_OVERRIDE, UPDATE_CHANGE_INSERT), to update the record, as I wanted to test them out, I added the Update Mode select list to the form. An UPDATE you can only do once per day, CORRECTION is what I used to update the same record multiple times.<br /><br />Note that we still didn't login into our APEX application as an EBS user, so EBS doesn't know who I'm. As EBS is keeping an audit of the records, I (the logged in APEX user) won't be seen in those audit records, instead it will be a general one (EBS sysadmin I suppose). In the next posts we will authenticate with EBS integrate tighter.<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="http://1.bp.blogspot.com/-Qp4cQ-c1poA/Ty78L044IOI/AAAAAAAAGR8/0kLlMd9T0gg/s1600/Screen+Shot+2012-02-05+at+23.00.44.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="230" src="http://1.bp.blogspot.com/-Qp4cQ-c1poA/Ty78L044IOI/AAAAAAAAGR8/0kLlMd9T0gg/s640/Screen+Shot+2012-02-05+at+23.00.44.png" width="640" /></a></div><br /><br /><br />In this post the purpose was to make an EBS API call to update an email address of a person. While playing with the EBS API I came across some challenges and I had to ask for advice to more experienced EBS people. Which will also be shown in the next post; where I will create a person with the API...<br /><br /><span class="Apple-style-span" style="color: #191919; font-family: Verdana, sans-serif; font-size: 12px;">Previous related posts:</span><br /><ul style="color: #191919; font-family: Verdana, sans-serif; font-size: 12px; line-height: 1.4em; list-style-type: none; padding-left: 32px;"><li style="background-attachment: initial; background-clip: initial; background-color: initial; background-image: url(http://dgielis.gg-design.be/blog/icon_list_item.gif); background-origin: initial; background-position: 0% 3px; background-repeat: no-repeat no-repeat; padding-bottom: 4px; padding-left: 17px; padding-right: 0px; padding-top: 0px;"><a href="http://dgielis.blogspot.com/2012/02/e-business-suite-and-apex-integration_03.html" >E-Business Suite and APEX integration using Views</a></li><li style="background-attachment: initial; background-clip: initial; background-color: initial; background-image: url(http://dgielis.gg-design.be/blog/icon_list_item.gif); background-origin: initial; background-position: 0% 3px; background-repeat: no-repeat no-repeat; padding-bottom: 4px; padding-left: 17px; padding-right: 0px; padding-top: 0px;"><a href="http://dgielis.blogspot.com/2012/02/e-business-suite-and-apex-integration.html" style="color: #666666;" >E-Business Suite and APEX integration (overview)</a></li><li style="background-attachment: initial; background-clip: initial; background-color: initial; background-image: url(http://dgielis.gg-design.be/blog/icon_list_item.gif); background-origin: initial; background-position: 0% 3px; background-repeat: no-repeat no-repeat; padding-bottom: 4px; padding-left: 17px; padding-right: 0px; padding-top: 0px;"><a href="http://dgielis.blogspot.com/2012/01/e-business-suite-and-apex-installation.html" style="color: #666666;" >E-Business Suite and APEX installation</a></li><li style="background-attachment: initial; background-clip: initial; background-color: initial; background-image: url(http://dgielis.gg-design.be/blog/icon_list_item.gif); background-origin: initial; background-position: 0% 3px; background-repeat: no-repeat no-repeat; padding-bottom: 4px; padding-left: 17px; padding-right: 0px; padding-top: 0px;"><a href="http://dgielis.blogspot.com/2012/01/apex-and-e-business-suite-integration.html" style="color: #666666;" >APEX and E-Business Suite integration</a>&nbsp;(OBUG event)</li></ul><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21122514-1246901616587989013?l=dgielis.blogspot.com' alt='' /></div><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/DimitriGielisBlog?a=6ZkmYOj4T5A:t_SqJZOFsL0:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/DimitriGielisBlog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DimitriGielisBlog?a=6ZkmYOj4T5A:t_SqJZOFsL0:63t7Ie-LG7Y"><img src="http://feeds.feedburner.com/~ff/DimitriGielisBlog?d=63t7Ie-LG7Y" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DimitriGielisBlog?a=6ZkmYOj4T5A:t_SqJZOFsL0:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/DimitriGielisBlog?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DimitriGielisBlog?a=6ZkmYOj4T5A:t_SqJZOFsL0:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/DimitriGielisBlog?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DimitriGielisBlog?a=6ZkmYOj4T5A:t_SqJZOFsL0:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/DimitriGielisBlog?i=6ZkmYOj4T5A:t_SqJZOFsL0:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DimitriGielisBlog?a=6ZkmYOj4T5A:t_SqJZOFsL0:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/DimitriGielisBlog?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DimitriGielisBlog?a=6ZkmYOj4T5A:t_SqJZOFsL0:KwTdNBX3Jqk"><img src="http://feeds.feedburner.com/~ff/DimitriGielisBlog?i=6ZkmYOj4T5A:t_SqJZOFsL0:KwTdNBX3Jqk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DimitriGielisBlog?a=6ZkmYOj4T5A:t_SqJZOFsL0:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/DimitriGielisBlog?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DimitriGielisBlog?a=6ZkmYOj4T5A:t_SqJZOFsL0:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/DimitriGielisBlog?i=6ZkmYOj4T5A:t_SqJZOFsL0:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DimitriGielisBlog?a=6ZkmYOj4T5A:t_SqJZOFsL0:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/DimitriGielisBlog?d=TzevzKxY174" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://dgielis.blogspot.com/feeds/1246901616587989013/comments/default</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="" length="" type="" />
		</item>
		<item>
		<title>E-Business Suite and APEX integration using Views</title>
		<link>http://feedproxy.google.com/~r/DimitriGielisBlog/~3/i5aYl2SRKiY/e-business-suite-and-apex-integration_03.html</link>
		<comments>http://feedproxy.google.com/~r/DimitriGielisBlog/~3/i5aYl2SRKiY/e-business-suite-and-apex-integration_03.html#comments</comments>
		<pubDate>Fri, 03 Feb 2012 11:36:00 +0000</pubDate>
		<dc:creator>Dimitri Gielis</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.oracle-base.com/aggregator/?guid=ef85c088195ad688b1de4058b3a4da6f</guid>
		<description><![CDATA[Integrating APEX and EBS by using views is one of the easiest solutions (at first sight!).This is the first scenario, where I have an APEX application and I want to integrate with data sitting in EBS.Pre-requisites:APEX is installed in the same databas...]]></description>
			<content:encoded><![CDATA[<div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/-Ab62tZx6tDw/TyqO6Q5pl0I/AAAAAAAAGQE/l5aNBPs7TYY/s1600/Screen+Shot+2012-02-02+at+14.25.48.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="136" src="http://2.bp.blogspot.com/-Ab62tZx6tDw/TyqO6Q5pl0I/AAAAAAAAGQE/l5aNBPs7TYY/s320/Screen+Shot+2012-02-02+at+14.25.48.png" width="320" /></a></div>Integrating APEX and EBS by using views is one of the easiest solutions (at first sight!).<br /><br />This is the first scenario, where I have an APEX application and I want to integrate with data sitting in EBS.<br /><br />Pre-requisites:<br /><ul><li>APEX is installed in the same database as EBS (see <a href="http://dgielis.blogspot.com/2012/01/e-business-suite-and-apex-installation.html" >previous post</a>).&nbsp;</li><li>My APEX application (actually Workspace) is linked to my own (non-EBS) Oracle schema.</li></ul>If you want&nbsp;to view&nbsp;data coming from EBS&nbsp;in your APEX application, follow these steps:<br /><ol><li><b>Identify where the data is in EBS</b><br /><br />If you are not familiar with the data model of EBS, it can be hard to find the right information. A good starting point would be the&nbsp;APPS schema, because that has access to the complete Oracle E-Business Suite data model. You can compare it with the SYSTEM schema, which has access to the entire database.<br /><br />This pictures shows an overview of the APPS schema and base product schemas.<br /><br /><a href="http://1.bp.blogspot.com/-6bJFSFxd03k/TyqTiOUO9uI/AAAAAAAAGQQ/ZMf95w40l0Y/s1600/cg_ch3_schema.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-6bJFSFxd03k/TyqTiOUO9uI/AAAAAAAAGQQ/ZMf95w40l0Y/s1600/cg_ch3_schema.gif" /></a><br /><br />You can read more about the APPS schema in the <a href="http://docs.oracle.com/cd/E18727_01/doc.121/e12841/T120505T120510.htm" >EBS documentation</a>.<br /><br />In my example I wanted to find the people that are in my organisation (HR). I started to look for views that would give me that information. My first query was like this:<br /><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">select object_name<br />&nbsp; from user_objects <br />&nbsp;where object_name like '%PEOPLE%' <br />&nbsp; &nbsp;and object_type = 'VIEW'<br />order by 1&nbsp;</span><br /><br />That query returned 82 rows in my environment. In the results I saw e.g. ADS_PEOPLE_V, HRBG_PEOPLE, PER_ALL_PEOPLE, PER_PEOPLE, PER_PEOPLE_F etc.<br /><br />I started to look at the definitions of those, but if you are not familiar with EBS it's hard to know which one is the one you need. So my recommendation would definitely be; when you are not that familiar with EBS, talk with somebody who knows more about it. For me that is the case, I only started to look into EBS and actually do something with it, a few weeks ago.<br /><br />When I talked to somebody more experienced in EBS, he told me I probably wanted to look at PER_ALL_PEOPLE_F. Hmm, that wasn't in the result set of the above query. After investigating a bit more PER_ALL_PEOPLE_F is a synonym for HR.PER_ALL_PEOPLE_F.<br /><br />I wanted to understand the naming convention in EBS a bit better e.g. for the PER%PEOPLE% objects. <br /><br /><a href="http://4.bp.blogspot.com/-R1ZmkaAGnRA/Tyu7_j6Mn0I/AAAAAAAAGQc/93DO5a4k-ME/s1600/per_people.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="http://4.bp.blogspot.com/-R1ZmkaAGnRA/Tyu7_j6Mn0I/AAAAAAAAGQc/93DO5a4k-ME/s400/per_people.png" width="296" /></a><br /><br />Below I created a table how I interpret the EBS objects:<br /><br /><table border="0" cellpadding="2" cellspacing="2" style="text-align: left; width: 100%;"><tbody><tr><td style="font-weight: bold; vertical-align: top;">View /Synonym (^)</td><td style="font-weight: bold; text-align: right; vertical-align: top;">count(*)</td><td style="font-weight: bold; text-align: right; vertical-align: top;">count(distinct person_id)</td><td style="font-weight: bold; vertical-align: top;">Interpretation</td></tr><tr><td style="font-weight: bold; vertical-align: top;">per_all_people_f (^)</td><td style="text-align: right; vertical-align: top;">32295</td><td style="text-align: right; vertical-align: top;">18518</td><td style="vertical-align: top;">Synonym to real HR table</td></tr><tr><td style="font-weight: bold; vertical-align: top;">per_all_people</td><td style="text-align: right; vertical-align: top;">0</td><td style="text-align: right; vertical-align: top;">0</td><td style="vertical-align: top;">Needs EBS session (record inFND_SESSIONS) so it knows what you can see</td></tr><tr><td style="font-weight: bold; vertical-align: top;">per_all_people_d</td><td style="text-align: right; vertical-align: top;">32295</td><td style="text-align: right; vertical-align: top;">18518</td><td style="vertical-align: top;">All records but showstranslated text if user settings are applied</td></tr><tr><td style="font-weight: bold; vertical-align: top;">per_people</td><td style="text-align: right; vertical-align: top;">0</td><td style="text-align: right; vertical-align: top;">0</td><td style="vertical-align: top;">Needs EBS session, showseffective records based on user's date</td></tr><tr><td style="font-weight: bold; vertical-align: top;">per_people_f</td><td style="text-align: right; vertical-align: top;">32295</td><td style="text-align: right; vertical-align: top;">18518</td><td style="vertical-align: top;">EBS security implemented, youonly see records you are allowed to see </td></tr><tr><td style="font-weight: bold; vertical-align: top;">per_people_v</td><td style="text-align: right; vertical-align: top;">0</td><td style="text-align: right; vertical-align: top;">0</td><td style="vertical-align: top;">Needs EBS Session, includes alot of display text and is language dependend</td></tr><tr><td style="font-weight: bold; vertical-align: top;">per_people_x</td><td style="text-align: right; vertical-align: top;">18518</td><td style="text-align: right; vertical-align: top;">18518</td><td style="vertical-align: top;">EBS security implemented (sameas per_people_f), but limits to only the effective records <br />(WHERE TRUNC(SYSDATE) BETWEEN EFFECTIVE_START_DATE ANDEFFECTIVE_END_DATE)</td></tr></tbody></table><br />So to me PER_PEOPLE_X looks like a good candidate to use in my APEX application. If I'm not logged into the app as an E-Business user I still see all records that are effective at the time I run the query.<br /><br /></li><li>Create a view on top of the EBS views and use some naming conventions so it's easy to recognise which objects you created and are not native EBS ones.<br /><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">create view apex_per_people_vw as select * from per_people_x<br /><br /></span></li><li>Grant access on that view to the schema that is linked to your APEX workspace and application<br /><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">grant select on apex_per_people_vw to apex_ebs<br /><br /></span></li><li>Create a view in your own schema that selects everything from the view in the apps schema.<br />We do that so that the views are a one-on-one mapping between schema's, but they show up in the APEX wizards.<br /><br /><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">create view apex_per_people_vw as select * from apps.apex_per_people_vw<br /><br /></span></li><li>Create an Interactive Report on top of the view<br /><br /><span class="Apple-style-span" style="color: #0000ee;"><img border="0" height="339" src="http://3.bp.blogspot.com/-5KlCUSe3KHU/TyvFHoLZ-1I/AAAAAAAAGQo/CwWmGdJmpzY/s640/report.png" width="640" /></span></li></ol><div>This first examples shows how you can view data from EBS in your own APEX application. We can now create a calendar, charts etc. in APEX based on the data coming from EBS. In the next post I will show how you can edit this data.</div><div><br /></div><div><span class="Apple-style-span" style="color: #191919; font-family: Verdana, sans-serif; font-size: 12px;">Previous related posts:</span><span class="Apple-style-span" style="color: #191919; font-family: Verdana, sans-serif; font-size: 12px;"><br /></span><br /><ul style="color: #191919; font-family: Verdana, sans-serif; font-size: 12px; line-height: 1.4em; list-style-type: none; padding-left: 32px;"><li style="background-attachment: initial; background-clip: initial; background-color: initial; background-image: url(http://dgielis.gg-design.be/blog/icon_list_item.gif); background-origin: initial; background-position: 0% 3px; background-repeat: no-repeat no-repeat; padding-bottom: 4px; padding-left: 17px; padding-right: 0px; padding-top: 0px;"><a href="http://dgielis.blogspot.com/2012/02/e-business-suite-and-apex-integration.html" >E-Business Suite and APEX integration (overview)</a></li><li style="background-attachment: initial; background-clip: initial; background-color: initial; background-image: url(http://dgielis.gg-design.be/blog/icon_list_item.gif); background-origin: initial; background-position: 0% 3px; background-repeat: no-repeat no-repeat; padding-bottom: 4px; padding-left: 17px; padding-right: 0px; padding-top: 0px;"><a href="http://dgielis.blogspot.com/2012/01/e-business-suite-and-apex-installation.html" style="color: #666666;" >E-Business Suite and APEX installation</a></li><li style="background-attachment: initial; background-clip: initial; background-color: initial; background-image: url(http://dgielis.gg-design.be/blog/icon_list_item.gif); background-origin: initial; background-position: 0% 3px; background-repeat: no-repeat no-repeat; padding-bottom: 4px; padding-left: 17px; padding-right: 0px; padding-top: 0px;"><a href="http://dgielis.blogspot.com/2012/01/apex-and-e-business-suite-integration.html" style="color: #666666;" >APEX and E-Business Suite integration</a>&nbsp;(OBUG event)</li></ul></div><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21122514-8372726233805719994?l=dgielis.blogspot.com' alt='' /></div><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/DimitriGielisBlog?a=i5aYl2SRKiY:FSB2bBSY4U4:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/DimitriGielisBlog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DimitriGielisBlog?a=i5aYl2SRKiY:FSB2bBSY4U4:63t7Ie-LG7Y"><img src="http://feeds.feedburner.com/~ff/DimitriGielisBlog?d=63t7Ie-LG7Y" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DimitriGielisBlog?a=i5aYl2SRKiY:FSB2bBSY4U4:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/DimitriGielisBlog?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DimitriGielisBlog?a=i5aYl2SRKiY:FSB2bBSY4U4:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/DimitriGielisBlog?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DimitriGielisBlog?a=i5aYl2SRKiY:FSB2bBSY4U4:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/DimitriGielisBlog?i=i5aYl2SRKiY:FSB2bBSY4U4:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DimitriGielisBlog?a=i5aYl2SRKiY:FSB2bBSY4U4:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/DimitriGielisBlog?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DimitriGielisBlog?a=i5aYl2SRKiY:FSB2bBSY4U4:KwTdNBX3Jqk"><img src="http://feeds.feedburner.com/~ff/DimitriGielisBlog?i=i5aYl2SRKiY:FSB2bBSY4U4:KwTdNBX3Jqk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DimitriGielisBlog?a=i5aYl2SRKiY:FSB2bBSY4U4:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/DimitriGielisBlog?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DimitriGielisBlog?a=i5aYl2SRKiY:FSB2bBSY4U4:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/DimitriGielisBlog?i=i5aYl2SRKiY:FSB2bBSY4U4:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DimitriGielisBlog?a=i5aYl2SRKiY:FSB2bBSY4U4:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/DimitriGielisBlog?d=TzevzKxY174" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://dgielis.blogspot.com/feeds/8372726233805719994/comments/default</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="" length="" type="" />
		</item>
		<item>
		<title>E-Business Suite and APEX integration (overview)</title>
		<link>http://feedproxy.google.com/~r/DimitriGielisBlog/~3/X3Ekwkx0UMA/e-business-suite-and-apex-integration.html</link>
		<comments>http://feedproxy.google.com/~r/DimitriGielisBlog/~3/X3Ekwkx0UMA/e-business-suite-and-apex-integration.html#comments</comments>
		<pubDate>Thu, 02 Feb 2012 11:41:00 +0000</pubDate>
		<dc:creator>Dimitri Gielis</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.oracle-base.com/aggregator/?guid=43c2305019c4bf4141ea0d3f560b56cb</guid>
		<description><![CDATA[For me there are two main use cases to integrate Oracle E-Business Suite (EBS) with Oracle Application Express (APEX):In my APEX application I want to include/integrate data that exist in EBSe.g. I want to include my employees that are in EBS HRThe EBS...]]></description>
			<content:encoded><![CDATA[<div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/-iCC_UddOCto/Typ2IOP1OgI/AAAAAAAAGP4/EGMvje75pnc/s1600/oracle_apex_ebs_int.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="128" src="http://3.bp.blogspot.com/-iCC_UddOCto/Typ2IOP1OgI/AAAAAAAAGP4/EGMvje75pnc/s320/oracle_apex_ebs_int.png" width="320" /></a></div>For me there are two main use cases to integrate Oracle E-Business Suite (EBS) with Oracle Application Express (APEX):<br /><br /><ol><li><b>In my APEX application I want to include/integrate data that exist in EBS</b><br />e.g. I want to include my employees that are in EBS HR</li><br /><li><b>The EBS application needs to be customised and I use APEX to do that</b><br />e.g. I want to show a calendar with the birthdays of my employees <br />or I want a chart about the different age categories in my company<br />or I want to bulk update some information and there is no screen to do that</li></ol><br />In both cases you want things to go seamlessly, you shouldn't be aware that you go from one technology to another. APEX and EBS data are in the Oracle database, so accessing data is not a big issue. Updating data in EBS you need to be careful with, as directly updating data through tables is not allowed (supported).<br /><br />When I was reviewing ways to retrieve data from EBS and create/update/delete data in EBS from APEX I found a couple of methods that are interesting to explore further:<br /><br /><table><tbody><tr><td></td><td align="center" width="100"><b>Retrieve data from EBS</b></td><td align="center" width="100"><b>Update data in EBS</b></td></tr><tr><td><b>1. Views</b></td><td align="center">X</td><td align="center"></td></tr><tr><td><b>2. APIs</b></td><td align="center">X</td><td align="center">X</td></tr><tr><td><b>3. OITs (Open Interface Tables)</b></td><td align="center"><br /></td><td align="center">X</td></tr><tr><td><b>4. Webservices (incl. BPEL/SOA)</b></td><td align="center">X</td><td align="center">X</td></tr></tbody></table><br />There are other ways to integrate or interface with EBS e.g. through EDI (Electronic Data Interchange) and EAI (Enterprise Application Integration), but from an APEX perspective the above four seemed to me the most interesting ones to explore further. In my next posts I will dig into integrating APEX and EBS with the above techniques.<br /><br />References to interesting readings:<br /><ul><li><a href="http://irep.oracle.com/index.html" >Oracle Integration Repository</a></li><li><a href="http://docs.oracle.com/cd/B53825_08/current/html/docset.html" >Oracle Release 12.1 Documentation Library</a> (see Integration)</li><li><a href="http://www.oracleappshub.com/" >Oracle Apps Epicenter Blog</a></li></ul><br />Previous related posts:<br /><ul style="color: #191919; font-family: Verdana, sans-serif; font-size: 12px; line-height: 1.4em; list-style-type: none; padding-left: 32px;"><li style="background-attachment: initial; background-clip: initial; background-color: initial; background-image: url(http://dgielis.gg-design.be/blog/icon_list_item.gif); background-origin: initial; background-position: 0% 3px; background-repeat: no-repeat no-repeat; padding-bottom: 4px; padding-left: 17px; padding-right: 0px; padding-top: 0px;"><a href="http://dgielis.blogspot.com/2012/01/e-business-suite-and-apex-installation.html" style="color: #666666;" >E-Business Suite and APEX installation</a></li><li style="background-attachment: initial; background-clip: initial; background-color: initial; background-image: url(http://dgielis.gg-design.be/blog/icon_list_item.gif); background-origin: initial; background-position: 0% 3px; background-repeat: no-repeat no-repeat; padding-bottom: 4px; padding-left: 17px; padding-right: 0px; padding-top: 0px;"><a href="http://dgielis.blogspot.com/2012/01/apex-and-e-business-suite-integration.html" style="color: #666666;" >APEX and E-Business Suite integration</a>&nbsp;(OBUG event)</li></ul><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21122514-8008676646900944804?l=dgielis.blogspot.com' alt='' /></div><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/DimitriGielisBlog?a=X3Ekwkx0UMA:ZNW7v2rju-o:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/DimitriGielisBlog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DimitriGielisBlog?a=X3Ekwkx0UMA:ZNW7v2rju-o:63t7Ie-LG7Y"><img src="http://feeds.feedburner.com/~ff/DimitriGielisBlog?d=63t7Ie-LG7Y" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DimitriGielisBlog?a=X3Ekwkx0UMA:ZNW7v2rju-o:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/DimitriGielisBlog?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DimitriGielisBlog?a=X3Ekwkx0UMA:ZNW7v2rju-o:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/DimitriGielisBlog?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DimitriGielisBlog?a=X3Ekwkx0UMA:ZNW7v2rju-o:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/DimitriGielisBlog?i=X3Ekwkx0UMA:ZNW7v2rju-o:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DimitriGielisBlog?a=X3Ekwkx0UMA:ZNW7v2rju-o:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/DimitriGielisBlog?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DimitriGielisBlog?a=X3Ekwkx0UMA:ZNW7v2rju-o:KwTdNBX3Jqk"><img src="http://feeds.feedburner.com/~ff/DimitriGielisBlog?i=X3Ekwkx0UMA:ZNW7v2rju-o:KwTdNBX3Jqk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DimitriGielisBlog?a=X3Ekwkx0UMA:ZNW7v2rju-o:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/DimitriGielisBlog?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DimitriGielisBlog?a=X3Ekwkx0UMA:ZNW7v2rju-o:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/DimitriGielisBlog?i=X3Ekwkx0UMA:ZNW7v2rju-o:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DimitriGielisBlog?a=X3Ekwkx0UMA:ZNW7v2rju-o:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/DimitriGielisBlog?d=TzevzKxY174" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://dgielis.blogspot.com/feeds/8008676646900944804/comments/default</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="" length="" type="" />
		</item>
		<item>
		<title>E-Business Suite and APEX installation</title>
		<link>http://feedproxy.google.com/~r/DimitriGielisBlog/~3/N-ILrr4cmFk/e-business-suite-and-apex-installation.html</link>
		<comments>http://feedproxy.google.com/~r/DimitriGielisBlog/~3/N-ILrr4cmFk/e-business-suite-and-apex-installation.html#comments</comments>
		<pubDate>Wed, 25 Jan 2012 15:05:00 +0000</pubDate>
		<dc:creator>Dimitri Gielis</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.oracle-base.com/aggregator/?guid=9de156b550a68d9292e7525de52a3557</guid>
		<description><![CDATA[Before doing the integration of Oracle Application Express (APEX) with E-Business Suite (EBs) you need to have both environments installed. The Oracle white paper talks about the installation of APEX, but not about installing E-Business Suite.The white...]]></description>
			<content:encoded><![CDATA[<div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/-omNeYiKSZro/TyAT1klnnSI/AAAAAAAAGPY/IqMNG7lt7Ss/s1600/OracleEBS.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="http://2.bp.blogspot.com/-omNeYiKSZro/TyAT1klnnSI/AAAAAAAAGPY/IqMNG7lt7Ss/s1600/OracleEBS.jpg" /></a></div>Before doing the integration of Oracle Application Express (APEX) with E-Business Suite (EBs) you need to have both environments installed. The <a href="http://www.oracle.com/technetwork/developer-tools/apex/learnmore/apex-ebs-extension-white-paper-345780.pdf" >Oracle white paper</a> talks about the installation of APEX, but not about installing E-Business Suite.<br /><br /><br />The white paper states; the prerequisites for the solution given are:<br /><br /><ul><li>Oracle E-Business Suite 12.1.3 or above</li><li>Oracle E-Business Suite Patch 12316083</li><li>Oracle Database 10.2.0.3 or above</li><li>Oracle Application Express 3.2 or above</li></ul><br />The first thing I needed was an E-Busisness Suite environment. Oracle provides some <a href="http://www.oracle.com/technetwork/server-storage/vm/ebs-093153.html" >VM Templates for E-Business Suite 12.1.3</a>. I wanted a complete demo system, like for example the HR schema in the Oracle database or the Sample Application in APEX. The VM Template for E-Business Suite includes the Vision demo. <br /><br />I never installed EBs before, so I did some research how to do that. Finally I didn't proceed with installing E-Business Suite on our servers, as <a href="http://mcx.nl/" >MCX</a> was happy to provide us with a complete Oracle E-Business Suite&nbsp;12.1.3 Vision installation on their servers. The version of the underlying Oracle database is&nbsp;11.2.0.2.0.&nbsp;I also asked them to apply&nbsp;<a href="https://updates.oracle.com/Orion/PatchSearch/process_form?bug=12316083" >patch&nbsp;12316083</a>.<br /><br />APEX needs to be installed on the same Oracle database as the Oracle E- Business suite database server.<br />We went with installing the latest version of APEX at the moment:&nbsp;<a href="http://www.oracle.com/technetwork/developer-tools/apex/downloads/index.html" >APEX 4.1</a>.<br /><br />Installing APEX is not that hard, basically running some scripts. The only bit you have to be careful with is the choice of web listener. APEX supports three web listeners: mod_plsql, EPG and the APEX Listener.<br />The mod_plsql gateway is disabled by default by EBs R12, so you shouldn't go with that. The EPG is not recommended either as it will add additional load on the database server, so the best choice would be the APEX Listener. The APEX Listener is the recommended choice in any circumstance anyway, regardless of EBs. (on a related note; I'm giving a presentation about my experiences moving to the APEX Listener at <a href="http://www.ogh.nl/page.aspx?event=154" >OGh</a> and <a href="http://kscope12.com/" >ODTUG</a>.)<br /><br />So after installing APEX and using the APEX Listener on an EBs configuration, the architecture looks like this:<br /><div class="separator" style="clear: both; text-align: center;"><a href="http://1.bp.blogspot.com/-NvmjJ8jv6p8/TyAZHuoBTOI/AAAAAAAAGPk/NiFdQ2NmoeQ/s1600/Screen+Shot+2012-01-25+at+16.00.29.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="291" src="http://1.bp.blogspot.com/-NvmjJ8jv6p8/TyAZHuoBTOI/AAAAAAAAGPk/NiFdQ2NmoeQ/s640/Screen+Shot+2012-01-25+at+16.00.29.png" width="640" /></a></div><br /><br />So now all the prerequisites are met and we can concentrate on the real integration part in the next post.<br /><br />Previous related posts:<br /><br /><ul><li><a href="http://dgielis.blogspot.com/2012/01/apex-and-e-business-suite-integration.html" >APEX and E-Business Suite integration</a></li></ul><br /><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21122514-1577337019690907480?l=dgielis.blogspot.com' alt='' /></div><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/DimitriGielisBlog?a=N-ILrr4cmFk:bMzWWc8WAHQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/DimitriGielisBlog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DimitriGielisBlog?a=N-ILrr4cmFk:bMzWWc8WAHQ:63t7Ie-LG7Y"><img src="http://feeds.feedburner.com/~ff/DimitriGielisBlog?d=63t7Ie-LG7Y" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DimitriGielisBlog?a=N-ILrr4cmFk:bMzWWc8WAHQ:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/DimitriGielisBlog?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DimitriGielisBlog?a=N-ILrr4cmFk:bMzWWc8WAHQ:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/DimitriGielisBlog?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DimitriGielisBlog?a=N-ILrr4cmFk:bMzWWc8WAHQ:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/DimitriGielisBlog?i=N-ILrr4cmFk:bMzWWc8WAHQ:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DimitriGielisBlog?a=N-ILrr4cmFk:bMzWWc8WAHQ:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/DimitriGielisBlog?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DimitriGielisBlog?a=N-ILrr4cmFk:bMzWWc8WAHQ:KwTdNBX3Jqk"><img src="http://feeds.feedburner.com/~ff/DimitriGielisBlog?i=N-ILrr4cmFk:bMzWWc8WAHQ:KwTdNBX3Jqk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DimitriGielisBlog?a=N-ILrr4cmFk:bMzWWc8WAHQ:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/DimitriGielisBlog?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DimitriGielisBlog?a=N-ILrr4cmFk:bMzWWc8WAHQ:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/DimitriGielisBlog?i=N-ILrr4cmFk:bMzWWc8WAHQ:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DimitriGielisBlog?a=N-ILrr4cmFk:bMzWWc8WAHQ:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/DimitriGielisBlog?d=TzevzKxY174" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://dgielis.blogspot.com/feeds/1577337019690907480/comments/default</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="" length="" type="" />
		</item>
		<item>
		<title>APEX and E-Business Suite integration</title>
		<link>http://feedproxy.google.com/~r/DimitriGielisBlog/~3/pK_OzsYK2qM/apex-and-e-business-suite-integration.html</link>
		<comments>http://feedproxy.google.com/~r/DimitriGielisBlog/~3/pK_OzsYK2qM/apex-and-e-business-suite-integration.html#comments</comments>
		<pubDate>Wed, 18 Jan 2012 10:39:00 +0000</pubDate>
		<dc:creator>Dimitri Gielis</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.oracle-base.com/aggregator/?guid=73e75528f253631c9540c42bdd9120dc</guid>
		<description><![CDATA[For a couple of years now companies like for example Popay integrate APEX with E-Business Suite.The learning curve of APEX is not that high, so people with a&#160;(technical)&#160;E-Business Suite background should be up and running in no time.In April...]]></description>
			<content:encoded><![CDATA[For a couple of years now companies like for example <a href="http://popay.be/" >Popay</a> integrate APEX with E-Business Suite.<br /><br />The learning curve of APEX is not that high, so people with a&nbsp;(technical)&nbsp;E-Business Suite background should be up and running in no time.<br /><br />In April 2011, Oracle released a <a href="http://www.oracle.com/technetwork/developer-tools/apex/learnmore/apex-ebs-extension-white-paper-345780.pdf" >whitepaper</a> how to Extending Oracle E-Business Suite Release 12 using Oracle Application Express. Before, although it worked, you were a bit on your own incase you had issues, with the whitepaper things changed, so now you can call Oracle support as well.<br /><br />In the next days I will share my experiences trying to get up-to-speed with integrating APEX with Oracle E-Business Suite. My background with Oracle E-Business Suite is limited, but I know a lot about APEX and that whitepaper should get me a big step further in integrating with E-Business Suite.<br /><br /><br />On the 15th of February, the APEX and E-Business Suite SIGs of&nbsp;OBUG (Oracle Benelux User Group) hold a half day (FREE) seminar about this integration too. So if you want to see this integration live or you want to hear from companies who are successful in it, <a href="http://obug.nl/index.php?option=com_jevents&amp;task=icalrepeat.detail&amp;evid=47&amp;Itemid=168&amp;year=2012&amp;month=02&amp;day=15&amp;title=combisig-apex-ebs-hcm-ebs-logistics-ebs-technology&amp;uid=7d6a7c5f410621017bce29b206b462b7&amp;catids=66%7C65&amp;lang=nloor" >come and join us</a>. You find the agenda below:<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/-vXSclN4Ydb8/TxagwQZ2_xI/AAAAAAAAGPE/cEf4eTqhiiE/s1600/Screen+Shot+2012-01-18+at+11.36.29.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="http://2.bp.blogspot.com/-vXSclN4Ydb8/TxagwQZ2_xI/AAAAAAAAGPE/cEf4eTqhiiE/s640/Screen+Shot+2012-01-18+at+11.36.29.png" width="542" /></a></div><br /><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21122514-3796253858733457807?l=dgielis.blogspot.com' alt='' /></div><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/DimitriGielisBlog?a=pK_OzsYK2qM:Eh9dNrv9gV0:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/DimitriGielisBlog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DimitriGielisBlog?a=pK_OzsYK2qM:Eh9dNrv9gV0:63t7Ie-LG7Y"><img src="http://feeds.feedburner.com/~ff/DimitriGielisBlog?d=63t7Ie-LG7Y" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DimitriGielisBlog?a=pK_OzsYK2qM:Eh9dNrv9gV0:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/DimitriGielisBlog?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DimitriGielisBlog?a=pK_OzsYK2qM:Eh9dNrv9gV0:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/DimitriGielisBlog?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DimitriGielisBlog?a=pK_OzsYK2qM:Eh9dNrv9gV0:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/DimitriGielisBlog?i=pK_OzsYK2qM:Eh9dNrv9gV0:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DimitriGielisBlog?a=pK_OzsYK2qM:Eh9dNrv9gV0:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/DimitriGielisBlog?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DimitriGielisBlog?a=pK_OzsYK2qM:Eh9dNrv9gV0:KwTdNBX3Jqk"><img src="http://feeds.feedburner.com/~ff/DimitriGielisBlog?i=pK_OzsYK2qM:Eh9dNrv9gV0:KwTdNBX3Jqk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DimitriGielisBlog?a=pK_OzsYK2qM:Eh9dNrv9gV0:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/DimitriGielisBlog?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DimitriGielisBlog?a=pK_OzsYK2qM:Eh9dNrv9gV0:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/DimitriGielisBlog?i=pK_OzsYK2qM:Eh9dNrv9gV0:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DimitriGielisBlog?a=pK_OzsYK2qM:Eh9dNrv9gV0:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/DimitriGielisBlog?d=TzevzKxY174" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://dgielis.blogspot.com/feeds/3796253858733457807/comments/default</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="" length="" type="" />
		</item>
		<item>
		<title>SQL: Start day and End day of week</title>
		<link>http://www.oracle-base.com/aggregator/2010/09/08/sql-start-day-and-end-day-of-week/</link>
		<comments>http://www.oracle-base.com/aggregator/2010/09/08/sql-start-day-and-end-day-of-week/#comments</comments>
		<pubDate>Wed, 08 Sep 2010 19:49:00 +0000</pubDate>
		<dc:creator>Dimitri Gielis</dc:creator>
		
		<guid isPermaLink="false"></guid>
		<description><![CDATA[I just got an interesting question: how do you know for a date, in which week (Monday - Sunday) it falls.I created a little test script to get 31 days of data:(date_c is the same as date_d, but in a more readable output. c stands for char, d for date)s...]]></description>
			<content:encoded><![CDATA[<p><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_tffIKLFlRlY/TIfuVNdNdVI/AAAAAAAAF0U/DUrzCwd5kls/s1600/calendar.jpg"><img style="float: right; margin: 0pt 0pt 10px 10px; cursor: pointer; width: 200px; height: 150px;" src="http://3.bp.blogspot.com/_tffIKLFlRlY/TIfuVNdNdVI/AAAAAAAAF0U/DUrzCwd5kls/s200/calendar.jpg" alt="" id="BLOGGER_PHOTO_ID_5514638316895302994" border="0" /></a>I just got an interesting question: how do you know for a date, in which week (Monday &#8211; Sunday) it falls.</p>
<p>I created a little test script to get 31 days of data:<br />(date_c is the same as date_d, but in a more readable output. c stands for char, d for date)
<pre><code>select to_char(sysdate + level, 'Day DD-MON-YYYY HH24:MI') as date_c,   (sysdate + level) as date_dfrom dualconnect by level <= 31 </code></pre>
<p>Next I used the NEXT_DAY function to get the first Monday after that date, and the same for the Sunday. As it will give you the results of the next week I had to subtract 7 days so I was sure it would fall under the week the date was in.<br />e.g. if you have a date Wednesday 8 of September, that person wanted to have Monday 6th-Sunday 12th. If I just did NEXT_DAY of 8-SEP I would get 13-SEP, that is why I first had to subtract 7 to go to a previous week and get the next Monday.<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_tffIKLFlRlY/TIfqrKJPY7I/AAAAAAAAF0E/PnqJzEdQVoc/s1600/Screen+shot+2010-09-08+at+21.55.52.png"> </a><br />For the end date it's similar, but there you only have to subtract 1 day, as only the Sunday might be a problem, as the next Sunday is the next week.</p>
<p>So the final query became:
<pre><code>with t1 as (select to_char(sysdate + level, 'Day DD-MON-YYYY HH24:MI') as date_c,    (sysdate + level) as date_dfrom dualconnect by level <= 31 ) select date_c,        next_day(trunc(date_d)-7,'Monday') as start_day_of_week,        next_day(trunc(date_d)-1,'Sunday') as end_day_of_week  from t1 </code></pre>
<p>A more readable screenshot:</p>
<p><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_tffIKLFlRlY/TIftxv0_BCI/AAAAAAAAF0M/lshpVE7uhfM/s1600/Screen+shot+2010-09-08+at+22.00.46.png"><img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 259px; height: 400px;" src="http://3.bp.blogspot.com/_tffIKLFlRlY/TIftxv0_BCI/AAAAAAAAF0M/lshpVE7uhfM/s400/Screen+shot+2010-09-08+at+22.00.46.png" alt="" id="BLOGGER_PHOTO_ID_5514637707646534690" border="0" /></a><br />Update (after comments of Kees and Alex): the following solution looks even more elegant and is NLS independent:
<pre><code>with t1 as (select to_char(sysdate + level, 'Day DD-MON-YYYY HH24:MI') as date_c,    (sysdate + level) as date_dfrom dualconnect by level <= 31 ) select date_c,        trunc(date_d,'iw') as start_day_of_week,        trunc(date_d+7,'iw')-1 as end_day_of_week  from t1 </code></pre>
<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/21122514-2405249051664808979?l=dgielis.blogspot.com' alt='' /></div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/DimitriGielisBlog?a=njlKP6ANW6I:h7oivKblaBU:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/DimitriGielisBlog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DimitriGielisBlog?a=njlKP6ANW6I:h7oivKblaBU:63t7Ie-LG7Y"><img src="http://feeds.feedburner.com/~ff/DimitriGielisBlog?d=63t7Ie-LG7Y" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DimitriGielisBlog?a=njlKP6ANW6I:h7oivKblaBU:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/DimitriGielisBlog?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DimitriGielisBlog?a=njlKP6ANW6I:h7oivKblaBU:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/DimitriGielisBlog?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DimitriGielisBlog?a=njlKP6ANW6I:h7oivKblaBU:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/DimitriGielisBlog?i=njlKP6ANW6I:h7oivKblaBU:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DimitriGielisBlog?a=njlKP6ANW6I:h7oivKblaBU:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/DimitriGielisBlog?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DimitriGielisBlog?a=njlKP6ANW6I:h7oivKblaBU:KwTdNBX3Jqk"><img src="http://feeds.feedburner.com/~ff/DimitriGielisBlog?i=njlKP6ANW6I:h7oivKblaBU:KwTdNBX3Jqk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DimitriGielisBlog?a=njlKP6ANW6I:h7oivKblaBU:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/DimitriGielisBlog?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DimitriGielisBlog?a=njlKP6ANW6I:h7oivKblaBU:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/DimitriGielisBlog?i=njlKP6ANW6I:h7oivKblaBU:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/DimitriGielisBlog?a=njlKP6ANW6I:h7oivKblaBU:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/DimitriGielisBlog?d=TzevzKxY174" border="0"></img></a>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.oracle-base.com/aggregator/2010/09/08/sql-start-day-and-end-day-of-week/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

