charlest Posted September 12, 2014 Share Posted September 12, 2014 Is it possible to use Get functions within execute sql statements such as... ExecuteSql(" SELECT dept_t FROM employees WHERE employee_id = ?" ; ""; ""; Get(AccountName)) I have tried this statement and I can't get it to evaluate in the data viewer. Link to comment Share on other sites More sharing options...
eos Posted September 12, 2014 Share Posted September 12, 2014 Is it possible to use Get functions within execute sql statements [â¦]  You can use whatever you like to build a string which is a valid SQL statement, including native Filemaker functions as parameters (taking into account the usual caveats as context and [in the case of Get() functions] stored vs. unstored, etc.).  Here is your function used verbatim:   [â¦] I have tried this statement and I can't get it to evaluate in the data viewer.  Did you get an error, or an empty result? Link to comment Share on other sites More sharing options...
charlest Posted September 12, 2014 Author Share Posted September 12, 2014 Empty Result Link to comment Share on other sites More sharing options...
Wim Decorte Posted September 12, 2014 Share Posted September 12, 2014 empty result means that there is no syntax error but that there is really nothing found. I would capture the Get(AccountName) in its own variable and use that variable in the SQL query. Much easier to troubleshoot. Remember that SQL is case sensitive. So if the data record has "Wim" but I log in with "wim" then there will be no match. The FM account names are not case sensitive. So you may want to convert your data to all lower or all upper case and do the same with the result of the Get(AccountName) function, 2 Link to comment Share on other sites More sharing options...
charlest Posted September 12, 2014 Author Share Posted September 12, 2014 Thanks. That was it, the case sensitivity. Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 3513 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 accountSign in
Already have an account? Sign in here.
Sign In Now