FAQ
I need to call a function stored in Postgres which does a lot of the db
and calculation work
all the SQL queries are hardcoded in a file called cmi.py. What i need
to do is too to call
my function from postgres passing in my product_code variable into it
and returning the
value from the query into a variable i can print to screen as part of a
HTML page.

I am sure its very easy but have never done anything in python as have
none of the guys
i work with making this a bit of a problem.

Cheers Guys
David

Search Discussions

  • Colin Gillespie at May 3, 2006 at 9:40 am
    A quick google for "Python CGI" gives you lots of links. But if you
    intend to do much in the way of cgi, then I would recommend the spyce
    framework,http://spyce.sourceforge.net/

    HTH

    Colin


    Fuzzydave wrote:
    I need to call a function stored in Postgres which does a lot of the db
    and calculation work
    all the SQL queries are hardcoded in a file called cmi.py. What i need
    to do is too to call
    my function from postgres passing in my product_code variable into it
    and returning the
    value from the query into a variable i can print to screen as part of a
    HTML page.

    I am sure its very easy but have never done anything in python as have
    none of the guys
    i work with making this a bit of a problem.

    Cheers Guys
    David
  • Fuzzydave at May 3, 2006 at 10:04 am
    I did do a google search i have looking through the one python book i
    have
    and there are plenty of references for how to write a function in
    Python but
    not as many on how to call a function stored in postgres using python I
    have
    tried the conn.execute(cmi_grn_cost(productCode)) and also the
    conn.callproc(cmi_grn_cost(productCode)) commands where conn is the
    connection object and cmi_grn_cost() is the the function getting called
    from
    Postgres and productCode is the variable to passed.
  • Fuzzydave at May 4, 2006 at 2:26 pm
    cheers :)

    thats what i wanted to know :)

    David

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedMay 3, '06 at 9:30a
activeMay 4, '06 at 2:26p
posts4
users2
websitepython.org

2 users in discussion

Fuzzydave: 3 posts Colin Gillespie: 1 post

People

Translate

site design / logo © 2022 Grokbase