diff --git a/dinky-core/src/main/java/org/dinky/explainer/print_table/PrintStatementExplainer.java b/dinky-core/src/main/java/org/dinky/explainer/print_table/PrintStatementExplainer.java index 627ce6278a..ee3000b55e 100644 --- a/dinky-core/src/main/java/org/dinky/explainer/print_table/PrintStatementExplainer.java +++ b/dinky-core/src/main/java/org/dinky/explainer/print_table/PrintStatementExplainer.java @@ -36,9 +36,10 @@ public class PrintStatementExplainer { public static final String PATTERN_STR = "PRINT (.+)"; public static final Pattern PATTERN = Pattern.compile(PATTERN_STR, Pattern.CASE_INSENSITIVE); - public static final String CREATE_SQL_TEMPLATE = "CREATE TABLE print_{0} WITH (''connector'' = ''printnet'', " - + "''port''=''{2,number,#}'', ''hostName'' = ''{1}'')\n" - + "AS SELECT * FROM {0}"; + public static final String CREATE_SQL_TEMPLATE = + "CREATE TABLE IF NOT EXISTS print_{0} WITH (''connector'' = ''printnet'', " + + "''port''=''{2,number,#}'', ''hostName'' = ''{1}'')\n" + + "AS SELECT * FROM {0}"; public static final int DEFAULT_PORT = 7125; public static String[] getTableNames(String statement) {