<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Aykut Ömer Öztürk's Blog</title>
	<atom:link href="http://aozturk.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://aozturk.wordpress.com</link>
	<description>All about J2EE , Oracle and Siebel technologies</description>
	<lastBuildDate>Wed, 17 Mar 2010 07:09:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='aozturk.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Aykut Ömer Öztürk's Blog</title>
		<link>http://aozturk.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://aozturk.wordpress.com/osd.xml" title="Aykut Ömer Öztürk&#039;s Blog" />
	<atom:link rel='hub' href='http://aozturk.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Creating a PL/SQL procedure that invokes the WebService</title>
		<link>http://aozturk.wordpress.com/2010/03/17/creating-a-plsql-procedure-that-invokes-the-webservice/</link>
		<comments>http://aozturk.wordpress.com/2010/03/17/creating-a-plsql-procedure-that-invokes-the-webservice/#comments</comments>
		<pubDate>Wed, 17 Mar 2010 07:09:10 +0000</pubDate>
		<dc:creator>aykutomer</dc:creator>
				<category><![CDATA[Oracle PL/SQL]]></category>
		<category><![CDATA[Calling web services]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[plsql function/procedures]]></category>

		<guid isPermaLink="false">http://aozturk.wordpress.com/2010/03/17/creating-a-plsql-procedure-that-invokes-the-webservice/</guid>
		<description><![CDATA[The approach for Oracle 9iR2 and 10g – based on the supplied UTL_HTTP package . This article demonstrates a rather generic approach – which I think must be very close to using the UTL_DBWS package. We will take a more pragmatic, to the point line of action – that amounts to the same thing. Another [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aozturk.wordpress.com&amp;blog=6688012&amp;post=58&amp;subd=aozturk&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The approach for Oracle 9iR2 and 10g – based on the supplied UTL_HTTP package .<br />
This article demonstrates a rather generic approach – which I think must be very close to using the UTL_DBWS package. We will take a more pragmatic, to the point line of action – that amounts to the same thing. Another resource that came in handy: Oracle Database 10g – XML &amp; SQL: Design, Build &amp; Manage XML Applications in Java,C, C++ &amp; PL/SQL, Mark Scardina, Ben Chang and Jinyu Wang, Oracle Press – McGrawHill Osborne; 2004; ISBN 0-07-222952-7.</p>
<p>We know what the SOAP messages look like. Now we will create a PL/SQL block that recreates the SOAP message and then invokes the proper UTL_HTTP command:<br />
<code><br />
declare<br />
  soap_request varchar2(30000);<br />
  soap_respond varchar2(30000);<br />
  http_req utl_http.req;<br />
  http_resp utl_http.resp;<br />
  resp XMLType;<br />
  i integer;</p>
<p>begin<br />
  soap_request:= '</p>
<p>         us<br />
         uk</p>
<p>';<br />
 http_req:= utl_http.begin_request<br />
            ( 'http://services.xmethods.net:80/soap'<br />
            , 'POST'<br />
            , 'HTTP/1.1'<br />
            );<br />
  utl_http.set_header(http_req, 'Content-Type', 'text/xml'); -- since we are dealing with plain text in XML documents<br />
  utl_http.set_header(http_req, 'Content-Length', length(soap_request));<br />
  utl_http.set_header(http_req, 'SOAPAction', ''); -- required to specify this is a SOAP communication<br />
  utl_http.write_text(http_req, soap_request);<br />
  http_resp:= utl_http.get_response(http_req);<br />
  utl_http.read_text(http_resp, soap_respond);<br />
  utl_http.end_response(http_resp);<br />
  resp:= XMLType.createXML(soap_respond);<br />
  resp:= resp.extract('/soap:Envelop/soap:Body/child::node()'<br />
                   , 'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"'<br />
                   );<br />
  i:=0;<br />
  loop<br />
    dbms_output.put_line(substr(soap_respond,1+ i*255,250));<br />
    i:= i+1;<br />
    if i*250&gt; length(soap_respond)<br />
    then<br />
      exit;<br />
    end if;<br />
  end loop;<br />
end;<br />
The output from runnning this piece of PL/SQL in SQL*Plus is this</p>
<p>0.5342<br />
Turning this PL/SQL block into a proper PL/SQL Function that accepts the two countries as input-parameters is straightforward:</p>
<p>function get_conversion_rate<br />
( p_country1 in varchar2 default 'us'<br />
, p_country2 in varchar2 default 'us'<br />
)<br />
return varchar2<br />
as<br />
  soap_request varchar2(30000);<br />
  soap_respond varchar2(30000);<br />
  http_req utl_http.req;<br />
  http_resp utl_http.resp;<br />
  resp XMLType;<br />
begin<br />
  soap_request:= '</p>
<p>         '||p_country1||'<br />
         '||p_country2||'</p>
<p>';<br />
  http_req:= utl_http.begin_request<br />
             ( 'http://services.xmethods.net:80/soap'<br />
             , 'POST'<br />
             , 'HTTP/1.1'<br />
             );<br />
  utl_http.set_header(http_req, 'Content-Type', 'text/xml');<br />
  utl_http.set_header(http_req, 'Content-Length', length(soap_request));<br />
  utl_http.set_header(http_req, 'SOAPAction', '');<br />
  utl_http.write_text(http_req, soap_request);<br />
  http_resp:= utl_http.get_response(http_req);<br />
  utl_http.read_text(http_resp, soap_respond);<br />
  utl_http.end_response(http_resp);<br />
  - - Create an XMLType variable containing the Response XML<br />
  resp:= XMLType.createXML(soap_respond);<br />
  - - extract from the XMLType Resp the child-nodes of the  element<br />
  resp:= resp.extract('/soap:Envelope/soap:Body/child::node()'<br />
                     , 'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"'<br />
                     );<br />
  - - extract from the XMLType Resp the text() nodes from the n:getRateResponse/Result element<br />
  resp:= resp.extract('n:getRateResponse/Result/text()','xmlns:n="urn:xmethods-CurrencyExchange"');<br />
  return resp.getClobVal();<br />
end;<br />
</code><br />
We can create this function in any schema that has access to the sys.UTL_HTTP package. Calling this Function can be done from PL/SQL or even SQL:<br />
<code><br />
 select get_conversion_rate('uk','us')<br />
 from   dual<br />
 /<br />
GET_CONVERSION_RATE('UK','US')<br />
---------------------------------<br />
1.8713<br />
</code></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/aozturk.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/aozturk.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/aozturk.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/aozturk.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/aozturk.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/aozturk.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/aozturk.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/aozturk.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/aozturk.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/aozturk.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/aozturk.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/aozturk.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/aozturk.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/aozturk.wordpress.com/58/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aozturk.wordpress.com&amp;blog=6688012&amp;post=58&amp;subd=aozturk&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://aozturk.wordpress.com/2010/03/17/creating-a-plsql-procedure-that-invokes-the-webservice/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fa62e289ed614d5e06d86f0fa7023261?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">aykutomer</media:title>
		</media:content>
	</item>
		<item>
		<title>How to import  an Oracle dump file</title>
		<link>http://aozturk.wordpress.com/2009/03/06/how-to-import-oracle-dump-file/</link>
		<comments>http://aozturk.wordpress.com/2009/03/06/how-to-import-oracle-dump-file/#comments</comments>
		<pubDate>Fri, 06 Mar 2009 08:12:54 +0000</pubDate>
		<dc:creator>aykutomer</dc:creator>
				<category><![CDATA[Export/Import Data]]></category>
		<category><![CDATA[Dump file]]></category>
		<category><![CDATA[import]]></category>
		<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://aozturk.wordpress.com/?p=28</guid>
		<description><![CDATA[First of all place your .dmp file in your admin\XE\dpdump\ folder. If you are running your server locally then location is C:\oraclexe\app\oracle\admin\XE\dpdump This location may be different depending on where you installed oracle. I prefer to put my dump files in the dpdump folder so that I don&#8217;t have to specify a directory when doing [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aozturk.wordpress.com&amp;blog=6688012&amp;post=28&amp;subd=aozturk&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>First of all  place your .dmp file in your admin\XE\dpdump\ folder. If you are  running your server locally then  location is</p>
<p>C:\oraclexe\app\oracle\admin\XE\dpdump</p>
<p>This location may be different depending on where you installed oracle. I prefer to put my dump files in the dpdump folder so that I don&#8217;t have to specify a directory when doing the import.</p>
<p>Next you should open up your command line utility and type the following command</p>
<p><code>C:\&gt;imp system/password   file=c:\database.dmp full=yes</code></p>
<p>The data pump import utility will begin running and outputting it&#8217;s progress to the screen. It will generate your tables, triggers, binds, and fill the data in. Basically it will make an exact replication of the database it was exported from. After this is complete check your errors. If there were none, you&#8217;re good to go!</p>
<p><a href="http://wiki.oracle.com/page/Oracle+export+and+import+?t=anon">For more info about importing dump file </a></p>
<p><span id="more-28"></span></p>
<p>exp and imp are utilities present in the $ORACLE_HOME/bin directory and are installed when Oracle is installed. Their prime purpose is to move logical objects out of and into the database respectively &#8211; for example dumping all of the tables owned by a user to a single file is achieved using the exp utility. It is important to distinguish between dumping data in this manner and backing up the database which is normally achieved using the rman utility.<br />
Starting with Oracle 10g these two utilities are deprecated and the Oracle recommended alternatives are the data pump versions of these utilities which provide a number of new features including the ability to disconnect and reconnect to an interactive session (so a direct logon to the server isn&#8217;t required) and improved performance. There are still a number of things that cannot be achieved with the data pump utilities &#8211; in particular exporting/importing across a named pipe which is a technique used by database administrators when the export file needs to be compressed on the fly or when one wishes to export directly to an import session.</p>
<p>Before executing these commands, the environment should be set correctly for the user in particular if the examples used on this page are followed the $ORACLE_HOME, $ORACLE_SID and $PATH environment variables need to be set appropriately in a unix environment and the %ORACLE_SID% environment variable needs to be set in a windows environment. If you login as the owner of the oracle software (usually the oracle user on unix) these are likely to have been set in the users profile. The Oracle Database instance needs to be up in order to export/import data. Type &#8216;imp help=y&#8217; or &#8216;exp help=y&#8217; for a detailed explanation of the available options for these utilities. Some brief examples follow to illustrate the usage of these utilities.</p>
<p>Using exp:</p>
<p>To export the entire database to a single file dba.dmp in the current directory.</p>
<p>- Login to server</p>
<p>    exp SYSTEM/password FULL=y FILE=dba.dmp LOG=dba.log CONSISTENT=y</p>
<p>or</p>
<p>    exp SYSTEM/password PARFILE=params.dat</p>
<p>where params.dat contains the following information</p>
<p>FILE=dba.dmp<br />
GRANTS=y<br />
FULL=y<br />
ROWS=y<br />
LOG=dba.log</p>
<p>To dump a single schema to disk (we use the scott example schema here)</p>
<p>- Login to server which has an Oracle client</p>
<p>    exp / FIlE=scott.dmp OWNER=scott</p>
<p>To export specific tables to disk:</p>
<p>- Login to server which has an Oracle client</p>
<p>    exp SYSTEM/password FIlE=expdat.dmp TABLES=(scott.emp,hr.countries) </p>
<p>-the above command uses two users : scott and hr</p>
<p>    exp / FILE=scott.dmp TABLES=(emp,dept) </p>
<p>the above is only for one user</p>
<p>Using imp:</p>
<p>To import the full database exported in the example above.</p>
<p>    imp SYSTEM/password FULL=y FIlE=dba.dmp </p>
<p>To import just the dept and emp tables from the scott schema</p>
<p>    imp SYSTEM/password FIlE=dba.dmp FROMUSER=scott TABLES=(dept,emp) </p>
<p>To import tables and change the owner</p>
<p>    imp SYSTEM/password FROMUSER=blake TOUSER=scott FILE=blake.dmp TABLES=(unit,manager)</p>
<p>To import just the scott schema exported in the example above</p>
<p>    imp / FIlE=scott.dmp</p>
<p>If you do not supply any parameters then you enter an interactive session as illustrated below. (Responses to prompts are shown in blue. from the prompt type imp and press enter</p>
<p>    $&gt;imp<br />
    Import: Release 9.2.0.6.0 &#8211; Production on Thu Mar 29 15:07:43 2007<br />
    Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.<br />
    Username: SYSTEM<br />
    Password: password<br />
    Connected to: Oracle9i Enterprise Edition Release 9.2.0.6.0 &#8211; Production<br />
    With the Partitioning, OLAP and Oracle Data Mining options<br />
    JServer Release 9.2.0.6.0 &#8211; Production<br />
    Import file: expdat.dmp &gt; /mention/path/of/dumpFile/includingFileName.dmp<br />
    Enter insert buffer size (minimum is 8192) 30720&gt; (press enter to accept default)<br />
    Export file created by EXPORT:V09.02.00 via conventional path<br />
    import done in US7ASCII character set and AL16UTF16 NCHAR character set<br />
    import server uses AL32UTF8 character set (possible charset conversion)<br />
    List contents of import file only (yes/no): no &gt; press enter<br />
    Ignore create error due to object existence (yes/no): no &gt; press enter<br />
    Import grants (yes/no): yes &gt; press enter<br />
    Import table data (yes/no): yes &gt; press enter<br />
    Import entire export file (yes/no): no &gt; press enter or type no<br />
    Username: give the userName for which you want the data to be imported<br />
    Enter table(T) or partition(T:P) names. Null list means all tables for user<br />
    Enter table(T) or partition(T:P) name or . if done: press enter<br />
    . importing TST_001_V2&#8242;s objects into TST_001_V2</p>
<p>Good practices</p>
<p>    * Always take care about CHARSETS when you do export and import. Using the wrong ones can convert your data in a lossy manner. The best situation is when your source and destination database have the same character sets, so you can avoid completely any character conversion. You control this behaviour by setting NLS_LANG environment variable appropriately. When not set properly you may see &#8216;Exporting questionable statistics&#8217; messages.<br />
    * After doing an export, it is better to check your dump by doing an import with the parameter SHOW=Y. This checks the validity of your dump file.</p>
<p>Other considerations</p>
<p>    * You may need to patch your Oracle client (where you are running exp/imp) to the same level as the Oracle server to prevent errors<br />
    * When importing large amounts of data consider dropping indexes prior to the import to speed up the process and re-creating them once the import is completed<br />
    * The amount of archivelogs that may be created on a large import may fill up your disk<br />
    * On INSERT triggers will fire, consider whether these need to be disabled<br />
    * Increasing the RECORDLENGTH (max 65535) parameter can improve the length of time to perform an import/export as well as DIRECT=y for export</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/aozturk.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/aozturk.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/aozturk.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/aozturk.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/aozturk.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/aozturk.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/aozturk.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/aozturk.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/aozturk.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/aozturk.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/aozturk.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/aozturk.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/aozturk.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/aozturk.wordpress.com/28/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aozturk.wordpress.com&amp;blog=6688012&amp;post=28&amp;subd=aozturk&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://aozturk.wordpress.com/2009/03/06/how-to-import-oracle-dump-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fa62e289ed614d5e06d86f0fa7023261?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">aykutomer</media:title>
		</media:content>
	</item>
		<item>
		<title>how to pass an array of objects to a PL/SQL function/procedure that accepts a &#8220;SAMPLE_TABLE_TYPE&#8221; table (a table of object &#8220;SAMPLE_TYPE&#8221;).</title>
		<link>http://aozturk.wordpress.com/2009/02/28/how-to-pass-an-array-of-objects-to-a-plsql-functionprocedure-that-accepts-a-sample_table_type-table-a-table-of-object-sample_type/</link>
		<comments>http://aozturk.wordpress.com/2009/02/28/how-to-pass-an-array-of-objects-to-a-plsql-functionprocedure-that-accepts-a-sample_table_type-table-a-table-of-object-sample_type/#comments</comments>
		<pubDate>Sat, 28 Feb 2009 11:28:23 +0000</pubDate>
		<dc:creator>aykutomer</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Oracle PL/SQL]]></category>
		<category><![CDATA[passing array of objects]]></category>
		<category><![CDATA[plsql function/procedures]]></category>

		<guid isPermaLink="false">http://aozturk.wordpress.com/?p=22</guid>
		<description><![CDATA[/* first create a PL/SQL object type and table type */ create or replace type SAMPLE_TYPE as object( id number(34), email varchar2(64), info_value varchar2(255) ); create or replace type SAMPLE_TABLE_TYPE as table of SAMPLE_TYPE; //then in the java code LogTrans app = new LogTrans(); int commit = 1; Vector vector = new Vector(); Object[] attr [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aozturk.wordpress.com&amp;blog=6688012&amp;post=22&amp;subd=aozturk&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>/*<br />
first create a PL/SQL object type and table type<br />
*/<br />
create or replace type SAMPLE_TYPE as object(<br />
id number(34),<br />
email varchar2(64),<br />
info_value varchar2(255)<br />
);<br />
create or replace type SAMPLE_TABLE_TYPE as table of SAMPLE_TYPE;</p>
<p>//then in the java code<br />
LogTrans app = new LogTrans();<br />
int commit = 1;<br />
Vector vector = new Vector();</p>
<p>Object[] attr = new Object[3];<br />
attr[0] = (Object) new BigDecimal(8);<br />
attr[1] = (Object) new String(&#8220;TEST@TEST.COM&#8221;);<br />
attr[2] = (Object) new String(&#8220;TEST DATA&#8221;);</p>
<p>try<br />
{<br />
app.connect();</p>
<p>StructDescriptor structdesc = StructDescriptor.createDescriptor(&#8220;SAMPLE_TYPE&#8221;,app.con);<br />
vector.add((Object)new STRUCT(structdesc, app.con, attr));</p>
<p>ArrayDescriptor arraydesc = ArrayDescriptor.createDescriptor(&#8220;SAMPLE_TABLE_TYPE&#8221;,app.con);</p>
<p>Object obj_array[] = vector.toArray();<br />
ARRAY array = new ARRAY(arraydesc,app.con,obj_array);</p>
<p>CallableStatement cstm = app.con.prepareCall(&#8220;{ call PACKAGE.FUNCTION(?,?) }&#8221;);<br />
((OracleCallableStatement)cstm).setARRAY(1, array);<br />
cstm.setInt(2, 1);<br />
cstm.execute();<br />
System.out.println(&#8220;Please check database&#8221;);</p>
<p>}<br />
catch(Exception e)<br />
{<br />
System.err.println(&#8220;dothis method exception: &#8221; + e.getMessage());<br />
}</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/aozturk.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/aozturk.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/aozturk.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/aozturk.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/aozturk.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/aozturk.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/aozturk.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/aozturk.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/aozturk.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/aozturk.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/aozturk.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/aozturk.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/aozturk.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/aozturk.wordpress.com/22/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aozturk.wordpress.com&amp;blog=6688012&amp;post=22&amp;subd=aozturk&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://aozturk.wordpress.com/2009/02/28/how-to-pass-an-array-of-objects-to-a-plsql-functionprocedure-that-accepts-a-sample_table_type-table-a-table-of-object-sample_type/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fa62e289ed614d5e06d86f0fa7023261?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">aykutomer</media:title>
		</media:content>
	</item>
		<item>
		<title>Passing Java Arrays to PL/SQL Procedure</title>
		<link>http://aozturk.wordpress.com/2009/02/28/passing-java-arrays-to-plsql-procedure/</link>
		<comments>http://aozturk.wordpress.com/2009/02/28/passing-java-arrays-to-plsql-procedure/#comments</comments>
		<pubDate>Sat, 28 Feb 2009 11:04:12 +0000</pubDate>
		<dc:creator>aykutomer</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Oracle PL/SQL]]></category>

		<guid isPermaLink="false">http://aozturk.wordpress.com/2009/02/28/passing-java-arrays-to-plsql-procedure/</guid>
		<description><![CDATA[in PL/SQL&#8212;&#8212; create or replace type rectype as object(col1 varchar2(10),col2 varchar2(10)); / create or replace package ioStruct as procedure testproc(iorec in out rectype,orec out rectype); end ioStruct; / create or replace package body ioStruct as procedure testproc(iorec in out rectype,orec out rectype) is begin orec := iorec; iorec.col1 := orec.col2; iorec.col2 := orec.col1; end testproc; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aozturk.wordpress.com&amp;blog=6688012&amp;post=18&amp;subd=aozturk&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>in PL/SQL&#8212;&#8212;<br />
create or replace type rectype as object(col1 varchar2(10),col2 varchar2(10));<br />
/<br />
create or replace package ioStruct as<br />
procedure testproc(iorec in out rectype,orec out rectype);<br />
end ioStruct;<br />
/</p>
<p>create or replace package body ioStruct as</p>
<p>procedure testproc(iorec in out rectype,orec out rectype) is<br />
begin<br />
orec := iorec;<br />
iorec.col1 := orec.col2;<br />
iorec.col2 := orec.col1;<br />
end testproc;<br />
end ioStruct;<br />
/</p>
<p>and in java&#8212;-</p>
<p>{<br />
// First declare the object arrays that will store the data.<br />
Object [] p1obj = {&#8220;First&#8221;,&#8221;Second&#8221;};<br />
Object [] p2obj = {};<br />
// Now Declare a descriptor to associate the host object type with the<br />
// record type in the database.<br />
StructDescriptor desc1=StructDescriptor.createDescriptor(&#8220;RECTYPE&#8221;,conn);<br />
// Now create the STRUCT objects to associate the host objects<br />
// with the database records.<br />
STRUCT p1struct = new STRUCT(desc1,conn,p1obj);<br />
STRUCT p2struct;<br />
// Declare the callable statement.<br />
// This has to be of type OracleCallableStatement to use:<br />
// setOracleObject(<br />
// and<br />
// registerOutParameter(position,type,oracletype)<br />
OracleCallableStatement ocs =<br />
(OracleCallableStatement)conn.prepareCall(&#8220;{call iostruct.testproc(?,?)}&#8221;);<br />
// The first parameter is in out so we have to use setOracleObject to<br />
// pass it to the statement.<br />
ocs.setOracleObject(1,p1struct);<br />
// The first parameter is in out so we have to Register the parameter as well.<br />
// Note the reuse of the TYPE.<br />
ocs.registerOutParameter(1,OracleTypes.STRUCT,&#8221;RECTYPE&#8221;);<br />
// The second parameter is out so that has to be registered too.<br />
// Note the re use of the TYPE.<br />
ocs.registerOutParameter(2,OracleTypes.STRUCT,&#8221;RECTYPE&#8221;);<br />
// Execute the procedure.<br />
ocs.execute();<br />
// Associate the returned arrays with the ARRAY objects.<br />
p1struct = ocs.getSTRUCT(1);<br />
p2struct = ocs.getSTRUCT(2);<br />
// Get the data back into the data arrays<br />
p1obj = p1struct.getAttributes();<br />
p2obj = p2struct.getAttributes();<br />
// Show the results:<br />
System.out.println(&#8220;First Object is now &#8220;+p1obj[0]+&#8221; and &#8220;+p1obj[1]);<br />
System.out.println(&#8220;Second Object is now &#8220;+p2obj[0]+&#8221; and &#8220;+p2obj[1]);<br />
}</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/aozturk.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/aozturk.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/aozturk.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/aozturk.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/aozturk.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/aozturk.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/aozturk.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/aozturk.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/aozturk.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/aozturk.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/aozturk.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/aozturk.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/aozturk.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/aozturk.wordpress.com/18/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aozturk.wordpress.com&amp;blog=6688012&amp;post=18&amp;subd=aozturk&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://aozturk.wordpress.com/2009/02/28/passing-java-arrays-to-plsql-procedure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fa62e289ed614d5e06d86f0fa7023261?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">aykutomer</media:title>
		</media:content>
	</item>
		<item>
		<title>2009 Turkcell Teknoloji Yaz Dönemi Staj Başvuruları Başladı.</title>
		<link>http://aozturk.wordpress.com/2009/02/25/2009-turkcell-teknoloji-yaz-donemi-staj-basvurulari-basladi/</link>
		<comments>http://aozturk.wordpress.com/2009/02/25/2009-turkcell-teknoloji-yaz-donemi-staj-basvurulari-basladi/#comments</comments>
		<pubDate>Wed, 25 Feb 2009 09:55:22 +0000</pubDate>
		<dc:creator>aykutomer</dc:creator>
				<category><![CDATA[Genel]]></category>
		<category><![CDATA[Staj]]></category>
		<category><![CDATA[turkcell]]></category>
		<category><![CDATA[turkcell teknoloji]]></category>
		<category><![CDATA[yaz dönemi stajı]]></category>
		<category><![CDATA[yaz stajı]]></category>

		<guid isPermaLink="false">http://aozturk.wordpress.com/?p=7</guid>
		<description><![CDATA[2009 yaz dönemi staj dönemi için  www.turkcellteknoloji.com.tr web sitesinden “İnsan Kaynakları/Açık Pozisyonlar/Turkcell Teknoloji 2009 Paf Takımı”  (http://www.turkcellteknoloji.com.tr/HumanResources/Paf2009.aspx) altından başvurular alınıyor. Turkcell ve grup şirketlerinin web sitelerinden yapılan tüm başvurular kariyer.net ortak databaseinde toplanacaktır.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aozturk.wordpress.com&amp;blog=6688012&amp;post=7&amp;subd=aozturk&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal"><img class="alignleft" title="Turkcel Teknoloji" src="http://www.turkcellteknoloji.com.tr/Images/logo.jpg" alt="" width="212" height="133" /></p>
<p class="MsoNormal">2009 yaz dönemi staj dönemi için  <a href="http://www.turkcellteknoloji.com.tr/">www.turkcellteknoloji.com.tr</a> web sitesinden “İnsan Kaynakları/Açık Pozisyonlar/Turkcell Teknoloji 2009 Paf Takımı”  (<a href="http://www.turkcellteknoloji.com.tr/HumanResources/Paf2009.aspx">http://www.turkcellteknoloji.com.tr/HumanResources/Paf2009.aspx</a>) altından başvurular alınıyor.</p>
<p class="MsoNormal"><span id="more-7"></span></p>
<p class="MsoNormal" style="text-align:left;">Turkcell ve grup şirketlerinin web sitelerinden yapılan tüm başvurular kariyer.net ortak databaseinde toplanacaktır.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/aozturk.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/aozturk.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/aozturk.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/aozturk.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/aozturk.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/aozturk.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/aozturk.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/aozturk.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/aozturk.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/aozturk.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/aozturk.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/aozturk.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/aozturk.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/aozturk.wordpress.com/7/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aozturk.wordpress.com&amp;blog=6688012&amp;post=7&amp;subd=aozturk&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://aozturk.wordpress.com/2009/02/25/2009-turkcell-teknoloji-yaz-donemi-staj-basvurulari-basladi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fa62e289ed614d5e06d86f0fa7023261?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">aykutomer</media:title>
		</media:content>

		<media:content url="http://www.turkcellteknoloji.com.tr/Images/logo.jpg" medium="image">
			<media:title type="html">Turkcel Teknoloji</media:title>
		</media:content>
	</item>
		<item>
		<title>How to return an array from a PL/SQL Stored function</title>
		<link>http://aozturk.wordpress.com/2009/02/25/how-to-return-an-array-from-a-plsql-stored-function/</link>
		<comments>http://aozturk.wordpress.com/2009/02/25/how-to-return-an-array-from-a-plsql-stored-function/#comments</comments>
		<pubDate>Wed, 25 Feb 2009 09:50:43 +0000</pubDate>
		<dc:creator>aykutomer</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Oracle PL/SQL]]></category>
		<category><![CDATA[Array]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[PL/SQL]]></category>

		<guid isPermaLink="false">http://aozturk.wordpress.com/?p=3</guid>
		<description><![CDATA[Create a SQL VARRAY type in the database SQL&#62;CREATE OR REPLACE TYPE EMPARRAY is VARRAY(20) OF VARCHAR2(30) SQL&#62;/ Then create the following function that returns a VARRAY. CREATE OR REPLACE FUNCTION getEmpArray RETURN EMPARRAY AS l_data EmpArray := EmpArray(); CURSOR c_emp IS SELECT ename FROM EMP; BEGIN FOR emp_rec IN c_emp LOOP l_data.extend; l_data(l_data.count) := [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aozturk.wordpress.com&amp;blog=6688012&amp;post=3&amp;subd=aozturk&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span class="tabletext">Create a SQL</span><span class="code"> VARRAY</span><span class="tabletext"> type in the database</span></p>
<p><span class="code">SQL&gt;CREATE OR REPLACE TYPE EMPARRAY  is VARRAY(20) OF VARCHAR2(30)<br />
SQL&gt;/</span></p>
<p><span class="paragraph">Then create the following  function that        returns a </span><span class="code">VARRAY</span><span class="tabletext">.</span></p>
<table border="0" cellspacing="0" bgcolor="#86a5c3">
<tbody>
<tr>
<td>
<table border="0" cellspacing="0" cellpadding="3" width="100%" bgcolor="#ffffff">
<tbody>
<tr>
<td class="CODE" valign="top" bgcolor="#eaead5">
<pre>CREATE OR REPLACE FUNCTION <strong>getEmpArray</strong> RETURN <strong>EMPARRAY</strong>
AS
  <strong>l_data EmpArray := EmpArray();</strong>
  CURSOR c_emp IS SELECT ename FROM EMP;
  BEGIN
    FOR emp_rec IN c_emp LOOP
      <strong>l_data.extend;
      l_data(l_data.count) := emp_rec.ename;</strong>
    END LOOP;
    RETURN l_data;
  END;</pre>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p class="paragraph">Once the function is created in the database, it can          be invoked from the java application and get the array data in the application.          Below given is the code snippet  to execute  the PL/SQL stored function          from a Java Application.</p>
<p class="paragraph">
<p class="paragraph">
<table border="0" cellspacing="0" width="65%" bgcolor="#86a5c3">
<tbody>
<tr>
<td>
<table border="0" cellspacing="0" cellpadding="3" width="100%" bgcolor="#ffffff">
<tbody>
<tr>
<td class="CODE" valign="top" bgcolor="#eaead5">
<pre><span class="bodycopy">public static void <strong>main</strong>( ) {
</span><span class="bodycopy"><span class="bodycopy">.........</span>
<span class="bodycopy">.........</span>
  <strong>OracleCallableStatement stmt =(OracleCallableStatement)conn.prepareCall
                ( "begin ? := getEMpArray; end;" );</strong>

    // The name we use below, EMPARRAY, has to match the name of the
    // type defined in the PL/SQL Stored Function
    <strong>stmt.registerOutParameter( 1, OracleTypes.ARRAY,"EMPARRAY" );</strong>
    stmt.executeUpdate();

    // Get the ARRAY object and print the meta data assosiated with it
    <strong>ARRAY simpleArray = stmt.getARRAY(1);</strong>

    System.out.println("Array is of type " +  simpleArray.getSQLTypeName());

    System.out.println("Array element is of type code "+simpleArray.getBaseType());

    System.out.println("Array is of length " + simpleArray.length());

    // Print the contents of the array
    <strong>String[] values = (String[])simpleArray.getArray();</strong>

    for( int i = 0; i &lt; values.length; i++ )
      System.out.println( "row " + i + " = '" + values[i] +"'" );

</span><span class="bodycopy">...........
...........</span></pre>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/aozturk.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/aozturk.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/aozturk.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/aozturk.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/aozturk.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/aozturk.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/aozturk.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/aozturk.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/aozturk.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/aozturk.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/aozturk.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/aozturk.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/aozturk.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/aozturk.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aozturk.wordpress.com&amp;blog=6688012&amp;post=3&amp;subd=aozturk&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://aozturk.wordpress.com/2009/02/25/how-to-return-an-array-from-a-plsql-stored-function/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fa62e289ed614d5e06d86f0fa7023261?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">aykutomer</media:title>
		</media:content>
	</item>
	</channel>
</rss>
