# Logstash 6.2 not able to execute oracle database procedures

**URL:** <https://discuss.elastic.co/t/logstash-6-2-not-able-to-execute-oracle-database-procedures/147049>\
**Category:** Logstash\
**Created:** [September 3, 2018, 10:33am UTC](https://discuss.elastic.co/t/logstash-6-2-not-able-to-execute-oracle-database-procedures/147049 "2018-09-03T10:33:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![raulk89](https://avatars.discourse-cdn.com/v4/letter/r/2bfe46/32.png) [@raulk89](https://discuss.elastic.co/u/raulk89)\
**Post date:** [September 3, 2018, 10:33am UTC](https://discuss.elastic.co/t/logstash-6-2-not-able-to-execute-oracle-database-procedures/147049/1 "2018-09-03T10:33:06Z")

</div>

Hi

Logstash 6.2  
Oracle database 12.1.0.2.0  
Using ojdbc6.jar drivers to connect to oracle database (have tried also ojdbc7.jar). Connection attempt succeeds with both drivers, since select statements run successfully, for example

> "select sysdate from dual"

But problem is, that I can't seem to execute oracle database procedures through logstash, it is giving me error:

> invalid SQL statement: "actual sql statment"

Though statement's syntax itself is fine, since I have tested the same sql through sqlplus.  
At first this procedure had a single parameter also, but then I removed it just to simplify this procedure as much as I can.

I have tried (statement must end without semi-colon, that what I have understood):

- execute sys.truncate\_audit
- exec sys.truncate\_audit
- call sys.truncate\_audit
- sys.truncate\_audit
- begin sys.truncate\_audit end
- ..

Logstash conf is as follows:

> jdbc {  
> jdbcdriverlibrary =\> "/etc/logstash/driver/oracle/ojdbc6.jar"  
> jdbcdriverclass =\> "Java::oracle.jdbc.driver.OracleDriver"  
> jdbcconnectionstring =\> "jdbc:oracle:thin:@[//hostname.domain.com:1521/zzzzz](https://hostname.domain.com:1521/zzzzz)"  
> jdbcuser =\> "YYYYYYYYY"  
> jdbcpassword =\> "XXXXXXXXXXXXX"  
> #parameters =\> { "param" =\> 'aud$'}  
> #statement =\> "execute sys.truncateaudit(:param)"  
> #statement =\> "execute sys.truncateaudit" \<-- Tried this  
> statementfilepath =\> "/root/dbaudit/test1/statement.txt" \<-- And I also tried putting this statement into separate file, same error though  
> trackingcolumn =\> "timestamp"  
> }  
> }  
> output {  
> stdout {  
> codec =\> rubydebug  
> }  
> }

Regards  
Raul

---

<div class="post-metadata">

**Author:** ![raulk89](https://avatars.discourse-cdn.com/v4/letter/r/2bfe46/32.png) [@raulk89](https://discuss.elastic.co/u/raulk89)\
**Post date:** [September 4, 2018, 5:40am UTC](https://discuss.elastic.co/t/logstash-6-2-not-able-to-execute-oracle-database-procedures/147049/2 "2018-09-04T05:40:17Z")

</div>

I also have tried logstash 6.4 with ojdbc8.jar, still same error.

Regards  
Raul

---

<div class="post-metadata">

**Author:** ![raulk89](https://avatars.discourse-cdn.com/v4/letter/r/2bfe46/32.png) [@raulk89](https://discuss.elastic.co/u/raulk89)\
**Post date:** [September 5, 2018, 6:04am UTC](https://discuss.elastic.co/t/logstash-6-2-not-able-to-execute-oracle-database-procedures/147049/3 "2018-09-05T06:04:31Z")

</div>

I finally found a way.  
I created a function for that, since there seems to be no such possibility to execute procedures. It's a same though..  
With functions I can call it via select statement, i.e. "select function from dual"

---

<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:** [October 3, 2018, 6:16am UTC](https://discuss.elastic.co/t/logstash-6-2-not-able-to-execute-oracle-database-procedures/147049/4 "2018-10-03T06:16:11Z")

</div>

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