python - Not sure why my Stored Procedure isn't working between pyodbc and SQL Server -
python - Not sure why my Stored Procedure isn't working between pyodbc and SQL Server -
i'm pretty new python (2.7) , not lot of help pyodbc. have script calls stored procedure:
sql = "exec gen_all.dbo.rpt_trinity_total '" + startdate + "', '" + enddate + "'" print sql dbcursor.execute(sql) rows = dbcursor.fetchall() row in rows: print row[0], row[1]
at end of stored procedure returned dates passed in, create sure sp getting called @ parameters getting set. looks should working, when @ table supposed populated sp, nil in there. if run sp in management console, works fine.
i tried found solution here, namely:
dbcursor.execute("{call gen_all.dbo.rpt_trinity_total(?,?)}", (startdate),(enddate))
but gave me same results, nothing. sp simple, truncate , insert, using select, based on dates passed.
just wonder if give insight on this. bunch.
i suspect issue did not commit on connection. pyodbc
disables auto-commit default meet python db api specs. seek setting conn.autocommit = true
or phone call conn.commit()
on connection.
python sql-server-2008 pyodbc
Comments
Post a Comment