# How to execute usual SQL query during scenario

**URL:** <https://community.gatling.io/t/how-to-execute-usual-sql-query-during-scenario/4495>\
**Category:** Gatling (Open-Source)\
**Created:** [September 12, 2018, 7:17am UTC](https://community.gatling.io/t/how-to-execute-usual-sql-query-during-scenario/4495 "2018-09-12T07:17:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![user9](https://avatars.discourse-cdn.com/v4/letter/u/ebca7d/32.png) [@user9](https://community.gatling.io/u/user9)\
**Post date:** [September 12, 2018, 7:17am UTC](https://community.gatling.io/t/how-to-execute-usual-sql-query-during-scenario/4495/1 "2018-09-12T07:17:12Z")

</div>

I have specific task.  
During scenario I’m creating a new object, and unfortunatly, server doesn’t send back ID of created object. That’s why I have to execute usual SQL query to get ID of this object.  
I know about gatling - jdbc tool and I has write the code for SQL selection

`

```auto
val technic_root_id = exec(jdbc("selection").select("technic_root_id").from("ods_req_car.technic_request").where("id = ${car_request_id}"))

```

`  
In scenarion I call it through this exec:

`

```auto
.exec(Technic.viewTechnicCard(Technic.technic_root_id.toString))

```

`

In output log I see the following

`  
GET [http://server.host/api/tech/ChainBuilder(List(JdbcSelectionWithWhereActionBuilder(\<function1\>,\<function1\>,\<function1\>,io.gatling.core.session.el.ElCompiler$$$Lambda$338/879423823@6464ef69)](http://server.host/api/tech/ChainBuilder(List(JdbcSelectionWithWhereActionBuilder(%3Cfunction1%3E,%3Cfunction1%3E,%3Cfunction1%3E,io.gatling.core.session.el.ElCompiler%24%24%24Lambda%24338/879423823@6464ef69))))?loadTree=true

`

Seems like this is not what I want. This is not ID of my object after tech/ part of URL.  
Please help, how can I execute SQL query during scenario correct ?

---

<div class="post-metadata">

**Author:** ![slandelle](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/slandelle/32/4_2.png) [@slandelle](https://community.gatling.io/u/slandelle)\
**Post date:** [September 12, 2018, 7:39am UTC](https://community.gatling.io/t/how-to-execute-usual-sql-query-during-scenario/4495/2 "2018-09-12T07:39:00Z")

</div>

It looks like you’re using this community plugin: [https://github.com/codecentric/gatling-jdbc](https://github.com/codecentric/gatling-jdbc)

On this mailing list, you’ll only find information regarding official components.  
I don’t see any way to reach the author of this plugin on the README, so I’m afraid you’ll have to go with the [bugtracker](https://github.com/codecentric/gatling-jdbc/issues).
