Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permission denied creating temp table in Netezza called python script #70

Open
Visalini323 opened this issue Dec 30, 2023 · 0 comments
Open

Comments

@Visalini323
Copy link

Getting the following error
1843, in execute
raise ProgrammingError(self.error)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
nzpy.core.ProgrammingError: ERROR: CREATE TEMP TABLE: permission denied.

while trying the below code
import nzpy
import pandas as pd

Database connection parameters

host = 'host'
port = 1234
user = 'user'
password = 'password'
database = 'DBBB'

SQL query

query1 = "DROP TABLE TEMPTABLE123 IF EXISTS;"
query2 = "CREATE TEMP TABLE TEMPTABLE123 AS SELECT s.div, s.div_name from DBBB..STORES s GROUP BY 1,2;"

Establish connection to Netezza database

with nzpy.connect(host=host, user=user, password=password, database=database, port=port, securityLevel=1,logLevel=0,) as conn:

Create a cursor object

cur = conn.cursor()

Execute the query

cur.execute(query1)
cur.execute(query2)

but with the same user , password able to create the temp table through DBeaver tool.
Able to run those 2 queies from the SQL editor of the DBeaver tool using same user name and credentials
Please suggest solution
thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant