Guest User

Untitled

a guest
Mar 2nd, 2018
295
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. require 'pg'
  2. begin
  3. con=PG.connect :dbname => 'postgres', :user => 'postgres', :password =>'root'
  4.  
  5. con.exec "Drop table if exists Guest"
  6. con.exec "Create table Guest (Name VARCHAR(20),email VARCHAR(50),mobile int(10),member(10))"
  7. con.exec "Insert into Guest Values('yash','yash@gmail.com',25662,12)"
  8.  
  9. rescue PG:Error =>e
  10. puts e.message
  11. ensure
  12. con.close if con
  13. end
Add Comment
Please, Sign In to add comment