I am trying to write this Snowflake query into Java code:
copy into s3://snowflake171
from USER_TABLE
storage_integration = s3_int
file_format = CSV_TEST;
I am writing it like this:
String q ="COPY INTO s3://snowflake171\n" +
" FROM \"TEST\".\"PUBLIC\".\"USER_TABLE\"WHERE\"ID\\\"=?\"\n" +
" storage_integration = s3_int\n" +
" file_format = CSV_TEST";
But I am getting this error:
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [COPY INTO s3://snowflake171
FROM "TEST"."PUBLIC"."USER_TABLE"WHERE"ID\"=?"
storage_integration = s3_int
file_format = CSV_TEST]; nested exception is net.snowflake.client.jdbc.SnowflakeSQLException: SQL compilation error:
syntax error line 1 at position 5 unexpected '<EOF>'.
What am I missing?
INTObutINOT. Please check your code.WHERE"ID\"=?"- you're missing the parameter here. Also, the query seems to miss the semi-colon at the end: I'd say it should be" file_format = CSV_TEST;";SQL access control error: Insufficient privileges to operate on integration 'S3_INT'