Forums | Admin

Discussion Forums: help

Start New Thread Start New Thread

 

By: Andy Koch
RE: Nil column type encountered. [ reply ]  
2007-03-13 18:16
Upon further investigation, this looks like a possible bug in FireRuby.

The offending column is a Varchar(2000), when this field had an empty string "" then this Nil column type error was reported. However, when I changed all the empty strings to NULL the error went away and the column type was correctly ascertained by FireRuby.

By: Andy Koch
Nil column type encountered. [ reply ]  
2007-03-13 17:44
I'm wondering if this error is indicative of a bad Firebird database.

My code is...

rows = cxn.execute_immediate(SELECT_SQL)
rows.each do |row|
i = 0
row.each do |col, val|
printf "%-14s = %-40s\n", row.get_base_type(i), val

My result is...

INTEGER = 3940
VARCHAR = pcdrsysinfoserialport
INTEGER = 0
=
SMALLINT = 0
SMALLINT = 0

As shown, this column type shows as nil. However, it only affects a subset of rows within the table.

I've tracked this to the code in FireRuby...

from Row.c line 142

if(TYPE(rb_ary_entry(items, 1)) == T_NIL)
{
fprintf(stderr, "Nil column type encountered.\n");
}

Any idea on how I could fix this?

Thanks to anyone whose listening : )