This is another error received during the creation of a Ruby script that parses data from a couple Excel CSV files into arrays and then inserts certain data into PostgreSQL based on various criteria. The entire error is below.
Full Ruby Error:
[web@dev atp]$ ruby alldevices.rb
/usr/local/lib/ruby/gems/1.8/gems/postgres-pr-0.4.0/lib/postgres-pr/connection.rb:115:in `query': ERROR C22P02 Minvalid input syntax for integer: "" Fnumutils.c L54 Rpg_atoi (RuntimeError)
from /usr/local/lib/ruby/gems/1.8/gems/postgres-pr-0.4.0/lib/postgres-pr/postgres-compat.rb:33:in `exec'
from alldevices.rb:41
from alldevices.rb:39:in `each'
from alldevices.rb:39
from alldevices.rb:38:in `each'
from alldevices.rb:38
I am sure this has to do with the way the data is formatted inside the Postgres INSERT statement but I am not sire specifically what needs to change. Right now I have the number wrapped in double quotes via the Ruby script parsing the CSV file that is getting added to a PSQL field that has a type of integer.
Should I be using single quotes or no quotes at all?