Permalink
Browse files

playing

  • Loading branch information...
prefork committed Apr 15, 2012
1 parent 90e73df commit 1a8135fce39fa150a858a9e083e9180d607f385e
Showing with 23 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. 0 Gemfile
  3. +22 −0 find_people.rb
View
@@ -0,0 +1 @@
+db.rb
View
No changes.
View
@@ -0,0 +1,22 @@
+require 'pg'
+require './db'
+
+connection = PG::Connection.new(:host => @dbhost, :port => @dbport, :user => @dbuser, :password => @dbpass, :dbname => @dbname)
+fml_names = Array.new
+single_field_names = Array.new
+
+def conn
+ @connection = @connection || PG::Connection.new(:host => @dbhost, :port => @dbport, :user => @dbuser, :password => @dbpass, :dbname => @dbname)
+ return connection
+end
+
+def a1cand
+ res = @connection.exec('SELECT "Candidate Last Name", "Candidate First Name", "Candidate Middle Initial" FROM FORMA1CAND')
+ res.each do |row|
+ if(res['Candidate First Name'] && res['Candidate Last Name'])
+ names.push ({:fname => res['Candidate First Name'].strip, :lname => res['Candidate Last Name'].strip, :mname => res["Candidate Middle Initial"].strip})
+ end
+ end
+end
+
+

0 comments on commit 1a8135f

Please sign in to comment.