How to write dynamic sql query in a data source
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2011 02:16 AM
I have a scenario where I need to query a database and get the details of users specified in the where condition.The condition looks like this:
select * from myTable where employeeId IN(501763663,501732323,500117338,....100 such entries,501689434)
Now the problem that I am facing is the mid server is taking too long to respond and finally I get an error saying 'Did not get any response from the mid server after waiting for 310 seconds'. This may be due to in efficiency of IN query.
If I run the same query in the PL SQL,I get the response in 10-15 seconds.
So I thought of running the data source multiple times for each employee id by making the sql query dynamic.The query will look like this.
select * from myTable where employeeId = 501763663;
Immediately after running this data source I will update the data source sql statement and run the data source again.
select * from myTable where employeeId = 501732323;
This approach does not seem to work properly.
Can anyone please provide some help on this?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2019 02:46 PM
found something around JDBC probe https://docs.servicenow.com/bundle/madrid-platform-administration/page/integrate/inbound-other-web-s...