Guest User

Untitled

a guest
Aug 4th, 2018
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. def call_pgsl_function(function_name, arg):
  2. conn = psycopg2.connect(
  3. "dbname=dname user=user password=pass host=host”)
  4. cur = conn.cursor()
  5. cur.callproc(function_name, arg)
  6. result_set = cur.fetchall()
  7. try:
  8. for x in result_set:
  9. return x
  10. except Exception as e:
  11. print(“Something went wrong [{}]”.format(str(e))
  12. finally:
  13. if cur is not None:
  14. cur.close()
  15.  
  16.  
  17.  
  18. def match_function_skills_job(profile_id):
  19. try:
  20. res = call_pgsl_function('match_function_skills_job', [profile_id])
  21. return res
  22. except:
  23. return 0.0
Add Comment
Please, Sign In to add comment