Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'pg'
- begin
- con=PG.connect :dbname => 'postgres', :user => 'postgres', :password =>'root'
- con.exec "Drop table if exists Guest"
- con.exec "Create table Guest (Name VARCHAR(20),email VARCHAR(50),mobile int(10),member(10))"
- con.exec "Insert into Guest Values('yash','yash@gmail.com',25662,12)"
- rescue PG:Error =>e
- puts e.message
- ensure
- con.close if con
- end
Add Comment
Please, Sign In to add comment