# Logstash 6.2.1 Oracle JDBC plugin invalid character in query

**URL:** <https://discuss.elastic.co/t/logstash-6-2-1-oracle-jdbc-plugin-invalid-character-in-query/127668>\
**Category:** Logstash\
**Created:** [April 11, 2018, 3:48pm UTC](https://discuss.elastic.co/t/logstash-6-2-1-oracle-jdbc-plugin-invalid-character-in-query/127668 "2018-04-11T15:48:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mauro\_Julian\_Fernand](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mauro_julian_fernand/32/79805_2.png) [@Mauro\_Julian\_Fernand](https://discuss.elastic.co/u/Mauro_Julian_Fernand)\
**Post date:** [April 11, 2018, 3:48pm UTC](https://discuss.elastic.co/t/logstash-6-2-1-oracle-jdbc-plugin-invalid-character-in-query/127668/1 "2018-04-11T15:48:46Z")

</div>

I'm trying to fetch data from an Oracle database using this query but I'm constantly getting an `Java::JavaSql::SQLSyntaxErrorException: ORA-00911: invalid character` error:

```
statement => "select * from SYS.AUD$_ARCH where to_date('01-01-18', 'dd-MM-yy') > ntimestamp#;"

```

I tried escaping the table name but I still get the error (also the # in the column name and the \>):

```
statement => "select * from SYS.AUD\$_ARCH where to_date('01-01-18', 'dd-MM-yy') > ntimestamp#;"

```

Using `statement_filepath` also raises the same error.

This is my locale output `locale`

```
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

```

Thanks.

---

<div class="post-metadata">

**Author:** ![Mauro\_Julian\_Fernand](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mauro_julian_fernand/32/79805_2.png) [@Mauro\_Julian\_Fernand](https://discuss.elastic.co/u/Mauro_Julian_Fernand)\
**Post date:** [April 11, 2018, 7:13pm UTC](https://discuss.elastic.co/t/logstash-6-2-1-oracle-jdbc-plugin-invalid-character-in-query/127668/2 "2018-04-11T19:13:17Z")

</div>

Solved it by using a lowercase table name `sys.aud$_arch`.

`statement => "select * from sys.aud$_arch where to_date('01-01-18', 'dd-MM-yy') > ntimestamp#"`

---

<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:** [May 9, 2018, 7:13pm UTC](https://discuss.elastic.co/t/logstash-6-2-1-oracle-jdbc-plugin-invalid-character-in-query/127668/3 "2018-05-09T19:13:18Z")

</div>

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