gosnowflake icon indicating copy to clipboard operation
gosnowflake copied to clipboard

too many errors like "no RowsAffected available after DDL statement"

Open xoba opened this issue 5 years ago • 2 comments

when i execute ddl statements, such as create database ..., i get this error on executing RowsAffected() method on the result, but why? how about just returning zero (0) rows and a nil error?

even for a statement like copy into ... from @..., which actually does some work, requiring a running warehouse too, it still returns with the dreaded "no RowsAffected available after DDL statement" error on executing RowsAffected() method, doesn't even seem like a ddl statement to me?

basically i'm saying, would be great if RowsAffected() method didn't return so many errors. would that be possible or is there something in the go/sql spec that requires this behaviour?

thanks!

xoba avatar Mar 23 '19 09:03 xoba

For DDL statement, returning the no RowsAffected error is in the standard controlled by https://golang.org/src/database/sql/driver/driver.go [line 484].

For COPY command you are right. It is a DML statement and should not throw this error.

ChTimTsubasa avatar Apr 08 '19 22:04 ChTimTsubasa

As of today, COPY command doesn't return the affected number of rows. This requires the server side change.

smtakeda avatar Sep 30 '19 21:09 smtakeda

To clean up and re-prioritize more pressing bugs and feature requests we are closing all issues older than 6 months as of April 1, 2023. If there are any issues or feature requests that you would like us to address, please create them according to the new templates we have created. For urgent issues, opening a support case with this link Snowflake Community is the fastest way to get a response.

sfc-gh-igarish avatar Mar 30 '23 01:03 sfc-gh-igarish