- Notifications
You must be signed in to change notification settings - Fork83
[question] - How to get write operation details back#133
-
Hi All, When I run a INSERT / DELETE / COPY operation in my IDE I get back the number of row affected. (see picture below) How can I retrieve the same information with this driver as well? Thanks, |
BetaWas this translation helpful?Give feedback.
All reactions
Replies: 1 comment 1 reply
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Hey@andormarkus , you should be able to retrieve this information, |
BetaWas this translation helpful?Give feedback.
All reactions
-
I tried to execute the following command and I got the following error. sql="""COPY "stg"."dim_wfm"FROM 's3://bucket'IAM_ROLE '<arn>'CSV DATEFORMAT AS 'YYYY-MM-DD HH:MI:SS'TIMEFORMAT AS 'YYYY-MM-DD HH:MI:SS'IGNOREHEADER 1;"""redshift=helper.RedshiftHandler(secret_name=args.RedshiftSecret).connect()redshift.cursor.execute(sql)resp=redshift.cursor.fetchone()print(resp) 2022-09-27 20:09:23 INFO Getting Connection Info2022-09-27 20:09:23 INFO Secret is: REDSHIFT_SECRET2022-09-27 20:09:23 INFO Found credentials from IAM Role: SSMInstanceProfile2022-09-27 20:09:23 INFO Connecting to Redshift: redshift.amazonaws.com2022-09-27 20:09:23 INFO Successfully Connected to ClusterTraceback (most recent call last): File"/home/ec2-user/.virtualenvs/lib/python3.9/site-packages/redshift_connector/cursor.py", line 487,in __next__returnself._cached_rows.popleft()IndexError: pop from an empty dequeDuring handling of the above exception, another exception occurred:Traceback (most recent call last): File"/tmp/pycharm_project_230/glue_jobs/etl/extract_test.py", line 48,in<module> resp =redshift.cursor.fetchone() File"/home/ec2-user/.virtualenvs/lib/python3.9/site-packages/redshift_connector/cursor.py", line 402,in fetchonereturn next(self) File"/home/ec2-user/.virtualenvs/lib/python3.9/site-packages/redshift_connector/cursor.py", line 492,in __next__ raise ProgrammingError("no result set")redshift_connector.error.ProgrammingError: no resultsetProcess finished withexit code 1 |
BetaWas this translation helpful?Give feedback.
