Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

Posted
Wim - I got this from something you wrote. 

Where can I get information (Reading 101 type info - it seems to me that the FM Site has little in the way of worked examples - or im missing something) on the structure of this code? 
I understand SELECT * FROM myTable WHERE myField = something but what is the ? and later what is the ;"";"";

ExecuteSQL(
"SELECT id FROM myTable WHERE myField = ? and id <> ?" ;
"" ;
"" ;
myTable::myField ;
myTable::ID
)
Posted

This would be a good place to start:

http://www.filemaker.com/help/14/fmp/en/html/func_ref1.32.185.html

and then:

http://filemakerhacks.com/2012/10/19/the-missing-fm-12-executesql-reference/

 

In a nutshell:

the empty quotes in the function's argument list is to signal that FM can use the default column and record delimiters.  You can specify your own delimiters instead of the default ones.

The "?" is a parameter placeholder.  If you use it, you have to tag the parameter itself to the end of the arguments list.

Using parameters solves two issues:

- it protects against SQL injection mis-use of your query

- FM will properly format and quote any data you pass as a parameter (single quotes for text, no quotes numbers, proper format for date, time and timestamps,...).  If you don't use parameters you have to make sure your values are properly quotes and formatted.

This topic is 3466 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.