All Apps and Add-ons

DB Connect with Multiple Parameters

bschaap
Path Finder

I have the need to write a query like below in order to limit the number of rows returned to 1000 at a time. I need to write similar to the following for performance reasons. The query plan goes awry for the left join portion in my specific query unless I tell it to limit TABLE2's FKID as well.

SELECT t1.ID, ...
FROM Table1 t1
LEFT JOIN TABLE2 t2 ON t1.ID = t2.FKID AND t2.FKID > ? AND t2.FKID <= ? + 1000
WHERE t1.ID > ? AND t1.ID <= ? + 1000

However, I receive this error message when clicking the "Execute SQL" button.
com.microsoft.sqlserver.jdbc.SQLServerException: The value is not set for the parameter number 2

Does anyone have any suggestions to resolve? The only option I can think of is to create a stored proc that accepts a single param to resolve.

Thanks!

Brian

Tags (1)
0 Karma
Get Updates on the Splunk Community!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...