由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
_Python版 - run SQL stored procedure from python (转载)
相关主题
get value returned by SQLstored procedure from python (转载)get value returned by SQLstored procedure from python (转载)
create table on SQL server from python pyodbc (转载)SQL debug step into a store procedure from another one (转载)
pypyodbc error access netezza SQL server on win7 (转载)如何让SQL 2005 CLR Trigger返回结果给Stored Procedure用?
run SQL stored procedure from python (转载)请问怎样找到StoredProcedures的修改记录?
run SQL stored procedure from python (转载)德州招SQL Developer
run SQL stored procedure from pythonSQL debug step into a store procedure from another one (转载)
get value returned by SQLstored procedure from pythonSQL debug step into a store procedure from another one (转载)
get value returned by SQLstored procedure from python (转载)create table on SQL server from python pyodbc (转载)
相关话题的讨论汇总
话题: sql话题: my话题: procedure话题: run话题: dbo
1 (共1页)
l******9
发帖数: 579
1
【 以下文字转载自 Database 讨论区 】
发信人: light009 (light009), 信区: Database
标 题: run SQL stored procedure from python
发信站: BBS 未名空间站 (Sat Aug 2 20:53:01 2014, 美东)
I need to run a SQL server 2008 R2 stored procedure from Eclipse pydev with
python 3.2 on win 7. If I run the stored procedure from management studio,
it works well.
But, if I run it from ptython , it does not work.
sql_str_test = """
DELETE FROM [my_db].[dbo].[my_table] -- this line works
EXEC [my_db].[dbo].[my_store_procedure] -- but this line
does not work, no run-time error message, but no results generated
"""
sql_str_connect = "DRIVER={SQL server};SERVER={my_server};DATABASE={my_db};
UID=my_id;PWD=my_table"
cnxn = pyodbc.connect(sql_str_connect)
cursor_test = cnxn.cursor()
cursor_test.execute(sql_str_test)
cnxn.commit()
If I run
DELETE FROM [my_db].[dbo].[my_table]
EXEC [my_db].[dbo].[my_store_procedure]
from SSMS, it works.
Thanks
1 (共1页)
相关主题
create table on SQL server from python pyodbc (转载)run SQL stored procedure from python (转载)
pypyodbc error access netezza SQL server on win7 (转载)run SQL stored procedure from python
DSN-less connection to SQL serverget value returned by SQLstored procedure from python
问一个db2的弱问题get value returned by SQLstored procedure from python (转载)
get value returned by SQLstored procedure from python (转载)get value returned by SQLstored procedure from python (转载)
create table on SQL server from python pyodbc (转载)SQL debug step into a store procedure from another one (转载)
pypyodbc error access netezza SQL server on win7 (转载)如何让SQL 2005 CLR Trigger返回结果给Stored Procedure用?
run SQL stored procedure from python (转载)请问怎样找到StoredProcedures的修改记录?
相关话题的讨论汇总
话题: sql话题: my话题: procedure话题: run话题: dbo