有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

如何用Java编写SQL查询从Snowflake获取数据

我正在尝试将这个雪花查询写入Java代码:

copy into s3://snowflake171
  from USER_TABLE
  storage_integration = s3_int
  file_format = CSV_TEST;

我是这样写的:

 String q ="COPY INTO s3://snowflake171\n" +
                    "  FROM \"TEST\".\"PUBLIC\".\"USER_TABLE\"WHERE\"ID\\\"=?\"\n" +
                    "  storage_integration = s3_int\n" +
                    "  file_format = CSV_TEST";

但我有一个错误:

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>'.

我错过了什么


共 (0) 个答案