hello,
I'm in the process of trying to write a python function that does a few simply operations and sorts one list via a column in a database. It works fine when I input test cases via IDLE but for somereason when I create the function in postgres it only gives me back empty strings
I think this part is the culprit. It works fine in IDLE but when I'm in postgres it only returns empty strings, even with the same test cases that were working in IDLE. So....my question is....is there a different way you must access the database from inside postgres in order for it to get the necessary columns?
thanks in advance guys.
I'm in the process of trying to write a python function that does a few simply operations and sorts one list via a column in a database. It works fine when I input test cases via IDLE but for somereason when I create the function in postgres it only gives me back empty strings
Code:
create or replace function sort_wafers(text[],text) returns text as '
import pgdb
def sort_wafers(wafers,run):
db = pgdb.connect( user="###",database="#",host="###")
c = db.cursor()
c.execute("SELECT wafers.name from wafers where wafers.run=\'%s\' order by wafers.num"%(run))
rb = c.fetchall()
........
........
I think this part is the culprit. It works fine in IDLE but when I'm in postgres it only returns empty strings, even with the same test cases that were working in IDLE. So....my question is....is there a different way you must access the database from inside postgres in order for it to get the necessary columns?
thanks in advance guys.