# Loading data from a stored procedure

**URL:** <https://discuss.elastic.co/t/loading-data-from-a-stored-procedure/202860>\
**Category:** Logstash\
**Created:** [October 9, 2019, 2:55pm UTC](https://discuss.elastic.co/t/loading-data-from-a-stored-procedure/202860 "2019-10-09T14:55:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![DottorP](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dottorp/32/52891_2.png) [@DottorP](https://discuss.elastic.co/u/DottorP)\
**Post date:** [October 9, 2019, 2:55pm UTC](https://discuss.elastic.co/t/loading-data-from-a-stored-procedure/202860/1 "2019-10-09T14:55:38Z")

</div>

I'm trying to load data from Oracle into my index.  
I need to use a stored procedure, which uses a cursor to iterate over data.  
My SQL cript begins with a declaration section, in which I declare the cursor and the temporary variable. The error I receive is  
`[2019-10-08T17:14:00,698][WARN][logstash.inputs.jdbc] Exception when executing JDBC query {:exception=>#<Sequel::DatabaseError: Java::JavaSql::SQLException: SQL string is not Query>} [2019-10-08T17:15:00,753][ERROR][logstash.inputs.jdbc] Java::JavaSql::SQLException: SQL string is not Query: DECLARE`

I tried also with a script without the declare section, but I receive the same error. My question is: is it possible to do what I'm trying to do?

---

<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:** [November 6, 2019, 2:55pm UTC](https://discuss.elastic.co/t/loading-data-from-a-stored-procedure/202860/2 "2019-11-06T14:55:39Z")

</div>

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