Python Forum
Passing parameters to SQL Server using pandas
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Passing parameters to SQL Server using pandas
#9
Hi parthi,

Thank you for the inputs.

Finally, found the solution for it. Have mentioned the solution for the folks who might face similar problem in future.

Problem statement: Connecting to IBM DB2 having OLE DB provider: IBM DB2 for I IBMDA400 OLE DB provider

driver='{iSeries Access ODBC Driver}' # Install this driver by contacting your local IT team
system='xx.x.xx.xx'
uid='Robot'
pwd='xxxxxxxx'

import pyodbc
import pandas as pd


ole_conn = pyodbc.connect(driver=driver,system=system,uid=uid,pwd=pwd)
ole_query= "your desired query"
ole_data = pd.read_sql_query(ole_query,con=ole_conn)
ole_data.head(5)
Reply


Messages In This Thread
RE: Passing parameters to SQL Server using pandas - by Ilangos - Jun-03-2019, 11:25 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Python Alteryx QS-Passing pandas dataframe column inside SQL query where condition sanky1990 0 786 Dec-04-2023, 09:48 PM
Last Post: sanky1990
  Passing parameters with arrays and array definitions michael_lwt 1 987 Jul-07-2022, 09:45 PM
Last Post: Larz60+
  How to take the tar backup files form remote server to local server sivareddy 0 1,954 Jul-14-2021, 01:32 PM
Last Post: sivareddy
  Fastest Method for Querying SQL Server with Python Pandas BuJayBelvin 7 7,057 Aug-02-2020, 06:21 PM
Last Post: jefsummers
  Passing parameters from C# to Python[for using in gensim] in Visual Studio 2017 ZoghbyAya 0 3,903 May-21-2018, 08:49 PM
Last Post: ZoghbyAya

Forum Jump:

User Panel Messages

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