Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def call_pgsl_function(function_name, arg):
- conn = psycopg2.connect(
- "dbname=dname user=user password=pass host=host”)
- cur = conn.cursor()
- cur.callproc(function_name, arg)
- result_set = cur.fetchall()
- try:
- for x in result_set:
- return x
- except Exception as e:
- print(“Something went wrong [{}]”.format(str(e))
- finally:
- if cur is not None:
- cur.close()
- def match_function_skills_job(profile_id):
- try:
- res = call_pgsl_function('match_function_skills_job', [profile_id])
- return res
- except:
- return 0.0
Add Comment
Please, Sign In to add comment