Creating Dynamic SQL Query in JDBC Data Source
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2019 07:51 PM
We have created a JDBC data source that fetches data from SQL Server. The data it gets is based on correlation_id provided on RITM. For now, we have to manually update the sql query like below:
select * from table where correlation_id IN ('123');
If we don't put the where condition, it will be fetching all requests from the server. We want to limit the records to the ones that are currently in ServiceNow.
Is there a way to pass on these correlation_id dynamically to the sql query? OR any other way to achieve this functionality?
- Labels:
-
Integrations

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2019 09:15 PM
i did not test but can you try something like this.
select * from table where correlation_id IN (SELECT correlation_id FROM table );