procedure something like:

CREATE  PROCEDURE `NewProc`(IN `groupID_` int,OUT `CountParam_` int)
BEGIN
set @CountParam_ = (select count(1) FROM mytable WHERE GroupID=groupID_ );
END;


python:

counts =  bindparam('CountParam_',isoutparam=True,type_=Integer,value = 0)
connection = engine.raw_connection()
    try:
        cursor = connection.cursor()
        ss = cursor.callproc("QueryUsersByAuthorID", [user.groupID, counts])
        results = list(cursor.fetchall())
        print counts
        cursor.close()
        connection.commit()
    finally:
        connection.close()

why it always come out  0 for counts while results get the data?

is my way calling the procedure correct or something else.

ps. how to get the class obj results for the fetchall() other than tuple at 
now.



-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to