由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Quant版 - run SQL stored procedure from python (转载)
相关主题
get value returned by SQLstored procedure from python (转载)有人用过matlab那个SSM toolbox么?
create table on SQL server from python pyodbcWALL STREET Record Bonus Season
SQL debug step into a store procedure from another one国内银行都这样吗?
error of access IBM Netteza database from C# in Visual Stud (转载)[合集] one interview question about coins
set up data mining model in SQl server 2008 win 7 (转载)[合集] 如果只是programmer也是经常加班的吗
SQL run a stored procedure by fetching from a cursor row by (转载)[合集] 想问个职业规划的问题~
keep group of values of SQL procedure in one table (转载)[合集] Front-Offce, Mid-Office and Back-Office区别在那?
这几个STL的问题[合集] ft.. Delete the earth question accidentally
相关话题的讨论汇总
话题: sql话题: my话题: procedure话题: run话题: dbo
进入Quant版参与讨论
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页)
进入Quant版参与讨论
相关主题
[合集] ft.. Delete the earth question accidentallyset up data mining model in SQl server 2008 win 7 (转载)
Help: learning SQLSQL run a stored procedure by fetching from a cursor row by (转载)
Why my replies disappeared on this BBSkeep group of values of SQL procedure in one table (转载)
金融工程程序大收集这几个STL的问题
get value returned by SQLstored procedure from python (转载)有人用过matlab那个SSM toolbox么?
create table on SQL server from python pyodbcWALL STREET Record Bonus Season
SQL debug step into a store procedure from another one国内银行都这样吗?
error of access IBM Netteza database from C# in Visual Stud (转载)[合集] one interview question about coins
相关话题的讨论汇总
话题: sql话题: my话题: procedure话题: run话题: dbo