Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import psycopg2
- import sys
- udid = input("UDID: ")
- def get_emplid(udid):
- conn_db = psycopg2.connect(dbname=, host=, sslmode='require', user=, password=)
- curs = conn_db.cursor()
- curs.execute("select emplid from emplid_to_alphaname where alphaname = (%s);", (udid,))
- row = curs.fetchone()
- if row == None:
- sys.exit("Could not locate Employee ID for {}".format(udid))
- db_emplid = row[0]
- conn_db.close()
- return db_emplid
- def add_user_to_db():
- db_emplid = get_emplid
- db_emplid = db_emplid
- print(db_emplid)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement