how can i connet the postgersql with ruby

V

Vellingiri Arul

Dear friends,
Actually,I am having the lot of table in postgres.
But i need to access the table using the ruby.How could i access that
file.
how can i connet the postgersql with ruby.Plese any one tell to me.

by
vellingiri
 
V

Vellingiri Arul

Vellingiri said:
Dear friends,
Actually,I am having the lot of table in postgres.
But i need to access the table using the ruby.How could i access that
file.
how can i connet the postgersql with ruby.Plese any one tell to me.

by
vellingiri

Dear Friends,
As per my mail I myself took risk to findout the answers.
For example,
I am having the postgresql table,In that I am having lot of table.
I want to access the particular inforamtion.
How we could do?
solution is here:
require 'postgres'
conn=PGconn.connect("fountserver",5432,'','',"vellingiri","vellingiri","vellingiri")
res=conn.exec('select * from birthday')
res.each do |row|
row.each do |column|
print column
(20-column.length).times{print " "}
end
puts
end

Note:eek:ther than that If it is there anything please tell me .
by
vellingiri
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,269
Messages
2,571,348
Members
48,027
Latest member
Selena87T

Latest Threads

Top