1 of 1 people found this helpful
ExecuteSQL is independant of the current found set. It pulls the information from the Table Occurence in the graph directly. So for example if I have a TO called USZipCodes and the
ExecuteSQL (SELECT a."City", a."ST", a."County"
FROM "USZipCodes" a
WHERE a."ZIP" = ? ; " " ; " "; "10803" )
The query would do a search for zip codes that match 10803 and return the found set. The layout you are working on can be based on any Table Occurence. The ExecuteSQL will work as long as the table occurence it is based on is in the graph.
You might take a look at Beverly Voth's ExecuteSQL the missing manual. http://www.filemakerhacks.com/?p=6406
I found this to be very helpful. Also take a look at SeedCodes SQLExplorer. Incredibly helpful when trying to develop a new query.
Just to clarify the ExecuteSQL function only supports the SELECT statement with FileMaker Pro v12, so you will not be able to use it to perform an UPDATE etc. The results can be returned to a field or a variable - so it's not directly comparable to doing a native FileMaker find operation.
If you want to manipulate the found set of records on the current layout your script would need to then use the results of the ExecuteSQL statement to then perform a find, go to Related Records etc using normal FileMaker script steps.
FileMaker 12/11/10/9/8 Certified Developer
- - - - - - - - - - - - - - - - -
Phone: +61 2 9484 6565
Mobile: +61 418 468 103