# Error when do sql query from table name with special character

**URL:** <https://discuss.elastic.co/t/error-when-do-sql-query-from-table-name-with-special-character/193383>\
**Category:** Elasticsearch\
**Created:** [August 1, 2019, 6:04pm UTC](https://discuss.elastic.co/t/error-when-do-sql-query-from-table-name-with-special-character/193383 "2019-08-01T18:04:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jasmineL](https://avatars.discourse-cdn.com/v4/letter/j/8797f3/32.png) [@jasmineL](https://discuss.elastic.co/u/jasmineL)\
**Post date:** [August 1, 2019, 6:04pm UTC](https://discuss.elastic.co/t/error-when-do-sql-query-from-table-name-with-special-character/193383/1 "2019-08-01T18:04:31Z")

</div>

I am on Kibana and Elasticsearch 6.8. And I am trying to use sql from dev tools. Our tables name are all like 'stores.us\_returnattempt' which contains some special characters like . or \_. I got below error.

```auto
  "error": {
    "root_cause": [
      {
        "type": "parsing_exception",
        "reason": "line 1:27: extraneous input '.' expecting {<EOF>, ',', 'ANALYZE', 'ANALYZED', 'AS', 'CATALOGS', 'COLUMNS', 'CURRENT_DATE', 'CURRENT_TIMESTAMP', 'DAY', 'DEBUG', 'EXECUTABLE', 'EXPLAIN', 'FIRST', 'FORMAT', 'FULL', 'FUNCTIONS', 'GRAPHVIZ', 'GROUP', 'HAVING', 'HOUR', 'INNER', 'INTERVAL', 'JOIN', 'LAST', 'LEFT', 'LIMIT', 'MAPPED', 'MINUTE', 'MONTH', 'NATURAL', 'OPTIMIZED', 'ORDER', 'PARSED', 'PHYSICAL', 'PLAN', 'RIGHT', 'RLIKE', 'QUERY', 'SCHEMAS', 'SECOND', 'SHOW', 'SYS', 'TABLES', 'TEXT', 'TYPE', 'TYPES', 'VERIFY', 'WHERE', 'YEAR', '{LIMIT', IDENTIFIER, DIGIT_IDENTIFIER, QUOTED_IDENTIFIER, BACKQUOTED_IDENTIFIER}"
      }
    ],
    "type": "parsing_exception",
    "reason": "line 1:27: extraneous input '.' expecting {<EOF>, ',', 'ANALYZE', 'ANALYZED', 'AS', 'CATALOGS', 'COLUMNS', 'CURRENT_DATE', 'CURRENT_TIMESTAMP', 'DAY', 'DEBUG', 'EXECUTABLE', 'EXPLAIN', 'FIRST', 'FORMAT', 'FULL', 'FUNCTIONS', 'GRAPHVIZ', 'GROUP', 'HAVING', 'HOUR', 'INNER', 'INTERVAL', 'JOIN', 'LAST', 'LEFT', 'LIMIT', 'MAPPED', 'MINUTE', 'MONTH', 'NATURAL', 'OPTIMIZED', 'ORDER', 'PARSED', 'PHYSICAL', 'PLAN', 'RIGHT', 'RLIKE', 'QUERY', 'SCHEMAS', 'SECOND', 'SHOW', 'SYS', 'TABLES', 'TEXT', 'TYPE', 'TYPES', 'VERIFY', 'WHERE', 'YEAR', '{LIMIT', IDENTIFIER, DIGIT_IDENTIFIER, QUOTED_IDENTIFIER, BACKQUOTED_IDENTIFIER}"
  },
  "status": 400
}

```

How can I query index with '.' ? I even try wildcard like 'stores\*' and got similar error complaining about \*.

Is there anybody help me see what should I do?

Thanks!!

---

<div class="post-metadata">

**Author:** ![Andrei\_Stefan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrei_stefan/32/47533_2.png) [@Andrei\_Stefan](https://discuss.elastic.co/u/Andrei_Stefan)\
**Post date:** [August 2, 2019, 10:12am UTC](https://discuss.elastic.co/t/error-when-do-sql-query-from-table-name-with-special-character/193383/2 "2019-08-02T10:12:05Z")

</div>

@jasmineL you simply need to place your index name inside double quotes. More about this [here in the docs](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/sql-lexical-structure.html#sql-syntax-single-vs-double-quotes).

---

<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:** [August 30, 2019, 10:12am UTC](https://discuss.elastic.co/t/error-when-do-sql-query-from-table-name-with-special-character/193383/3 "2019-08-30T10:12:10Z")

</div>

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