<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: Install DBD::Oracle on 64-bit Linux and Oracle 11g</title>
	<link>http://www.pythian.com/blogs/995/another-dbdoracle-intall-kludge-64-bit-linux-and-oracle-11</link>
	<description>News and views from Pythian DBAs</description>
	<pubDate>Sat, 22 Nov 2008 12:37:16 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.2</generator>
		<item>
		<title>By: Paul Vallee</title>
		<link>http://www.pythian.com/blogs/995/another-dbdoracle-intall-kludge-64-bit-linux-and-oracle-11#comment-238311</link>
		<dc:creator>Paul Vallee</dc:creator>
		<pubDate>Thu, 17 Jul 2008 18:57:09 +0000</pubDate>
		<guid>http://www.pythian.com/blogs/995/another-dbdoracle-intall-kludge-64-bit-linux-and-oracle-11#comment-238311</guid>
		<description>Excellent info, John, thanks.
Paul</description>
		<content:encoded><![CDATA[<p>Excellent info, John, thanks.<br />
Paul</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Scoles</title>
		<link>http://www.pythian.com/blogs/995/another-dbdoracle-intall-kludge-64-bit-linux-and-oracle-11#comment-238309</link>
		<dc:creator>John Scoles</dc:creator>
		<pubDate>Thu, 17 Jul 2008 18:45:49 +0000</pubDate>
		<guid>http://www.pythian.com/blogs/995/another-dbdoracle-intall-kludge-64-bit-linux-and-oracle-11#comment-238309</guid>
		<description>Actully 'No' is correct. 

The JDBC interface does let you 'batch' multiple statments with one execute but this is just hiding the fact that one execute is fired for ecach of them. 

From the JDBC docs

"The batch update facility is used with a PreparedStatement to associate multiple sets of input parameter values with a single PreparedStatement object."

so this

PreparedStatement stmt = con.prepareStatement(
	"INSERT INTO employees VALUES (?, ?)");

stmt.setInt(1, 2000);
stmt.setString(2, "Kelly Kaufmann");
stmt.addBatch();

stmt.setInt(1, 3000);
stmt.setString(2, "Bill Barnes");
stmt.addBatch();
 
// submit the batch for execution
int[] updateCounts = stmt.executeBatch();

will do 1 OCIExecute .  

but this

Statement stmt = con.createStatement();
stmt.addBatch("INSERT INTO employees VALUES (1000, ?,?)");
stmt.setInt(1, 2000);
stmt.setString(2, "Kelly Kaufmann");
stmt.addBatch("INSERT INTO departments VALUES (?, ?')");
stmt.setInt(1, 260);
stmt.setString(2, "Shoe");
stmt.addBatch("INSERT INTO emp_dept VALUES (?, ?)");
stmt.setInt(1, 1000);
stmt.setInt(2, 260);

int[] updateCounts = stmt.executeBatch();

will do 3 OCIExecute command one for each SQL.  So in this case there are 3 round trips to the server rather than just one for the last example.</description>
		<content:encoded><![CDATA[<p>Actully &#8216;No&#8217; is correct. </p>
<p>The JDBC interface does let you &#8216;batch&#8217; multiple statments with one execute but this is just hiding the fact that one execute is fired for ecach of them. </p>
<p>From the JDBC docs</p>
<p>&#8220;The batch update facility is used with a PreparedStatement to associate multiple sets of input parameter values with a single PreparedStatement object.&#8221;</p>
<p>so this</p>
<p>PreparedStatement stmt = con.prepareStatement(<br />
	&#8220;INSERT INTO employees VALUES (?, ?)&#8221;);</p>
<p>stmt.setInt(1, 2000);<br />
stmt.setString(2, &#8220;Kelly Kaufmann&#8221;);<br />
stmt.addBatch();</p>
<p>stmt.setInt(1, 3000);<br />
stmt.setString(2, &#8220;Bill Barnes&#8221;);<br />
stmt.addBatch();</p>
<p>// submit the batch for execution<br />
int[] updateCounts = stmt.executeBatch();</p>
<p>will do 1 OCIExecute .  </p>
<p>but this</p>
<p>Statement stmt = con.createStatement();<br />
stmt.addBatch(&#8221;INSERT INTO employees VALUES (1000, ?,?)&#8221;);<br />
stmt.setInt(1, 2000);<br />
stmt.setString(2, &#8220;Kelly Kaufmann&#8221;);<br />
stmt.addBatch(&#8221;INSERT INTO departments VALUES (?, ?&#8217;)&#8221;);<br />
stmt.setInt(1, 260);<br />
stmt.setString(2, &#8220;Shoe&#8221;);<br />
stmt.addBatch(&#8221;INSERT INTO emp_dept VALUES (?, ?)&#8221;);<br />
stmt.setInt(1, 1000);<br />
stmt.setInt(2, 260);</p>
<p>int[] updateCounts = stmt.executeBatch();</p>
<p>will do 3 OCIExecute command one for each SQL.  So in this case there are 3 round trips to the server rather than just one for the last example.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul Vallee</title>
		<link>http://www.pythian.com/blogs/995/another-dbdoracle-intall-kludge-64-bit-linux-and-oracle-11#comment-238262</link>
		<dc:creator>Paul Vallee</dc:creator>
		<pubDate>Thu, 17 Jul 2008 17:00:40 +0000</pubDate>
		<guid>http://www.pythian.com/blogs/995/another-dbdoracle-intall-kludge-64-bit-linux-and-oracle-11#comment-238262</guid>
		<description>John,
I think Laks is saying 'potato' and you're saying "pineapple".
The array interface is only for batching re-use of one handle for multiple uses, saving round trips. The batch interface lets you batch multiple statements, including different ones, into one database call. 
No?
Paul</description>
		<content:encoded><![CDATA[<p>John,<br />
I think Laks is saying &#8216;potato&#8217; and you&#8217;re saying &#8220;pineapple&#8221;.<br />
The array interface is only for batching re-use of one handle for multiple uses, saving round trips. The batch interface lets you batch multiple statements, including different ones, into one database call.<br />
No?<br />
Paul</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Scoles</title>
		<link>http://www.pythian.com/blogs/995/another-dbdoracle-intall-kludge-64-bit-linux-and-oracle-11#comment-238141</link>
		<dc:creator>John Scoles</dc:creator>
		<pubDate>Thu, 17 Jul 2008 13:08:19 +0000</pubDate>
		<guid>http://www.pythian.com/blogs/995/another-dbdoracle-intall-kludge-64-bit-linux-and-oracle-11#comment-238141</guid>
		<description>Laks Said 

'Though it helps in array binding and helps it is not equivalent to the batching facility in java driver.'

Hi Laks I was curious about this so I had a look under the hood of the JDBC interface and which calls it was using in OCI to accomplish the task.  

Well to my surprise both JDBC and DBD::Oracle use almost the exactly the same code under the hood so I think it is a case of 'We do it this way any you do it the wrong way':);).

In JDBC you 
1) prepare a statement (con.prepareStatement)
2) bind values to the statement  (stmt.setString(2, "bla"))
3) add the statement to a batch (stmt.addBatch())
4) repeat 2-3 above and then 
5) execute your batch. (stmt.executeBatch())


in DBD:Oracle
1) prepare the statement ($dbh-&#62;prepare)
2) bind all the values to the statement ($sth-&#62;bind_param_array)
3) execute the statement. ($sth-&#62;execute_array)

In both JDBC and DBD::Oracle only 1 round trip call to the execute is made in OCI.

So me thinks it is a case here of 'You say 'potato' and I say 'potato'.

cheers</description>
		<content:encoded><![CDATA[<p>Laks Said </p>
<p>&#8216;Though it helps in array binding and helps it is not equivalent to the batching facility in java driver.&#8217;</p>
<p>Hi Laks I was curious about this so I had a look under the hood of the JDBC interface and which calls it was using in OCI to accomplish the task.  </p>
<p>Well to my surprise both JDBC and DBD::Oracle use almost the exactly the same code under the hood so I think it is a case of &#8216;We do it this way any you do it the wrong way&#8217;:);).</p>
<p>In JDBC you<br />
1) prepare a statement (con.prepareStatement)<br />
2) bind values to the statement  (stmt.setString(2, &#8220;bla&#8221;))<br />
3) add the statement to a batch (stmt.addBatch())<br />
4) repeat 2-3 above and then<br />
5) execute your batch. (stmt.executeBatch())</p>
<p>in DBD:Oracle<br />
1) prepare the statement ($dbh-&gt;prepare)<br />
2) bind all the values to the statement ($sth-&gt;bind_param_array)<br />
3) execute the statement. ($sth-&gt;execute_array)</p>
<p>In both JDBC and DBD::Oracle only 1 round trip call to the execute is made in OCI.</p>
<p>So me thinks it is a case here of &#8216;You say &#8216;potato&#8217; and I say &#8216;potato&#8217;.</p>
<p>cheers</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sergey</title>
		<link>http://www.pythian.com/blogs/995/another-dbdoracle-intall-kludge-64-bit-linux-and-oracle-11#comment-209267</link>
		<dc:creator>Sergey</dc:creator>
		<pubDate>Sat, 31 May 2008 10:14:07 +0000</pubDate>
		<guid>http://www.pythian.com/blogs/995/another-dbdoracle-intall-kludge-64-bit-linux-and-oracle-11#comment-209267</guid>
		<description>Thank you very much for patching Makefile.PL!
It's very easy now to install DBD::Oracle with 11g.</description>
		<content:encoded><![CDATA[<p>Thank you very much for patching Makefile.PL!<br />
It&#8217;s very easy now to install DBD::Oracle with 11g.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Laks</title>
		<link>http://www.pythian.com/blogs/995/another-dbdoracle-intall-kludge-64-bit-linux-and-oracle-11#comment-206834</link>
		<dc:creator>Laks</dc:creator>
		<pubDate>Tue, 27 May 2008 14:28:39 +0000</pubDate>
		<guid>http://www.pythian.com/blogs/995/another-dbdoracle-intall-kludge-64-bit-linux-and-oracle-11#comment-206834</guid>
		<description>Thanks John for your responses.
1) I had a look at the bind_param_array and execute_array interfaces added from 1.18 of DBD::Oracle.
Though it helps in array binding and helps it is not equivalent to the batching facility in java driver.With jdbc one can transparently batch inserts and updates to be sent to rdbms server in one shot. inserts and updates are done normally but driver internally batches them together like one unit of work.
Anyway i am happy that the array interface helps in binding array of values for inserts from 1.18.</description>
		<content:encoded><![CDATA[<p>Thanks John for your responses.<br />
1) I had a look at the bind_param_array and execute_array interfaces added from 1.18 of DBD::Oracle.<br />
Though it helps in array binding and helps it is not equivalent to the batching facility in java driver.With jdbc one can transparently batch inserts and updates to be sent to rdbms server in one shot. inserts and updates are done normally but driver internally batches them together like one unit of work.<br />
Anyway i am happy that the array interface helps in binding array of values for inserts from 1.18.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Scoles</title>
		<link>http://www.pythian.com/blogs/995/another-dbdoracle-intall-kludge-64-bit-linux-and-oracle-11#comment-201554</link>
		<dc:creator>John Scoles</dc:creator>
		<pubDate>Mon, 19 May 2008 14:08:37 +0000</pubDate>
		<guid>http://www.pythian.com/blogs/995/another-dbdoracle-intall-kludge-64-bit-linux-and-oracle-11#comment-201554</guid>
		<description>For #1 I think you are refering to the OCI Array_interface and yes DBD::Oracle supports it (since 1.18)  
check out this link
http://search.cpan.org/~timb/DBI-1.604/DBI.pm#bind_param_array



As for #2 I think we support is as well check out these links
http://search.cpan.org/~pythian/DBD-Oracle-1.21/Oracle.pm#Returning_A_Recordset
http://search.cpan.org/~pythian/DBD-Oracle-1.21/Oracle.pm#Binding_Cursors</description>
		<content:encoded><![CDATA[<p>For #1 I think you are refering to the OCI Array_interface and yes DBD::Oracle supports it (since 1.18)<br />
check out this link<br />
<a href="http://search.cpan.org/~timb/DBI-1.604/DBI.pm#bind_param_array" rel="nofollow">http://search.cpan.org/~timb/DBI-1.604/DBI.pm#bind_param_array</a></p>
<p>As for #2 I think we support is as well check out these links<br />
<a href="http://search.cpan.org/~pythian/DBD-Oracle-1.21/Oracle.pm#Returning_A_Recordset" rel="nofollow">http://search.cpan.org/~pythian/DBD-Oracle-1.21/Oracle.pm#Returning_A_Recordset</a><br />
<a href="http://search.cpan.org/~pythian/DBD-Oracle-1.21/Oracle.pm#Binding_Cursors" rel="nofollow">http://search.cpan.org/~pythian/DBD-Oracle-1.21/Oracle.pm#Binding_Cursors</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Laks</title>
		<link>http://www.pythian.com/blogs/995/another-dbdoracle-intall-kludge-64-bit-linux-and-oracle-11#comment-201484</link>
		<dc:creator>Laks</dc:creator>
		<pubDate>Mon, 19 May 2008 08:14:42 +0000</pubDate>
		<guid>http://www.pythian.com/blogs/995/another-dbdoracle-intall-kludge-64-bit-linux-and-oracle-11#comment-201484</guid>
		<description>Thanks for your response.
1) I am referring to the facility provided by oracle jdbc thin driver to batch the insert/update operations so that roundtrips to the server is reduced.
eg: One could set the batch parameter on the connection or on a specific statement object/handle to a value say 10. Then irrespective of the # of calls to execute a update/insert on the statement handle, every 10 update/insert requests get batched and sent to DB server to execute. This reduces the round trips to server which normally happens for every insert/update that gets sent to server to execute each time on execute call.
I am not aware how this works in DBD::Oracle.
2) How can one retrieve pl/sql Table type or bind such things with DBD::Oracle.
  JPublisher provided by oracle maps between oracle types and jdbc types easily.

Thanks and regards</description>
		<content:encoded><![CDATA[<p>Thanks for your response.<br />
1) I am referring to the facility provided by oracle jdbc thin driver to batch the insert/update operations so that roundtrips to the server is reduced.<br />
eg: One could set the batch parameter on the connection or on a specific statement object/handle to a value say 10. Then irrespective of the # of calls to execute a update/insert on the statement handle, every 10 update/insert requests get batched and sent to DB server to execute. This reduces the round trips to server which normally happens for every insert/update that gets sent to server to execute each time on execute call.<br />
I am not aware how this works in DBD::Oracle.<br />
2) How can one retrieve pl/sql Table type or bind such things with DBD::Oracle.<br />
  JPublisher provided by oracle maps between oracle types and jdbc types easily.</p>
<p>Thanks and regards</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Scoles</title>
		<link>http://www.pythian.com/blogs/995/another-dbdoracle-intall-kludge-64-bit-linux-and-oracle-11#comment-201336</link>
		<dc:creator>John Scoles</dc:creator>
		<pubDate>Sun, 18 May 2008 19:21:44 +0000</pubDate>
		<guid>http://www.pythian.com/blogs/995/another-dbdoracle-intall-kludge-64-bit-linux-and-oracle-11#comment-201336</guid>
		<description>not sure what exactly you mean by batching and Oracle type support.

Do you have any examples?</description>
		<content:encoded><![CDATA[<p>not sure what exactly you mean by batching and Oracle type support.</p>
<p>Do you have any examples?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Laks</title>
		<link>http://www.pythian.com/blogs/995/another-dbdoracle-intall-kludge-64-bit-linux-and-oracle-11#comment-201263</link>
		<dc:creator>Laks</dc:creator>
		<pubDate>Sun, 18 May 2008 12:34:57 +0000</pubDate>
		<guid>http://www.pythian.com/blogs/995/another-dbdoracle-intall-kludge-64-bit-linux-and-oracle-11#comment-201263</guid>
		<description>Hi,
Does the latest DBD::Oracle have features like batching and Oracle types support features similar to the jdbc thin driver provided by oracle.

thanks and Regards</description>
		<content:encoded><![CDATA[<p>Hi,<br />
Does the latest DBD::Oracle have features like batching and Oracle types support features similar to the jdbc thin driver provided by oracle.</p>
<p>thanks and Regards</p>
]]></content:encoded>
	</item>
</channel>
</rss>
