String Split – For Query

Question
I have a database table field storing length values, like 7000,7500,8100. I want to find lengths greater than 7000 or 8000. A direct query in SQL is impossible. I found a self-coded split function on the web, but it looks like that isn’t what I need. Is there any other idea?

 

Answer
Yes, it’s not a simple job to do it in SQL. Try using SPL to handle it. Below is SPL script

A

1

$select length from tb

2

=A1.conj(length.split@p(",")).select(~>8000)

An SPL script can be called from a Java application via esProc JDBC. For the invocation, see How to Call an SPL Script in Java