 |
Forums |
Admin Discussion Forums: help Start New Thread
By: Gerardo Santana Gómez Garrido
RE: Informix Connection Problem [ reply ] 2008-05-06 19:47
|
After applying the patch, and assuming you're in ruby-informix/ext, do:
ruby extconf.rb
make
that will create informixc.so. Use this file to replace the installed one.
It should be located under $RUBYDIR/gems/1.8/gems/ruby-informix where RUBYDIR may be /usr/local/lib/ruby in Unix and Unix-like OS or probably C:\ruby in Windows.
By the way, there's also a mailing list, ruby-informix-misc at rubyforge.org. You can also contact me directly by e-mail.
Here's the patch:
diff --git a/ext/informixc.ec b/ext/informixc.ec
index af4497e..c14f7f8 100644
--- a/ext/informixc.ec
+++ b/ext/informixc.ec
@@ -58,7 +58,7 @@ static ID s_add_info, s_from_months, s_from_seconds;
static ID s_add, s_mul;
static VALUE sym_name, sym_type, sym_nullable, sym_stype, sym_length;
-static VALUE sym_precision, sym_scale, sym_default, sym_xid;
+static VALUE sym_precision, sym_scale, sym_default;
static VALUE sym_scroll, sym_hold;
static VALUE sym_col_info, sym_sbspace, sym_estbytes, sym_extsz;
static VALUE sym_createflags, sym_openflags, sym_maxbytes;
@@ -2233,7 +2233,7 @@ rb_database_columns(VALUE self, VALUE tablename)
EXEC SQL begin declare section;
char *did, *cid;
char *tabname;
- int tabid, xid;
+ int tabid;
varchar colname[129];
short coltype, collength;
char deftype[2];
@@ -2262,7 +2262,7 @@ rb_database_columns(VALUE self, VALUE tablename)
raise_ifx_extended();
for(;;) {
- EXEC SQL fetch :cid into :colname, :coltype, :collength, :xid,
+ EXEC SQL fetch :cid into :colname, :coltype, :collength,
:deftype, :defvalue;
if (SQLCODE < 0)
raise_ifx_extended();
@@ -2274,7 +2274,6 @@ rb_database_columns(VALUE self, VALUE tablename)
rb_hash_aset(column, sym_name, rb_str_new2(colname));
rb_hash_aset(column, sym_type, INT2FIX(coltype));
rb_hash_aset(column, sym_nullable, coltype&0x100? Qfalse: Qtrue);
- rb_hash_aset(column, sym_xid, INT2FIX(xid));
if ((coltype&0xFF) < 23) {
stype = coltype == 4118? stypes[23]: stypes[coltype&0xFF];
@@ -3410,7 +3409,6 @@ void Init_informixc(void)
sym_precision = ID2SYM(rb_intern("precision"));
sym_scale = ID2SYM(rb_intern("scale"));
sym_default = ID2SYM(rb_intern("default"));
- sym_xid = ID2SYM(rb_intern("xid"));
sym_scroll = ID2SYM(rb_intern("scroll"));
sym_hold = ID2SYM(rb_intern("hold"));
|
By: Bambang Sumitra
RE: Informix Connection Problem [ reply ] 2008-05-06 06:25
|
thank you, for your quick response
i cannot upgrade informix, because this is production system.
could you send me the patch first.
what should i do when i receive the patch? should i compile ruby-informix my self?
thanks
|
By: Gerardo Santana Gómez Garrido
RE: Informix Connection Problem [ reply ] 2008-05-06 04:55
|
Hi Bambang,
I'm afraid that particular Informix version/flavor doesn't have an extended_id column in the syscolumns table. When you establish a connection to a database, a query is prepared for extracting information about the columns of a table, which includes the extended id.
I'm already asking in the Informix mailing list about the Informix versions/flavors that support extended_id, to be more precise on what Informix version/flavor is supported by Ruby/Informix.
Right now, the options are
a) upgrade to another Informix version. Probably Informix 7.x OnLine would be enough, but I'm verifying it.
b) patch Ruby/Informix to remove extended_id. It implies removing references to xid in rb_database_columns and extended_id from rb_database_initialize.
I can send you the patch, or build the binary for you. Alternatively, you may verify if your Informix server can be upgraded.
Whatever you decide, please let me know.
|
By: Bambang Sumitra
Informix Connection Problem [ reply ] 2008-05-06 03:59
|
hi,
i'am testing connection to informix database from ruby but have a problem, here is my environment
client :
- MS windows XP SP2
- IBM informix CSDK ver. 2.81
- Ruby 1.8.6
- Ruby-informix 0.7.1
- IP 192.168.2.17
server :
- Linux Redhat 8.0
- INFORMIX-SE 7.24.UC5
- IP = 192.168.2.1
ruby source code :
require 'informix'
db = Informix.connect('/usr/database/db@se_mal', 'admin', 'password')
error message :
C:/ruby/lib/ruby/gems/1.8/gems/ruby-informix-0.7.1-i386-mswin32/lib/informix.rb:101:in `initialize': Column (extended_id) not found in any table in the query (or SLV is undefined). (Informix::DatabaseError)
from C:/ruby/lib/ruby/gems/1.8/gems/ruby-informix-0.7.1-i386-mswin32/lib/informix.rb:101:in `new'
from C:/ruby/lib/ruby/gems/1.8/gems/ruby-informix-0.7.1-i386-mswin32/lib/informix.rb:101:in `open'
from C:/ruby/lib/ruby/gems/1.8/gems/ruby-informix-0.7.1-i386-mswin32/lib/informix.rb:58:in `connect'
from C:/Documents and Settings/mis/My Documents/test.rb:3
Complete(1)
Note :
i have using Informix CSDK within powerbuilder with no problem
|
|
 |