<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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: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>Comments on: ruby-plsql gem: simple Ruby API for PL/SQL procedures</title>
	<atom:link href="http://blog.rayapps.com/2008/03/15/ruby-plsql-gem-simple-ruby-api-for-plsql-procedures/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.rayapps.com/2008/03/15/ruby-plsql-gem-simple-ruby-api-for-plsql-procedures/</link>
	<description>About Ruby, Oracle, Mac and others</description>
	<lastBuildDate>Wed, 10 Mar 2010 15:16:29 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Raimonds Simanovskis</title>
		<link>http://blog.rayapps.com/2008/03/15/ruby-plsql-gem-simple-ruby-api-for-plsql-procedures/#comment-1111</link>
		<dc:creator>Raimonds Simanovskis</dc:creator>
		<pubDate>Tue, 09 Feb 2010 12:04:26 +0000</pubDate>
		<guid isPermaLink="false">http://rayapps.wordpress.com/?p=21#comment-1111</guid>
		<description>No, not now. You have to execute individual statements separately with e.g. plsql.execute or plsql.select.

To get stdout from sqlplus in Ruby you can simply do
`sqlplus username/password@database @script.sql`
which will launch sqlplus and return output as result of this expression.</description>
		<content:encoded><![CDATA[<p>No, not now. You have to execute individual statements separately with e.g. plsql.execute or plsql.select.</p>
<p>To get stdout from sqlplus in Ruby you can simply do<br />
`sqlplus username/password@database @script.sql`<br />
which will launch sqlplus and return output as result of this expression.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cris</title>
		<link>http://blog.rayapps.com/2008/03/15/ruby-plsql-gem-simple-ruby-api-for-plsql-procedures/#comment-1109</link>
		<dc:creator>Cris</dc:creator>
		<pubDate>Mon, 08 Feb 2010 18:12:45 +0000</pubDate>
		<guid isPermaLink="false">http://rayapps.wordpress.com/?p=21#comment-1109</guid>
		<description>Raimonds,

Can this gem execute a client side .sql file from ruby and return the stdout to a ruby variable?  Much like I might use sqlplus?

Thanks for your help.

Cris</description>
		<content:encoded><![CDATA[<p>Raimonds,</p>
<p>Can this gem execute a client side .sql file from ruby and return the stdout to a ruby variable?  Much like I might use sqlplus?</p>
<p>Thanks for your help.</p>
<p>Cris</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alicja</title>
		<link>http://blog.rayapps.com/2008/03/15/ruby-plsql-gem-simple-ruby-api-for-plsql-procedures/#comment-590</link>
		<dc:creator>Alicja</dc:creator>
		<pubDate>Wed, 26 Aug 2009 07:25:12 +0000</pubDate>
		<guid isPermaLink="false">http://rayapps.wordpress.com/?p=21#comment-590</guid>
		<description>Thanks! It works really nice:)
Undoubtedly I will use your cool gem.
Alicja</description>
		<content:encoded><![CDATA[<p>Thanks! It works really nice:)<br />
Undoubtedly I will use your cool gem.<br />
Alicja</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Raimonds Simanovskis</title>
		<link>http://blog.rayapps.com/2008/03/15/ruby-plsql-gem-simple-ruby-api-for-plsql-procedures/#comment-588</link>
		<dc:creator>Raimonds Simanovskis</dc:creator>
		<pubDate>Tue, 25 Aug 2009 15:31:28 +0000</pubDate>
		<guid isPermaLink="false">http://rayapps.wordpress.com/?p=21#comment-588</guid>
		<description>You need to specify for ruby-plsql which connection to use, in your example include

plsql.connection = conn

before trying to call plsql.big_letter</description>
		<content:encoded><![CDATA[<p>You need to specify for ruby-plsql which connection to use, in your example include</p>
<p>plsql.connection = conn</p>
<p>before trying to call plsql.big_letter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alicja</title>
		<link>http://blog.rayapps.com/2008/03/15/ruby-plsql-gem-simple-ruby-api-for-plsql-procedures/#comment-586</link>
		<dc:creator>Alicja</dc:creator>
		<pubDate>Tue, 25 Aug 2009 14:02:07 +0000</pubDate>
		<guid isPermaLink="false">http://rayapps.wordpress.com/?p=21#comment-586</guid>
		<description>My ruby version is 1.8.6, ruby-oci8 2.0.2 and ruby-plsql 0.3.1

I would like to connect with my database through ruby-plsql.
But when I try to execute my stored function I get an error &#039;No PL/SQL connection&#039;.

Everything is ok when I select data from oracle database directly through oci8:

irb(main):001:0&gt; require &#039;oci8&#039;
=&gt; true
irb(main):002:0&gt; require &#039;ruby_plsql&#039;
=&gt; true
irb(main):003:0&gt; conn=OCI8.new(&#039;myusername&#039;,&#039;mypaswd&#039;,&#039;mydatabase&#039;)
=&gt; #&lt;OCI8:0xded9e98 @privilege=nil, @prefetch_rows=nil, @ctx=[0, #, nil, 65535], @svc=#&gt;
irb(main):004:0&gt; conn.exec(&#039;select description1 from gi_blacklists&#039;) do &#124;r&#124;
irb(main):005:1*   puts r
irb(main):006:1&gt;   end
WPIS NA PODST ROSZCZENIA 14341.
WPIS NA PODST ROSZCZENIA 19482.
WPIS NA PODST ROSZCZENIA 9521.
WPIS NA PODST ROSZCZENIA 6189.
WPIS NA PODST ROSZCZENIA 1783.
WPIS NA PODST ROSZCZENIA 3141.
WPIS NA PODST ROSZCZENIA 21395.
=&gt; 7

I&#039;ve created a stored function big_letter:
CREATE OR REPLACE 
FUNCTION gi.big_letter (p_str IN VARCHAR2)
   RETURN VARCHAR2
IS
BEGIN
   RETURN UPPER (p_str);
END;
/

Now, I try to call this function in ruby:

irb(main):007:0&gt; puts plsql.big_letter(&#039;ala ma kota&#039;)
ArgumentError: No PL/SQL connection
	from C:/Ruby/lib/ruby/gems/1.8/gems/ruby-plsql-0.3.1/lib/plsql/schema.rb:112:in `method_missing&#039;
	from (irb):7
	from :0

Am I doing anything wrong?
Thanks in advance</description>
		<content:encoded><![CDATA[<p>My ruby version is 1.8.6, ruby-oci8 2.0.2 and ruby-plsql 0.3.1</p>
<p>I would like to connect with my database through ruby-plsql.<br />
But when I try to execute my stored function I get an error &#8216;No PL/SQL connection&#8217;.</p>
<p>Everything is ok when I select data from oracle database directly through oci8:</p>
<p>irb(main):001:0&gt; require &#8216;oci8&#8242;<br />
=&gt; true<br />
irb(main):002:0&gt; require &#8216;ruby_plsql&#8217;<br />
=&gt; true<br />
irb(main):003:0&gt; conn=OCI8.new(&#8216;myusername&#8217;,'mypaswd&#8217;,'mydatabase&#8217;)<br />
=&gt; #&lt;OCI8:0xded9e98 @privilege=nil, @prefetch_rows=nil, @ctx=[0, #, nil, 65535], @svc=#&gt;<br />
irb(main):004:0&gt; conn.exec(&#8217;select description1 from gi_blacklists&#8217;) do |r|<br />
irb(main):005:1*   puts r<br />
irb(main):006:1&gt;   end<br />
WPIS NA PODST ROSZCZENIA 14341.<br />
WPIS NA PODST ROSZCZENIA 19482.<br />
WPIS NA PODST ROSZCZENIA 9521.<br />
WPIS NA PODST ROSZCZENIA 6189.<br />
WPIS NA PODST ROSZCZENIA 1783.<br />
WPIS NA PODST ROSZCZENIA 3141.<br />
WPIS NA PODST ROSZCZENIA 21395.<br />
=&gt; 7</p>
<p>I&#8217;ve created a stored function big_letter:<br />
CREATE OR REPLACE<br />
FUNCTION gi.big_letter (p_str IN VARCHAR2)<br />
   RETURN VARCHAR2<br />
IS<br />
BEGIN<br />
   RETURN UPPER (p_str);<br />
END;<br />
/</p>
<p>Now, I try to call this function in ruby:</p>
<p>irb(main):007:0&gt; puts plsql.big_letter(&#8216;ala ma kota&#8217;)<br />
ArgumentError: No PL/SQL connection<br />
	from C:/Ruby/lib/ruby/gems/1.8/gems/ruby-plsql-0.3.1/lib/plsql/schema.rb:112:in `method_missing&#8217;<br />
	from (irb):7<br />
	from :0</p>
<p>Am I doing anything wrong?<br />
Thanks in advance</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Raimonds Simanovskis</title>
		<link>http://blog.rayapps.com/2008/03/15/ruby-plsql-gem-simple-ruby-api-for-plsql-procedures/#comment-418</link>
		<dc:creator>Raimonds Simanovskis</dc:creator>
		<pubDate>Fri, 13 Mar 2009 23:00:20 +0000</pubDate>
		<guid isPermaLink="false">http://rayapps.wordpress.com/?p=21#comment-418</guid>
		<description>Yes, it seems that Windows allows you to define this environment variable both as PATH and Path but when you access it programmatically you need to specify correct case for letters :( Will need to add additional check in ruby-plsql gem.

Cursor and complex record type implementation is not so easy to be done as these types cannot be easily mapped to Ruby objects. As I typically use ruby-plsql for PL/SQL API packages which have just numbers, dates and strings as parameters I do not have such urgent need for other data types so therefore most probably I will not do this in nearest future. But if you have any patch or idea how to do it I would be glad to accept it :)</description>
		<content:encoded><![CDATA[<p>Yes, it seems that Windows allows you to define this environment variable both as PATH and Path but when you access it programmatically you need to specify correct case for letters :( Will need to add additional check in ruby-plsql gem.</p>
<p>Cursor and complex record type implementation is not so easy to be done as these types cannot be easily mapped to Ruby objects. As I typically use ruby-plsql for PL/SQL API packages which have just numbers, dates and strings as parameters I do not have such urgent need for other data types so therefore most probably I will not do this in nearest future. But if you have any patch or idea how to do it I would be glad to accept it :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James Good</title>
		<link>http://blog.rayapps.com/2008/03/15/ruby-plsql-gem-simple-ruby-api-for-plsql-procedures/#comment-417</link>
		<dc:creator>James Good</dc:creator>
		<pubDate>Fri, 13 Mar 2009 17:23:19 +0000</pubDate>
		<guid isPermaLink="false">http://rayapps.wordpress.com/?p=21#comment-417</guid>
		<description>Thanks, Raimonds. I have it working quite nicely now for standard oracle datatype parameters. However, I have some procedures to call which return cursor types, and complex record types (oracle objects). I guess I am on my own for having to implement those types?

Btw, in windows, the path is accessed through ENV[&quot;Path&quot;] (note mixed case). 

Thanks for the great gem! 

-James.</description>
		<content:encoded><![CDATA[<p>Thanks, Raimonds. I have it working quite nicely now for standard oracle datatype parameters. However, I have some procedures to call which return cursor types, and complex record types (oracle objects). I guess I am on my own for having to implement those types?</p>
<p>Btw, in windows, the path is accessed through ENV["Path"] (note mixed case). </p>
<p>Thanks for the great gem! </p>
<p>-James.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Raimonds Simanovskis</title>
		<link>http://blog.rayapps.com/2008/03/15/ruby-plsql-gem-simple-ruby-api-for-plsql-procedures/#comment-416</link>
		<dc:creator>Raimonds Simanovskis</dc:creator>
		<pubDate>Thu, 12 Mar 2009 13:58:03 +0000</pubDate>
		<guid isPermaLink="false">http://rayapps.wordpress.com/?p=21#comment-416</guid>
		<description>Yes it seems that ENV[&quot;PATH&quot;] is nil according to error message that you are receiving. It&#039;s quite strange as it should return your Windows PATH environment variable value. Can you try to run jirb and see what ENV[&quot;PATH&quot;] returns?

One workaround would be that before requiring ruby_plsql you put:
ENV[&quot;PATH&quot;] &#124;&#124;= &quot;&quot;
which will initialize ENV[&quot;PATH&quot;] to empty string if it is nil.

Also in this case please copy ojdbc14.jar (Oracle JDBC driver) in %JRUBY_HOME%/lib directory. ruby_plsql is trying at first to find ojdbc14.jar in PATH but if it cannot find it then it should be located in lib directory under JRuby installation.</description>
		<content:encoded><![CDATA[<p>Yes it seems that ENV["PATH"] is nil according to error message that you are receiving. It&#8217;s quite strange as it should return your Windows PATH environment variable value. Can you try to run jirb and see what ENV["PATH"] returns?</p>
<p>One workaround would be that before requiring ruby_plsql you put:<br />
ENV["PATH"] ||= &#8220;&#8221;<br />
which will initialize ENV["PATH"] to empty string if it is nil.</p>
<p>Also in this case please copy ojdbc14.jar (Oracle JDBC driver) in %JRUBY_HOME%/lib directory. ruby_plsql is trying at first to find ojdbc14.jar in PATH but if it cannot find it then it should be located in lib directory under JRuby installation.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James Good</title>
		<link>http://blog.rayapps.com/2008/03/15/ruby-plsql-gem-simple-ruby-api-for-plsql-procedures/#comment-415</link>
		<dc:creator>James Good</dc:creator>
		<pubDate>Wed, 11 Mar 2009 21:10:48 +0000</pubDate>
		<guid isPermaLink="false">http://rayapps.wordpress.com/?p=21#comment-415</guid>
		<description>Thank you raimonds. However, my problem is that error message &quot;private method &#039;split&#039; called for nil:NilClass on line 36 of ruby_plsql.rb

It seems to be that the ENV[&quot;PATH&quot;] is returning nil. I wonder why that is- my jruby/bin directory is in my path.

Any ideas? Could it be a windows specific problem?

-James</description>
		<content:encoded><![CDATA[<p>Thank you raimonds. However, my problem is that error message &#8220;private method &#8217;split&#8217; called for nil:NilClass on line 36 of ruby_plsql.rb</p>
<p>It seems to be that the ENV["PATH"] is returning nil. I wonder why that is- my jruby/bin directory is in my path.</p>
<p>Any ideas? Could it be a windows specific problem?</p>
<p>-James</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Raimonds Simanovskis</title>
		<link>http://blog.rayapps.com/2008/03/15/ruby-plsql-gem-simple-ruby-api-for-plsql-procedures/#comment-414</link>
		<dc:creator>Raimonds Simanovskis</dc:creator>
		<pubDate>Tue, 10 Mar 2009 20:37:41 +0000</pubDate>
		<guid isPermaLink="false">http://rayapps.wordpress.com/?p=21#comment-414</guid>
		<description>If you use JRuby and Rails then you need to initialize connection in the following way:

plsql.connection = ActiveRecord::Base.connection.raw_connection.connection

In next release I am going to make it simpler to specify that you want to use ActiveRecord connection, I know that current way looks too complex :)

BTW I also recommend to put this initialization either in environment.rb or event better in some special initializer file in config/initializers directory. It is not a good practice to put such initialization code in one particular controller.</description>
		<content:encoded><![CDATA[<p>If you use JRuby and Rails then you need to initialize connection in the following way:</p>
<p>plsql.connection = ActiveRecord::Base.connection.raw_connection.connection</p>
<p>In next release I am going to make it simpler to specify that you want to use ActiveRecord connection, I know that current way looks too complex :)</p>
<p>BTW I also recommend to put this initialization either in environment.rb or event better in some special initializer file in config/initializers directory. It is not a good practice to put such initialization code in one particular controller.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
