From sommer at salem.edu Thu Jan 18 15:08:48 2007 From: sommer at salem.edu (Adam Sommer) Date: Thu, 18 Jan 2007 15:08:48 -0500 Subject: [Ruby-informix-misc] Hello Message-ID: <45AFD3D0.8040004@salem.edu> Hi all, I just wanted to say thanks and let you know the updated site looks cool. Maybe it's been there awhile and I just haven't seen it...heh. Adam From gerardo.santana at gmail.com Thu Jan 18 23:51:47 2007 From: gerardo.santana at gmail.com (=?ISO-8859-1?Q?Gerardo_Santana_G=F3mez_Garrido?=) Date: Thu, 18 Jan 2007 22:51:47 -0600 Subject: [Ruby-informix-misc] Hello In-Reply-To: <45AFD3D0.8040004@salem.edu> References: <45AFD3D0.8040004@salem.edu> Message-ID: 2007/1/18, Adam Sommer : > Hi all, > > I just wanted to say thanks and let you know the updated site looks > cool. Maybe it's been there awhile and I just haven't seen it...heh. > > Adam Hello Adam, Thanks for your comments! Your feedback is very welcome. It's good to know Ruby/Informix is useful to you. Stay around to see new things comming to Ruby/Informix. Regards, -- Gerardo Santana From gerardo.santana at gmail.com Fri Jan 19 10:55:14 2007 From: gerardo.santana at gmail.com (=?ISO-8859-1?Q?Gerardo_Santana_G=F3mez_Garrido?=) Date: Fri, 19 Jan 2007 09:55:14 -0600 Subject: [Ruby-informix-misc] directions Message-ID: Thanks to Edwin Fine, Ruby/Informix 0.6.0 will incorporate a test suite, more diagnostic information on errors and other improvements. Don't hesitate to send your feature requests, comments, bug reports, etc. For instance, I've been requested to deprecate Database#do in favor of Database#execute as an alias for Database#immediate. I'm not sure about it yet so I'd like to hear what you think. -- Gerardo Santana From sommer at salem.edu Fri Jan 19 12:08:44 2007 From: sommer at salem.edu (Adam Sommer) Date: Fri, 19 Jan 2007 12:08:44 -0500 Subject: [Ruby-informix-misc] directions In-Reply-To: References: Message-ID: <45B0FB1C.8010105@salem.edu> I guess my question is how do other DB's implement it? Also, what's the thinking behind changing? Either way though it's not a big deal to me. Gerardo Santana G?mez Garrido wrote: > Thanks to Edwin Fine, Ruby/Informix 0.6.0 will incorporate a test > suite, more diagnostic information on errors and other improvements. > > Don't hesitate to send your feature requests, comments, bug reports, etc. > > For instance, I've been requested to deprecate Database#do in favor of > Database#execute as an alias for Database#immediate. I'm not sure > about it yet so I'd like to hear what you think. > > -- Adam Sommer Linux Administrator Salem Academy and College 336-721-2810 From reidmo at gmail.com Fri Jan 19 14:58:48 2007 From: reidmo at gmail.com (Reid Morrison) Date: Fri, 19 Jan 2007 14:58:48 -0500 Subject: [Ruby-informix-misc] directions In-Reply-To: <45B0FB1C.8010105@salem.edu> References: <45B0FB1C.8010105@salem.edu> Message-ID: <000001c73c04$3cbc0800$0501a8c0@Sidekick> >From a Ruby perspective, using Database#do could cause confusion with the ruby keyword 'do' used when calling a block. E.g. Informix.connect('mydb') do |db| db.do('update sql') end Informix.connect('mydb') do |db| db.execute('update sql') end If someone familiar with Ruby, but unfamiliar with our code saw the two above examples, it is more clear what Database#execute does. I.e. execute this SQL against the connected database. It is important to maintain backward compatibility, so could Database#do just become an undocumented feature? Regards Reid Morrison http://rubywmq.rubyforge.org/ -----Original Message----- From: ruby-informix-misc-bounces at rubyforge.org [mailto:ruby-informix-misc-bounces at rubyforge.org] On Behalf Of Adam Sommer Sent: Friday, January 19, 2007 12:09 PM Cc: ruby-informix-misc at rubyforge.org Subject: Re: [Ruby-informix-misc] directions I guess my question is how do other DB's implement it? Also, what's the thinking behind changing? Either way though it's not a big deal to me. Gerardo Santana G?mez Garrido wrote: > Thanks to Edwin Fine, Ruby/Informix 0.6.0 will incorporate a test > suite, more diagnostic information on errors and other improvements. > > Don't hesitate to send your feature requests, comments, bug reports, etc. > > For instance, I've been requested to deprecate Database#do in favor of > Database#execute as an alias for Database#immediate. I'm not sure > about it yet so I'd like to hear what you think. > > -- Adam Sommer Linux Administrator Salem Academy and College 336-721-2810 _______________________________________________ Ruby-informix-misc mailing list Ruby-informix-misc at rubyforge.org http://rubyforge.org/mailman/listinfo/ruby-informix-misc From efine145-nospam01 at usa.net Fri Jan 19 15:22:11 2007 From: efine145-nospam01 at usa.net (Edwin Fine) Date: Fri, 19 Jan 2007 15:22:11 -0500 Subject: [Ruby-informix-misc] directions In-Reply-To: <000001c73c04$3cbc0800$0501a8c0@Sidekick> References: <45B0FB1C.8010105@salem.edu> <000001c73c04$3cbc0800$0501a8c0@Sidekick> Message-ID: <200701191522.11442.efine145-nospam01@usa.net> Here's my perspective. 1. do is a Ruby keyword. 2. Using a keyword as a method name confuses vim's syntax analysis (and my eyes). 3. I really don't like the method name "do". do what? execute at least implies it will execute some action. exec_sql would be extremely clear, as would run_sql. immediate would be better named exec_immediate (but that's verbose). "do" as a keyword is fine; it's part of the language. Now I know the VIM syntax analysis could be better, but my eyes are as good as they are gonna get ;-) So I say don't do "do" ;-> Ed On Friday 19 January 2007 14:58, Reid Morrison wrote: > >From a Ruby perspective, using Database#do could cause confusion with the > > ruby keyword 'do' used when calling a block. > > E.g. > > Informix.connect('mydb') do |db| > db.do('update sql') > end > > Informix.connect('mydb') do |db| > db.execute('update sql') > end > > If someone familiar with Ruby, but unfamiliar with our code saw the two > above examples, it is more clear what Database#execute does. > I.e. execute this SQL against the connected database. > > It is important to maintain backward compatibility, so could Database#do > just become an undocumented feature? > > Regards > Reid Morrison > http://rubywmq.rubyforge.org/ > > -----Original Message----- > From: ruby-informix-misc-bounces at rubyforge.org > [mailto:ruby-informix-misc-bounces at rubyforge.org] On Behalf Of Adam Sommer > Sent: Friday, January 19, 2007 12:09 PM > Cc: ruby-informix-misc at rubyforge.org > Subject: Re: [Ruby-informix-misc] directions > > I guess my question is how do other DB's implement it? Also, what's the > thinking behind changing? > > Either way though it's not a big deal to me. > > Gerardo Santana G?mez Garrido wrote: > > Thanks to Edwin Fine, Ruby/Informix 0.6.0 will incorporate a test > > suite, more diagnostic information on errors and other improvements. > > > > Don't hesitate to send your feature requests, comments, bug reports, etc. > > > > For instance, I've been requested to deprecate Database#do in favor of > > Database#execute as an alias for Database#immediate. I'm not sure > > about it yet so I'd like to hear what you think. -- -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (GNU/Linux) iD8DBQFFm2UVftc93okEoB4RAh5ZAKDLfyw8hfueMzJ/9wsL7tDvY2hgtACgp7st V7ByWWkN2UetGX6n989lTxA= =3omx -----END PGP SIGNATURE----- From reidmo at gmail.com Fri Jan 19 19:06:28 2007 From: reidmo at gmail.com (Reid Morrison) Date: Fri, 19 Jan 2007 19:06:28 -0500 Subject: [Ruby-informix-misc] Database#each Message-ID: <000101c73c26$d5f27910$0501a8c0@Sidekick> One of the "Ruby'isms" that we often use is the each method. Whenever we are going to iterate over a collection of items/results, each is commonly used in Ruby. To execute a SQL statement that does not return any result we could use the following code: Informix.connect('mydb') do |db| db.immediate('update ...') end To execute a SQL Select statement, we could use the following code: Informix.connect('mydb') do |db| Cursor.open(db,'select * from mytable') do |curs| curs.each {|row| p row} end end If we implemented Database#each, we could reduce it to the following: Informix.connect('mydb') do |db| db.each('select * from mytable') {|row| p row} end I have added the following code to my Ruby scripts to implement Database#each and Database#each_hash: module Informix class Database def each(query,options=nil,&block) Cursor.open(self,query,options) {|curs| curs.each(&block)} end def each_hash(query,options=nil,&block) Cursor.open(self,query,options) {|curs| curs.each_hash(&block)} end end end Thank you so much for each_hash, it has made changes so much easier! Regards Reid -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ruby-informix-misc/attachments/20070119/334ea435/attachment.html From gerardo.santana at gmail.com Fri Jan 19 21:11:45 2007 From: gerardo.santana at gmail.com (=?ISO-8859-1?Q?Gerardo_Santana_G=F3mez_Garrido?=) Date: Fri, 19 Jan 2007 20:11:45 -0600 Subject: [Ruby-informix-misc] Database#each In-Reply-To: <000101c73c26$d5f27910$0501a8c0@Sidekick> References: <000101c73c26$d5f27910$0501a8c0@Sidekick> Message-ID: 2007/1/19, Reid Morrison : > > > > > One of the "Ruby'isms" that we often use is the each method. Whenever we are > going to iterate over a collection of items/results, each is commonly used > in Ruby. > > > > To execute a SQL statement that does not return any result we could use the > following code: > > > > Informix.connect('mydb') do |db| > > db.immediate('update ?..') > > end > > > > To execute a SQL Select statement, we could use the following code: > > > > Informix.connect('mydb') do |db| > > Cursor.open(db,'select * from mytable') do |curs| > > curs.each {|row| p row} > > end > > end > > > > If we implemented Database#each, we could reduce it to the following: > > > > Informix.connect('mydb') do |db| > > db.each('select * from mytable') {|row| p row} > > end > > > > > > I have added the following code to my Ruby scripts to implement > Database#each and Database#each_hash: > > > > module Informix > > class Database > > > > def each(query,options=nil,&block) > > Cursor.open(self,query,options) {|curs| curs.each(&block)} > > end > > > > def each_hash(query,options=nil,&block) > > Cursor.open(self,query,options) {|curs| curs.each_hash(&block)} > > end > > > > end > > end > > > > Thank you so much for each_hash, it has made changes so much easier! Thank you! I was looking for an appropriate name for a shortcut method in Database for Cursor.open :-) -- Gerardo Santana From lipingwt at gmail.com Sun Jan 21 09:59:37 2007 From: lipingwt at gmail.com (Liping Wang Tsuzuki) Date: Sun, 21 Jan 2007 12:59:37 -0200 Subject: [Ruby-informix-misc] Problem in displaying an image using slob Message-ID: <5676e67d0701210659p608b1581pc0f22159275b5b34@mail.gmail.com> Hi All, I am having a problem with a very simple task. Display an image retrieved using a SQL query. I used rmagick just as example and it worked fine. I used the following code: * def generate_image canvas = Magick::ImageList.new("C:\DSC00812.JPG") code_image = canvas.to_blob{ self.format="JPG" } send_data(code_image, :type => 'image/jpeg', :disposition => 'inline', :filename => 'logoblob.jpg' ) end * I tried to modify the code to incorporate the ruby-informix, in this example I am reading the image from a file just for simplification. * def generate_image db = Informix.connect('tvsete') slob = Informix::Slob.new(db, Informix::Slob::BLOB) slob.write(File.read("C:\DSC00812.JPG")) slob.seek(0, Informix::Slob::SEEK_SET) canvas = Magick::ImageList.new canvas.from_blob(slob.read(slob.stat.size)) code_image = canvas.to_blob{ self.format="JPG" } send_data(code_image, :type => 'image/jpeg', :disposition => 'inline', :filename => 'logoblob.jpg' ) slob.close end* I am getting the following error: Magick::ImageMagickError (JPEG datastream contains no image `'): c:/ruby/lib/ruby/gems/1.8/gems/rmagick-1.14.1-win32/lib/RMagick.rb:1649:in `from_blob' c:/ruby/lib/ruby/gems/1.8/gems/rmagick-1.14.1-win32/lib/RMagick.rb:1649:in `from_blob' c:/ruby/lib/ruby/gems/1.8/gems/rmagick-1.14.1-win32/lib/RMagick.rb:1648:in `each' c:/ruby/lib/ruby/gems/1.8/gems/rmagick-1.14.1-win32/lib/RMagick.rb:1648:in `from_blob' I would like to thank Santana that send me some clues by e-mail. Marcos Tsuzuki -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ruby-informix-misc/attachments/20070121/16d82ae5/attachment.html From efine145-nospam01 at usa.net Sun Jan 21 11:44:49 2007 From: efine145-nospam01 at usa.net (Edwin Fine) Date: Sun, 21 Jan 2007 11:44:49 -0500 Subject: [Ruby-informix-misc] Problem in displaying an image using slob In-Reply-To: <5676e67d0701210659p608b1581pc0f22159275b5b34@mail.gmail.com> References: <5676e67d0701210659p608b1581pc0f22159275b5b34@mail.gmail.com> Message-ID: <200701211144.49619.efine145-nospam01@usa.net> On Sunday 21 January 2007 09:59, Liping Wang Tsuzuki wrote: > Hi All, > > I am having a problem with a very simple task. > Display an image retrieved using a SQL query. > > I used rmagick just as example and it worked fine. > I used the following code: > > * def generate_image > canvas = Magick::ImageList.new("C:\DSC00812.JPG") > code_image = canvas.to_blob{ > self.format="JPG" > } > send_data(code_image, :type => 'image/jpeg', :disposition => 'inline', > > :filename => 'logoblob.jpg' ) > > end > * > I tried to modify the code to incorporate the ruby-informix, in this > example I am reading > the image from a file just for simplification. > > * def generate_image > db = Informix.connect('tvsete') > slob = Informix::Slob.new(db, Informix::Slob::BLOB) > slob.write(File.read("C:\DSC00812.JPG")) > slob.seek(0, Informix::Slob::SEEK_SET) > canvas = Magick::ImageList.new > canvas.from_blob(slob.read(slob.stat.size)) > code_image = canvas.to_blob{ > self.format="JPG" > } > send_data(code_image, :type => 'image/jpeg', :disposition => 'inline', > > :filename => 'logoblob.jpg' ) > > slob.close > end* > > I am getting the following error: > > Magick::ImageMagickError (JPEG datastream contains no image `'): > > c:/ruby/lib/ruby/gems/1.8/gems/rmagick-1.14.1-win32/lib/RMagick.rb:1649:in > `from_blob' > > c:/ruby/lib/ruby/gems/1.8/gems/rmagick-1.14.1-win32/lib/RMagick.rb:1649:in > `from_blob' > > c:/ruby/lib/ruby/gems/1.8/gems/rmagick-1.14.1-win32/lib/RMagick.rb:1648:in > `each' > > c:/ruby/lib/ruby/gems/1.8/gems/rmagick-1.14.1-win32/lib/RMagick.rb:1648:in > `from_blob' > > > I would like to thank Santana that send me some clues by e-mail. > > Marcos Tsuzuki Marcos, I see a number of possible issues. First of all, it seems that you are doing this on Windows. Specifying a file on windows using backslashes as path separators is troublesome, so you should first change your program to use "C:/DSC00812.JPG" (or, if you like the ugliness, "C:\\DSC00812.JPG"). Secondly and more important, I don't think File.read is going to work properly. Because you are on Windows, you need to open the file in binary mode to read all of it in one go. I tried this with a JPG file of mine on Windows, and I'd like you to see the results: readjpg.rb: file_name = "G:/DSC00812.JPG" jpg = File::Stat.new file_name puts "Size of #{file_name} = #{jpg.size}" data = File.read(file_name) puts "Size of data read from #{file_name} = #{data.size}" file = File.new(file_name, "rb") # Open in binary mode data = file.read puts "Size of data read from #{file_name} in binary mode = #{data.size}" G:>ruby readjpg.rb Size of G:/DSC00812.JPG = 37068 Size of data read from G:/DSC00812.JPG = 3000 Size of data read from G:/DSC00812.JPG in binary mode = 37068 Could this be at least one problem? Regards, Edwin Fine From gerardo.santana at gmail.com Sun Jan 21 14:16:52 2007 From: gerardo.santana at gmail.com (=?ISO-8859-1?Q?Gerardo_Santana_G=F3mez_Garrido?=) Date: Sun, 21 Jan 2007 13:16:52 -0600 Subject: [Ruby-informix-misc] directions In-Reply-To: <200701191522.11442.efine145-nospam01@usa.net> References: <45B0FB1C.8010105@salem.edu> <000001c73c04$3cbc0800$0501a8c0@Sidekick> <200701191522.11442.efine145-nospam01@usa.net> Message-ID: Thank you everybody for your input. Your arguments seem reasonable to me. I agree with Reid about making #execute another alias for #immediate and leave #do, for backwards compatibility. P.S. FYI, Ruby/ODBC and Ruby/DBI use Database#do. 2007/1/19, Edwin Fine : > Here's my perspective. > > 1. do is a Ruby keyword. > 2. Using a keyword as a method name confuses vim's syntax analysis (and my > eyes). > 3. I really don't like the method name "do". do what? execute at least implies > it will execute some action. exec_sql would be extremely clear, as would > run_sql. immediate would be better named exec_immediate (but that's > verbose). "do" as a keyword is fine; it's part of the language. > > Now I know the VIM syntax analysis could be better, but my eyes are as good as > they are gonna get ;-) > > So I say don't do "do" ;-> > > Ed > > On Friday 19 January 2007 14:58, Reid Morrison wrote: > > >From a Ruby perspective, using Database#do could cause confusion with the > > > > ruby keyword 'do' used when calling a block. > > > > E.g. > > > > Informix.connect('mydb') do |db| > > db.do('update sql') > > end > > > > Informix.connect('mydb') do |db| > > db.execute('update sql') > > end > > > > If someone familiar with Ruby, but unfamiliar with our code saw the two > > above examples, it is more clear what Database#execute does. > > I.e. execute this SQL against the connected database. > > > > It is important to maintain backward compatibility, so could Database#do > > just become an undocumented feature? > > > > Regards > > Reid Morrison > > http://rubywmq.rubyforge.org/ > > > > -----Original Message----- > > From: ruby-informix-misc-bounces at rubyforge.org > > [mailto:ruby-informix-misc-bounces at rubyforge.org] On Behalf Of Adam Sommer > > Sent: Friday, January 19, 2007 12:09 PM > > Cc: ruby-informix-misc at rubyforge.org > > Subject: Re: [Ruby-informix-misc] directions > > > > I guess my question is how do other DB's implement it? Also, what's the > > thinking behind changing? > > > > Either way though it's not a big deal to me. > > > > Gerardo Santana G?mez Garrido wrote: > > > Thanks to Edwin Fine, Ruby/Informix 0.6.0 will incorporate a test > > > suite, more diagnostic information on errors and other improvements. > > > > > > Don't hesitate to send your feature requests, comments, bug reports, etc. > > > > > > For instance, I've been requested to deprecate Database#do in favor of > > > Database#execute as an alias for Database#immediate. I'm not sure > > > about it yet so I'd like to hear what you think. > > -- > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.3 (GNU/Linux) > > iD8DBQFFm2UVftc93okEoB4RAh5ZAKDLfyw8hfueMzJ/9wsL7tDvY2hgtACgp7st > V7ByWWkN2UetGX6n989lTxA= > =3omx > -----END PGP SIGNATURE----- > _______________________________________________ > Ruby-informix-misc mailing list > Ruby-informix-misc at rubyforge.org > http://rubyforge.org/mailman/listinfo/ruby-informix-misc > -- Gerardo Santana "Between individuals, as between nations, respect for the rights of others is peace" - Don Benito Ju?rez http://santanatechnotes.blogspot.com/ From gerardo.santana at gmail.com Sun Jan 21 14:44:59 2007 From: gerardo.santana at gmail.com (=?ISO-8859-1?Q?Gerardo_Santana_G=F3mez_Garrido?=) Date: Sun, 21 Jan 2007 13:44:59 -0600 Subject: [Ruby-informix-misc] Problem in displaying an image using slob In-Reply-To: <5676e67d0701210659p608b1581pc0f22159275b5b34@mail.gmail.com> References: <5676e67d0701210659p608b1581pc0f22159275b5b34@mail.gmail.com> Message-ID: 2007/1/21, Liping Wang Tsuzuki : > Hi All, Hello Liping, > > I am having a problem with a very simple task. > Display an image retrieved using a SQL query. I believe Edwin Fine already answered correctly to your question. Just let me tell you a pair of things you may want to know for making your code more readable. -- Gerardo Santana From gerardo.santana at gmail.com Sun Jan 21 14:58:36 2007 From: gerardo.santana at gmail.com (=?ISO-8859-1?Q?Gerardo_Santana_G=F3mez_Garrido?=) Date: Sun, 21 Jan 2007 13:58:36 -0600 Subject: [Ruby-informix-misc] Problem in displaying an image using slob In-Reply-To: References: <5676e67d0701210659p608b1581pc0f22159275b5b34@mail.gmail.com> Message-ID: 2007/1/21, Gerardo Santana G?mez Garrido : > 2007/1/21, Liping Wang Tsuzuki : > > Hi All, > > Hello Liping, > > > > > I am having a problem with a very simple task. > > Display an image retrieved using a SQL query. > > I believe Edwin Fine already answered correctly to your question. Just > let me tell you a pair of things you may want to know for making your > code more readable. Somehow I hit "Send" before finishing the message... You can change: slob = Informix::Slob.new(db, Informix::Slob::BLOB) for slob = db.slob(Informix::Slob::BLOB) You can change: slob.seek(0, Informix::Slob::SEEK_SET) for slob.rewind I wrote a sample code for you with #seek before (which is correct though), my bad. You can change: canvas.from_blob(slob.read(slob.stat.size)) for canvas.from_blob(slob.read(slob.size)) # no stat here. The previous one is correct, but the new one is shorter and faster. My bad here too, from the same sample code. You'll need Ruby/Informix 0.5.0. And beware that you're making a new connection everytime generate_image is called, and you're not closing it. You may want to use a block for autodisconnecting and autoclosing the SLOB: Informix.connect('tvsete') do |db| # do something with db: db.slob(Informix::Slob::BLOB) do |slob| # do something with slob: end # closes slob end # closes connection Regards, -- Gerardo Santana From lipingwt at gmail.com Sun Jan 21 15:51:37 2007 From: lipingwt at gmail.com (Liping Wang Tsuzuki) Date: Sun, 21 Jan 2007 18:51:37 -0200 Subject: [Ruby-informix-misc] Problem in displaying an image using slob In-Reply-To: References: <5676e67d0701210659p608b1581pc0f22159275b5b34@mail.gmail.com> Message-ID: <5676e67d0701211251l7d9ca2a1l13ffa974bfbfa40c@mail.gmail.com> Edwin and Gerardo, Too many thanks! It worked perfectly! Marcos Tsuzuki 2007/1/21, Gerardo Santana G?mez Garrido : > > 2007/1/21, Gerardo Santana G?mez Garrido : > > 2007/1/21, Liping Wang Tsuzuki : > > > Hi All, > > > > Hello Liping, > > > > > > > > I am having a problem with a very simple task. > > > Display an image retrieved using a SQL query. > > > > I believe Edwin Fine already answered correctly to your question. Just > > let me tell you a pair of things you may want to know for making your > > code more readable. > > Somehow I hit "Send" before finishing the message... > > You can change: > slob = Informix::Slob.new(db, Informix::Slob::BLOB) > > for > slob = db.slob(Informix::Slob::BLOB) > > > You can change: > slob.seek(0, Informix::Slob::SEEK_SET) > > for > slob.rewind > > I wrote a sample code for you with #seek before (which is correct > though), my bad. > > You can change: > canvas.from_blob(slob.read(slob.stat.size)) > > for > canvas.from_blob(slob.read(slob.size)) # no stat here. > > The previous one is correct, but the new one is shorter and faster. My > bad here too, from the same sample code. > > You'll need Ruby/Informix 0.5.0. > > And beware that you're making a new connection everytime > generate_image is called, and you're not closing it. You may want to > use a block for autodisconnecting and autoclosing the SLOB: > > Informix.connect('tvsete') do |db| # do something with db: > db.slob(Informix::Slob::BLOB) do |slob| > # do something with slob: > end # closes slob > end # closes connection > > Regards, > -- > Gerardo Santana > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ruby-informix-misc/attachments/20070121/285eb998/attachment.html From lipingwt at gmail.com Fri Jan 26 14:57:20 2007 From: lipingwt at gmail.com (Marcos Tsuzuki) Date: Fri, 26 Jan 2007 17:57:20 -0200 Subject: [Ruby-informix-misc] Using lld_locator Message-ID: <5676e67d0701261157m5c6bd83bx254ef0d37fb72cea@mail.gmail.com> Hi All, I thank you all for solving the previous problem with displaying an image in the html page. Now, I would like to ask another question: I am using regularly the lld_locator data type to store images in the database. It is possible to use it with you developed driver? To retrieve images one can use *casting lld_locator(field_name).lo_pointer::blob* What means that the query can be modified and return a usual blob. I would like to know if it is necessary to modify the informix driver to accept this possibility, or is it possible to adjust just in the ruby language? Besides, I do not know how it is possible to insert or update an image to the database using the lld_locator directly. I would like to know if you have examples about this kind of problem. Sincerely yours, Marcos Tsuzuki -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ruby-informix-misc/attachments/20070126/e0b74e53/attachment-0001.html From sommer at salem.edu Mon Jan 29 12:55:51 2007 From: sommer at salem.edu (Adam Sommer) Date: Mon, 29 Jan 2007 12:55:51 -0500 Subject: [Ruby-informix-misc] Gentoo Install Instructions Message-ID: <45BE3527.5010708@salem.edu> Hello, I posted some instructions to the Gentoo forums on how to get the Informix clientsdk to work on Gentoo: http://forums.gentoo.org/viewtopic.php?t=245249 It's not mentioned in the post, but after I was able to get the clientsdk to install on Gentoo following the ruby-informix install instructions worked as advertised. I just thought I'd mention it in case you wanted to update the platforms that ruby-informix works on. Thanks, -- Adam Sommer Linux Administrator Salem Academy and College 336-721-2810