Created
April 11, 2015 06:54
-
-
Save chivalry/4c882c2f2c99ab653e4a to your computer and use it in GitHub Desktop.
A standard template for bulletproof ExecuteSQL in FileMaker.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Let ( | |
[ | |
_alias = "a"; | |
_a_pro = devp.GetTableName ( PRO::___PRO ) & " " & _alias; | |
_a_act = _alias & "." & devp.GetFieldName ( PRO::__f_ACT ); | |
_a_ka_project_id = _alias & "." & devp.GetFieldName ( z_base_project_id ) ; | |
_sql = "SELECT MAX( " & _a_ka_project_id & " ) | |
FROM " & _a_pro & " | |
WHERE " & _a_act & " = ? " ; | |
_query_result = ExecuteSQL ( _sql ; devp.Nil ; devp.Nil ; __f_ACT ); | |
_result = _query_result + 1 | |
] ; | |
_result | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment