Forums | Admin

Discussion Forums: help

Start New Thread Start New Thread
Message: 95548
BY: Kubo Takehiro (kubo)
DATE: 2010-12-19 05:27
SUBJECT: RE: Exception with DATE columns in Oracle 11g

 

1. Does the following script work for you? It works fine for me.

-----------------------
gem 'ruby-oci8'
require 'oci8'

conn = OCI8.new 'ruby/oci8' # Change This Line!
puts "Client Version: #{OCI8.oracle_client_version}"
puts "Server Version: #{conn.oracle_server_version}"
puts "ENV['TZ'] : #{ENV['TZ']}"

conn.exec 'drop table test_date purge' rescue nil
conn.exec 'create table test_date (dt date)'
conn.exec 'insert into test_date values (sysdate)'
conn.commit

print 'before alter session: '
p conn.select_one 'select * from test_date' rescue p $!

conn.exec "alter session set time_zone = 'US/Eastern'"

print 'after alter session: '
p conn.select_one 'select * from test_date' rescue p $!

conn.logoff
-----------------------

2. Could you change ext/ocidatetime.c near line 122 as follows and test again? I want to know the error message of OCIDateTimeGetTimeZoneOffset.

-----------------------
rv = OCIDateTimeGetTimeZoneOffset(oci8_envhp, oci8_errhp, dttm, &tz_hour, &tz_minute);
if (rv != OCI_SUCCESS) oci8_raise(oci8_errhp, rv, NULL); /* ADD THIS LINE. */
have_tz = (rv == OCI_SUCCESS);
-----------------------


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