Forums | Admin

Discussion Forums: help

Start New Thread Start New Thread
Message: 95565
BY: Brian Ploetz (bploetz)
DATE: 2010-12-20 14:00
SUBJECT: RE: Exception with DATE columns in Oracle 11g

 

Hi Kubo,

The script fails for me with the same error I was seeing in my app. Here's the result:


$ gem list

*** LOCAL GEMS ***

bundler (1.0.7)
rake (0.8.7)
ruby-oci8 (2.0.4)

$ ruby -v
ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-linux]

$ irb
ruby-1.9.2-p0 > gem 'ruby-oci8'
=> true
ruby-1.9.2-p0 > require 'oci8'
=> true
ruby-1.9.2-p0 > conn = OCI8.new "XXX", "XXX", "XXX"
=> #<OCI8:XXX>
ruby-1.9.2-p0 > puts "Client Version: #{OCI8.oracle_client_version}"
Client Version: 11.2.0.2.0
=> nil
ruby-1.9.2-p0 > puts "Server Version: #{conn.oracle_server_version}"
Server Version: 11.2.0.1.0
=> nil
ruby-1.9.2-p0 > puts "ENV['TZ'] : #{ENV['TZ']}"
ENV['TZ'] :
=> nil
ruby-1.9.2-p0 > conn.exec 'drop table test_date purge' rescue nil
=> nil
ruby-1.9.2-p0 > conn.exec 'create table test_date (dt date)'
=> 0
ruby-1.9.2-p0 > conn.exec 'insert into test_date values (sysdate)'
=> 1
ruby-1.9.2-p0 > conn.commit
=> #<OCI8:XXX>
ruby-1.9.2-p0 > print 'before alter session: '
before alter session: => nil
ruby-1.9.2-p0 > p conn.select_one 'select * from test_date' rescue p $!
[2010-12-20 07:47:47 -0600]
=> [2010-12-20 07:47:47 -0600]
ruby-1.9.2-p0 > conn.exec "alter session set time_zone = 'US/Eastern'"
=> 0
ruby-1.9.2-p0 > print 'after alter session: '
after alter session: => nil
ruby-1.9.2-p0 > p conn.select_one 'select * from test_date' rescue p $!
#<NoMethodError: undefined method `*' for nil:NilClass>
=> #<NoMethodError: undefined method `*' for nil:NilClass>
ruby-1.9.2-p0 > conn.logoff
=> true


I can't easily change that C file and re-compile unfortunately, as I don't have control over the server. I'll see if I can get our sysadmin to do that.....


Thread View

Thread Author Date
Exception with DATE columns in Oracle 11gBrian Ploetz2010-12-14 23:39
      RE: Exception with DATE columns in Oracle 11gKubo Takehiro2010-12-19 05:27
            RE: Exception with DATE columns in Oracle 11gBrian Ploetz2010-12-20 14:00
                  RE: Exception with DATE columns in Oracle 11gKubo Takehiro2010-12-21 13:44
                        RE: Exception with DATE columns in Oracle 11gWiehann Matthysen2011-05-27 10:53
                              RE: Exception with DATE columns in Oracle 11gKubo Takehiro2011-06-05 22:34
                                    RE: Exception with DATE columns in Oracle 11gKubo Takehiro2011-06-08 03:58
                                          RE: Exception with DATE columns in Oracle 11gWiehann Matthysen2011-06-08 12:14
                                                RE: Exception with DATE columns in Oracle 11gKubo Takehiro2012-01-29 00:00

Post a followup to this message