# ES with JDBC Doesn't Pull from lastexecution start

**URL:** <https://discuss.elastic.co/t/es-with-jdbc-doesnt-pull-from-lastexecution-start/25452>\
**Category:** Elasticsearch\
**Created:** [July 13, 2015, 2:40pm UTC](https://discuss.elastic.co/t/es-with-jdbc-doesnt-pull-from-lastexecution-start/25452 "2015-07-13T14:40:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![michaellizhou](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michaellizhou/32/4143_2.png) [@michaellizhou](https://discuss.elastic.co/u/michaellizhou)\
**Post date:** [July 13, 2015, 2:40pm UTC](https://discuss.elastic.co/t/es-with-jdbc-doesnt-pull-from-lastexecution-start/25452/1 "2015-07-13T14:40:59Z")

</div>

I am trying to pull logs that are stored in a Oracle 11g DB, but I am running into a problem where JDBC importer will not pull any logs. What I want to do is pull logs from the DB at certain intervals without getting duplicates. So in the basic script oracle-connection-properties.sh if I do not have any parameters I can pull the entire table. Once I add the parameter to set a time it will no longer pull from the DB. What am I doing wrong?

> "sql" : [  
> {  
> "statement" : "select \* from cw.cwmessagelog where creation\_time \> ?",  
> "parameter" : ["$metrics.lastexecutionstart"]  
> }  
> ],  
> "index" : "myoracle",  
> "type" : "myoracle",  
> "elasticsearch" : {  
> "cluster" : "NJ\_datacenter",  
> "host" : "localhost",  
> "port" : 9300  
> },

I am trying to mimic this from the documents:

```
"sql" : [
            {
                "statement" : "select * from \"products\" where \"mytimestamp\" > ?",
                "parameter" : ["$metrics.lastexecutionstart"]
            }
        ],
        "index" : "my_jdbc_index",
        "type" : "my_jdbc_type"
    }

```

---

<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:** [July 6, 2017, 12:01am UTC](https://discuss.elastic.co/t/es-with-jdbc-doesnt-pull-from-lastexecution-start/25452/2 "2017-07-06T00:01:50Z")

</div>


