1

Using python, how to connect to netezza database.

Since PIP install is not working in my corporate network. I can't import pyodbc and jaydebeapi. Please suggest is there any way to connect netezza database and fetch data from table.

2 Answers 2

2
  1. Install nzpy https://pypi.org/project/nzpy/

  2. Install pandas https://pypi.org/project/pandas/

  3. Use connection to Netezza to fill pandas' DataFrame using read_sql function

    import nzpy
    import pandas as pd
    
    conn = nzpy.connect(user="admin", password="password", host='localhost', port=5480, database="db1", securityLevel=1, logLevel=0)
    df = pd.read_sql('SELECT * FROM some_table', conn)
    

Voila.

Sign up to request clarification or add additional context in comments.

Comments

0

Unfortunately your hands are basically tied. If you don't have the means to "speak" to the database (JDBC/ODBC) then there's really nothing you can do.

Perhaps you could elaborate as to why your pip application isn't working and try to get that solved?

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.