SQAPL: "elastic" binding?
2 posts
• Page 1 of 1
SQAPL: "elastic" binding?
I'd like to do a SELECT using an IN-Filter with an variable number of elements. Is there an elegant way to data-bind vector into that statement?
In other words: I'd like to get (vals ∊ krit)/id for any ⍴ of krit - in SQL, and for safety-reasons I'd like to use databinding: 'SELECT id FROM table WHERE vals IN (:{???}:)' and have the elements of krit inserted. Is there a way to do this???
In other words: I'd like to get (vals ∊ krit)/id for any ⍴ of krit - in SQL, and for safety-reasons I'd like to use databinding: 'SELECT id FROM table WHERE vals IN (:{???}:)' and have the elements of krit inserted. Is there a way to do this???
-
MBaas - Posts: 156
- Joined: Thu Oct 16, 2008 1:17 am
- Location: Gründau / Germany
Re: SQAPL: "elastic" binding?
I'm afraid that I don't think there really *is* a good / elegant solution. You could perhaps prepare a statement with some number of bind variables (say 25) and then use it repeatedly. Other strategies, depending on your data, would be to compute a some paris of maximum/minimum values, select all records between them and do the final filtering in APL.
Finally, insert the values into a temporary table using "bulk input" and join with it? :-)
Finally, insert the values into a temporary table using "bulk input" and join with it? :-)
-
Morten|Dyalog - Posts: 453
- Joined: Tue Sep 09, 2008 3:52 pm
2 posts
• Page 1 of 1
Return to Windows: GUI, COM/OLE/ActiveX
Who is online
Users browsing this forum: No registered users and 1 guest
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group