# JDBC plugin: Doesn’t work when select the table name is a number

**URL:** <https://discuss.elastic.co/t/jdbc-plugin-doesn-t-work-when-select-the-table-name-is-a-number/224636>\
**Category:** Logstash\
**Created:** [March 23, 2020, 9:50am UTC](https://discuss.elastic.co/t/jdbc-plugin-doesn-t-work-when-select-the-table-name-is-a-number/224636 "2020-03-23T09:50:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![111207](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/111207/32/53801_2.png) [@111207](https://discuss.elastic.co/u/111207)\
**Post date:** [March 23, 2020, 9:50am UTC](https://discuss.elastic.co/t/jdbc-plugin-doesn-t-work-when-select-the-table-name-is-a-number/224636/1 "2020-03-23T09:50:32Z")

</div>

Hi Guy

I am using the JDBC plugin and connect to mysql database and I have multiple data table.  
The name of table is a number.When I run the logstash config have an error Syntax message:You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '1' at line 1: SELECT \* FROM 1

This is my pipeline:

```auto
input {
 jdbc {
   jdbc_driver_library => "C:\Users\nitikarnh\Downloads\logstash-7.6.1\bin\mysql-connector-java-8.0.19.jar"
   jdbc_driver_class => "com.mysql.jdbc.Driver"
   jdbc_connection_string => "jdbc:mysql://localhost:3306/temperature"
   jdbc_user => "infa"
   jdbc_password => "infa"
   schedule => "*/5 * * * * *"
   statement => "SELECT * FROM 1"
   type => "sensor_1"
 }
}

input {
 jdbc {
   jdbc_driver_library => "C:\Users\nitikarnh\Downloads\logstash-7.6.1\bin\mysql-connector-java-8.0.19.jar"
   jdbc_driver_class => "com.mysql.jdbc.Driver"
   jdbc_connection_string => "jdbc:mysql://localhost:3306/temperature"
   jdbc_user => "infa"
   jdbc_password => "infa"
   schedule => "*/5 * * * * *"
   statement => "SELECT * FROM 2"
   type => "sensor_2"
 }
}

output {
 elasticsearch {
   hosts => "http://localhost:5601/"
     index => "sensor"
     document_type => "%{type}" 
 }
 stdout { codec => rubydebug { metadata => true } }
  #stdout { codec => "rubydebug"}
}

```

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [March 23, 2020, 2:54pm UTC](https://discuss.elastic.co/t/jdbc-plugin-doesn-t-work-when-select-the-table-name-is-a-number/224636/2 "2020-03-23T14:54:53Z")

</div>

The [rules](https://mariadb.com/kb/en/identifier-names/) for MariaDB identifiers say numeric names must be quoted. ("Identifier names may begin with a numeral, but can't only contain numerals unless quoted")

---

<div class="post-metadata">

**Author:** ![111207](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/111207/32/53801_2.png) [@111207](https://discuss.elastic.co/u/111207)\
**Post date:** [March 24, 2020, 2:43am UTC](https://discuss.elastic.co/t/jdbc-plugin-doesn-t-work-when-select-the-table-name-is-a-number/224636/3 "2020-03-24T02:43:30Z")

</div>

I tried to config  
"SELECT \* FROM '1'" and  
'SELECT \* FROM "1"' .  
But It doesn't work. Can you show me with the example

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 21, 2020, 2:43am UTC](https://discuss.elastic.co/t/jdbc-plugin-doesn-t-work-when-select-the-table-name-is-a-number/224636/4 "2020-04-21T02:43:32Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
