# JDBC - Using parameter for both SQL statement and last\_run\_metadata\_path

**URL:** https://discuss.elastic.co/t/jdbc-using-parameter-for-both-sql-statement-and-last-run-metadata-path/176860
**Category:** Logstash
**Created:** [April 15, 2019, 8:40am UTC](https://discuss.elastic.co/t/jdbc-using-parameter-for-both-sql-statement-and-last-run-metadata-path/176860 "2019-04-15T08:40:25Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![saif3r](https://avatars.discourse-cdn.com/v4/letter/s/49beb7/32.png) [@saif3r](https://discuss.elastic.co/u/saif3r)
#### Post date: [April 15, 2019, 8:40am UTC](https://discuss.elastic.co/t/jdbc-using-parameter-for-both-sql-statement-and-last-run-metadata-path/176860/1 "2019-04-15T08:40:25Z")

</div>

Hello,

I'm querying several different databases with the exact same sql statement. The only difference between them is the database name and sql\_last\_value based on ID. Is it possible to use one jdbc input so that it will cover all databases and create separate last\_run\_metadata\_path?

Let's say I'm using two databases: CARS, SCOOTERS  
My queries would look like this:

> select \* from CARS  
> select \* from SCOOTERS

So the input would run both queries and create two separate last\_run\_metadata\_path files, for example: `.last_run_query_CARS` and `.last_run_query_SCOOTERS.`  
If not, i will use separate jdbc input entries.  
Thanks.

---

<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 13, 2019, 8:40am UTC](https://discuss.elastic.co/t/jdbc-using-parameter-for-both-sql-statement-and-last-run-metadata-path/176860/2 "2019-05-13T08:40:32Z")

</div>

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