Execute SQL Server Stored Procedures - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: Data Science (https://python-forum.io/forum-44.html) +--- Thread: Execute SQL Server Stored Procedures (/thread-28595.html) |
Execute SQL Server Stored Procedures - eslamerman - Jul-25-2020 Hi, I would like to execute the below statment using python on sql server. The statment is working on sql sqerver. But when i tried to execute as sql from python it fails. Any idea how to run in directly?!
RE: Execute SQL Server Stored Procedures - Larz60+ - Jul-25-2020 please show python code, and where it fails. RE: Execute SQL Server Stored Procedures - elenaflorence87 - Jul-25-2020 @eslamerman the programme structure is mistake. here im sharing brief explaination about execution SQl once look into this , i feel this will helps you. https://docs.microsoft.com/en-us/sql/relational-databases/stored-procedures/execute-a-stored-procedure?view=sql-server-ver15 RE: Execute SQL Server Stored Procedures - eslamerman - Jul-26-2020 (Jul-25-2020, 02:07 PM)Larz60+ Wrote: please show python code, and where it fails.I don't have a python code. I want to know how to execute this using python. When I execute it from SSMS, it returns a result. RE: Execute SQL Server Stored Procedures - vikramprabhu - Oct-21-2020 I am trying to read OUT Parameter from an Oracle Stored Procedure which is an array. Oracle Stored Proc: create or replace PROCEDURE PRC_LV_FASTREPORT_RPT (v_start_date IN DATE, v_end_date IN DATE,l_nt OUT LV_FASTREPORT_RPT_tab) Python Call: --- cur = conn.cursor() args = (date_from.__format__('%d-%b-%Y'),date_to.__format__('%d-%b-%Y'), 0) result_args = cur.callproc('PRC_LV_FASTREPORT_RPT', args) ---- Error I get: wrong number or types of arguments in call to 'PRC_LV_FASTREPORT_RPT' --- Can you please let me know if I am doing anything wrong? Is it the right way to read an Array Output from Stored Proc? Thank you, - VP |