Jump to content
Server Maintenance This Week. ×

ExecuteSQL on multikey field returns single result


This topic is 3746 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I'm performing relatively simple select statement that is using criteria from a multi-keyed global field to perform the select

 

The statement is basically

 

ExecuteSQL(
"SELECT
Table1.fieldName
FROM
Table1
WHERE
Table1.id = ? ; "" ; "" ; <MULTIKEYEDGLOBALFIELD> )

 

The query works but it is only returning a single result even when there are multiple keys in the global field.  Any suggestions?

Link to comment
Share on other sites

I figured this one out myself.  I used the IN operator that allows you to search within a comma separated list of values, thusly:

Let ( [
                ~query  = "SELECT table1.field FROM table1 WHERE table1.field IN (" & Substitute ( <multi-keyed values> ; "¶" ; "," ) & ")"
                ] ;

ExecuteSQL ( ~query ; "" ; "" ) 
)
  • Like 1
Link to comment
Share on other sites

  • 11 months later...

This topic is 3746 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.