# JDBC Logstash Plugin issue

**URL:** <https://discuss.elastic.co/t/jdbc-logstash-plugin-issue/283224>\
**Category:** Logstash\
**Created:** [September 2, 2021, 11:13pm UTC](https://discuss.elastic.co/t/jdbc-logstash-plugin-issue/283224 "2021-09-02T23:13:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![valleram](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/valleram/32/48248_2.png) [@valleram](https://discuss.elastic.co/u/valleram)\
**Post date:** [September 2, 2021, 11:13pm UTC](https://discuss.elastic.co/t/jdbc-logstash-plugin-issue/283224/1 "2021-09-02T23:13:31Z")

</div>

Hi All,

I'm trying to impletement a Logstash pipeline using the JDBC plugin to fetch events from an Oracle database, but I'm receiving following errors.

```auto
Java::JavaSql::SQLSyntaxErrorException: ORA-00936: missing expression:

```

Pipeline input configuration:

```auto
input {
        jdbc {
          jdbc_driver_library => "/usr/share/logstash/ojdbc6.jar"
          jdbc_driver_class => "Java::oracle.jdbc.driver.OracleDriver"
          jdbc_connection_string => "jdbc:oracle:thin:@...."
          jdbc_user => "...."
          jdbc_password => "...."         
          statement => "SELECT
                      '230' AS "plantCode",
                      TRIM(CycleCountingLine.t$item)AS "itemCode",
                      TRIM(GeneralItemData.t$dsca) AS "itemDesc",
                      CycleCounting.t$cwar AS "Warehouse",
                      '' AS "tmlArea",
                      to_char(new_time(CycleCountingLine.t$trdt,'GMT','CST'),'YYYY-MM-DD HH24:MI:SS') AS "Timestamp",
                      to_char(new_time(CycleCountingLine.t$cdat,'GMT','CST'),'YYYY-MM-DD HH24:MI:SS') AS "creationDate",
                      DECODE(CycleCounting.t$otyp,1,'Cycle Counting',2,'Adjustment') AS "orderType",
                      'Inventory Adjustment' AS "transactionType",
                      CycleCounting.t$orno AS "Order",
                      CASE 
                        WHEN CycleCountingLine.t$vstk > 0 THEN 'POSITIVE'
                        ELSE 'NEGATIVE'
                      END AS "Signal",  
                      ABS(CycleCountingLine.t$vstk) AS "absoluteQty",
                      CycleCountingLine.t$vstk AS "Qty",
                      CycleCountingLine.t$cstk AS "qtyAfterTransaction",
                      '' AS "Type",
                      ItemCostingData.t$ecpr$1 AS "unValueUSD",
                      CycleCountingLine.t$vstk * ItemCostingData.t$ecpr$1 AS "totalValueUSD",
                      ItemCostingData.t$ccur AS "currencyType",
                      ItemWarehousingData.t$abcc AS "abcCode",
                      UserData.t$user AS "userName",
                      CycleCounting.t$recd AS "reasonCode",
                      Reasons.t$dsca AS "reasonCodeDesc",
                      '' AS "Comments",
                      'mycity' AS "destCityName",
                      'mycode' AS "destCityCode",
                      'MX' AS "destCountry",
                      '23.346482 -131.31342' AS "destLocation"

                    FROM
                      bn.twh550391 CycleCounting,
                      bn.twh551391 CycleCountingLine,
                      bn.ttcd001391 GeneralItemData,
                      bn.ttcd007391 ItemCostingData,
                      bn.twmd400391 ItemWarehousingData,
                      bn.ttcm001391 Employees,
                      bn.tttd200000 UserData,
                      bn.ttcs005391 Reasons

                    WHERE
                      CycleCounting.t$orno = CycleCountingLine.t$orno
                      AND CycleCountingLine.t$item = GeneralItemData.t$item
                      AND CycleCountingLine.t$item = ItemCostingData.t$item
                      AND CycleCountingLine.t$item = ItemWarehousingData.t$item
                      AND CycleCounting.t$emno = Employees.t$emno
                      AND TRIM(Employees.t$nama) = TRIM(UserData.t$name)
                      AND CycleCounting.t$recd = Reasons.t$cdis"
        }
      }

```

Can someone please help me on this.

thank you

---

<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:** [September 2, 2021, 11:19pm UTC](https://discuss.elastic.co/t/jdbc-logstash-plugin-issue/283224/2 "2021-09-02T23:19:23Z")

</div>

I find it hard to believe it gets that far. There are many strings surrounded by double quotes inside your statement, which is a double quoted string. The configuration compiler should be blowing up around

```
plantCode",

```

Escape them, use single quotes if SQL allows it, or put the statement in a file and reference that.

---

<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:** [September 30, 2021, 11:20pm UTC](https://discuss.elastic.co/t/jdbc-logstash-plugin-issue/283224/3 "2021-09-30T23:20:24Z")

</div>

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