Skip to content

Instantly share code, notes, and snippets.

@chivalry
Created April 11, 2015 06:54
Show Gist options
  • Save chivalry/4c882c2f2c99ab653e4a to your computer and use it in GitHub Desktop.
Save chivalry/4c882c2f2c99ab653e4a to your computer and use it in GitHub Desktop.
A standard template for bulletproof ExecuteSQL in FileMaker.
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