This content has been marked as final. Show 7 replies
I test retrieving date from a db Date field on my Rails application with Oracle 10g XE, it works well without any problem. Could you give more information about your environment? That should include db version, ruby-oci8 version and so on.
And another thing you have to know is that, the sequence used by Oracle adapter to generate "ID" starts from number "10000" by default. So in most case, you can't directly use MyModel.find(1) to find the first record in the database table, unless you are quite sure that there is row with ID "1". Please check your db table, find an existed row's ID number, and try using that number to find the record again.
LimLian.. thankyou for the reply.
My Oracle Version:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi
PL/SQL Release 10.2.0.3.0 - Production
CORE 10.2.0.3.0 Production
TNS for Linux: Version 10.2.0.3.0 - Production
NLSRTL Version 10.2.0.3.0 - Production
Sorry, the .find(1) was just an example.
The query generated was:
SELECT * FROM project_milestones WHERE (project_milestones.id = '0001017408770802')
The result .yaml was:
The only oci8 version I could find was from a class in /site_ruby/1.8/oci8.rb ..
VERSION = '1.0.0-rc3'
CLIENT_VERSION = '1020'
Also from irb:
irb(main:040:0>bla = OCI8.new('username', 'password', 'database')
irb(main):041:0>bla.exec('select * from project_milestones where rown
um < 11') do |r| puts r.join(','); end
0001017793NRP-ENVIR,0001017793,NRP-ENVIR,0007/09/19 00:00:00,0007/09/19 00:00:00
0001016321NRP-GDHLTH,0001016321,NRP-GDHLTH,0007/09/19 00:00:00,0007/09/19 00:00:
What's the result if you use sqlplus to do the query? If the result is correct, there should be nothing wrong with your database. Then you have to report your problem on ruby-oci8's project website,http://rubyforge.org/projects/ruby-oci8/. Or you can contact ruby-oci8's author KUBO directly.
Message was edited by:
Cheers... i'll put up a post in OCI8 :)
Non default date format may be defined.
Please refer the answer to this problem by Kubo