Python Forum
python call stored procedure
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
python call stored procedure
#1
Hi Team,

Need help how to call stored procedure via python.

I am using pyodbc libarary.

query = """EXEC[DBS_database].[dbo].[sp_Recon] 'Table1','database1'"""

Cursor.execute(query)  its not working. **wall** 
for row in cursor.fetchall():
	print(row)
Larz60+ write Oct-17-2022, 01:56 PM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.

Fixed for you this time. Please use BBCode tags on future posts.
Reply
#2
Questions:
  1. Which DBMS are you using?
  2. Your query looks like a candidate for SQL injection attack.
Reply
#3
Hi Team,

my stored procedure is working now. I will share the code soon.

Actually issue was in stored procedure output was not written.



Thanks
mg
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to capture the result set from a stored procedure? dee 5 390 May-25-2024, 01:03 AM
Last Post: deanhystad
  python script is hanging while calling a procedure in database prasanthi417 4 751 Jan-17-2024, 02:33 PM
Last Post: deanhystad
  python call stored procedure with two parameter mg24 4 1,804 Sep-27-2022, 05:02 AM
Last Post: deanhystad
  capture print statement written in Stored Procedure in SQL Server brijeshkumar_77 0 2,672 Feb-18-2020, 03:22 AM
Last Post: brijeshkumar_77
  Execute SQL Server Stored Procedure brijeshkumar_77 0 3,220 Feb-18-2020, 02:59 AM
Last Post: brijeshkumar_77
  Call pip3 from python folder build by me call pip3 from the /usr/bin Suryavarman 3 3,835 Oct-07-2019, 10:23 PM
Last Post: Suryavarman
  What do you think of this procedure to create a path to a folder atlass218 10 6,713 Sep-06-2019, 07:53 AM
Last Post: atlass218
  How to return value from a stored procedure of a MySQL database? UtiliseIT 0 2,409 Jul-22-2019, 10:14 AM
Last Post: UtiliseIT
  Add a stored procedure with variable using MySQL Connector UtiliseIT 0 2,357 May-04-2019, 12:46 PM
Last Post: UtiliseIT
  Unable to use sqlanydb to execute Sybase IQ Stored Procedure FORTITUDE 4 3,932 Sep-15-2018, 05:03 PM
Last Post: FORTITUDE

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020