3

我成功配置了您的建议。用一行简单的sql,就运行起来了。

但是对于多行 SQL,它不会运行。

多行的 sql 语法是什么?

"jdbc" : {
        "url" : "url",
        "user" : "user",
        "password" : "password",
        "sql" :  "SELECT MBugs.id AS _id,
                MProjects.name AS Projet,
                MCategory.name AS Categorie,
                MBugs.summary AS Resume,
                CASE MBugs.status
                WHEN 90 THEN 'Fermé'",
                FROM mantis_bug_table MBugs
                INNER JOIN mantis_project_table MProjects ON MBugs.project_id = MProjects.id
                INNER JOIN mantis_user_table MUsers ON MBugs.reporter_id = MUsers.id
                INNER JOIN mantis_category_table MCategory ON MBugs.category_id = MCategory.id
                LEFT OUTER JOIN mantis_user_table MUsers2 ON MBugs.handler_id = MUsers2.id
                WHERE
                MBugs.project_id > 1100
                ORDER BY MProjects.name, MBugs.severity, MBugs.priority DESC"
        "treat_binary_as_string" : true,
        "index" : "yrdy",
        "type" : "feeder_test"
      }

错误是:

{    "elasticsearch" : {         "cluster" : "elasticsearch",         "host" : "localhost",         "port" : 9300,         "type" : "jdbc",         "schedule" : "0 0-59 0-23 ? * *"    },    "jdbc" : {        "url" : "jdbc:mysql://******************",        "user" : "user",        "password" : "user",        "sql" : "SELECT MBugs.id AS _id,
'MProjects.name' is not recognized as an internal or external command,
operable program or batch file.
'MCategory.name' is not recognized as an internal or external command,
operable program or batch file.
'MBugs.summary' is not recognized as an internal or external command,
operable program or batch file.
'CASE' is not recognized as an internal or external command,
operable program or batch file.
'WHEN' is not recognized as an internal or external command,

etc...

它在换行符处解析。

4

1 回答 1

0

有用。事实上,我把所有东西都放在了一行上。那不喜欢缩进。

谢谢!

于 2015-04-20T10:10:43.153 回答