Hi Mary,

I'm Italian but I write the response in eglish (sorry for my poor 
english)...

Some time ago I had a problem like your under FireBird 1.5.x and 
FireRuby 0.4.1 just after a db restore.

The issue was with casting function on the rails firebird adapter the 
error was something like "cannot cast CAST(DECIMAL(0,0)"...

I remember that I was able to solve the problem on firebird_adapter.rb 
executing something like sql_query.gsub!("DECIMAL(0,0)", 
"DECIMAL(0,18)") before the returning row.

Hope it helps...
> mydb.fdb on windows firebird 2.0.3.12981
> step_1
> gbak.exe -v -t -user sysdba -password ****** 127.0.0.1/3050:D:\webdb
> \PROD\mydb..fdb D:\webdb\back\mydb.fbk
>
> on server linux firebird 2.1.2.18118
> step_2
> linux-server:# ftp mydb.fbk
> step_3
> linux-server:# gbak -c -v ... mydb.fbk mydb.fdb
>
> *******
> s.o.linux ubuntu server 9.0.4
> firebird version 2.1.2.18118
> rails 2.3.2
> ruby 1.8.7 patchlevel 72
> rake 0.8.5
> fb_adapter 0.5.8
> fb 0.5.9
> passenger 2.2.2
> nginx 0.6.36
>
> query from isql
> select sum(val_emessi) from g1_items where licence_id = 6 AND DATA >=
> '2009/01/02' AND DATA <= '2009/01/02'
>
> **** val_emessi => decimal(8,2) ***
> result => 2837.00 ....fine
>
> query from rails
>
> condizioni = "data >= '2009/01/02' and
>               data <= '2009/01/02' and
>               licence_id = 6"
>     @emessi = G1Item.sum('val_emessi', :conditions => condizioni)
>
> *[email protected] => BigDecimal****
>
> result => 283700.00 .... error
> idem for G1Item.find_by-sql("select sum(val_emessi as somma ........")
> result => 283700.00 .... error
> In windows
> activerecord-firebird-adapter (1.0.0.9250)
> fireruby (0.4.3)
> rails 2.3.2
> firebird version 2.0.3.12981
> works fine.
>
> .. idea?
> ciao
>   


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to