3

I success configure with yours advices. With a simple line of sql, it's run.

But with multiline SQL, it's not run.

What is it the sql syntax with multiline?

"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"
      }

And the error is :

{    "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...

It's parse at line break.

d0lur1g
  • 43
  • 4
  • for get query from batch file try [sqlcmd](https://msdn.microsoft.com/en-us/library/ms180944.aspx) or [invoke-sqlcmd](https://msdn.microsoft.com/en-us/library/cc281720.aspx) – Soheil Apr 17 '15 at 15:22

1 Answers1

0

It works. In fact, I put everything on a single line. That does not like the indentation.

Thanks!

d0lur1g
  • 43
  • 4