From: Damjan Rems Date: 2007-09-20T14:55:29+09:00 Subject: Re: how can I connect ruby with postgreSQL Vellingiri Arul wrote: > > Dear Friends, > how can I connect ruby with postgreSQL. > Please give some procedure. > how can I install the proper packages and what are the configurations I > am going to made. > what are the steps I have to follow that's what all I want. > > by > Vellingiri Google for "ruby DBI" Examples: dbh = DBI.connect('DBI:Pg:mydb', 'user', 'pwd') rs = dbh.select_all("select * from table where id = '#{someID}'") dbh.do("update table set num=#{n} where id='#{someID}'") sth = dbh.prepare("INSERT INTO table (v1,v2,v3,v4) VALUES(?, ?, ?, ?)") sth.execute('a', 'b', 'c', d) by TheR -- Posted via http://www.ruby-forum.com/.