July 2, 201411 yr Hi, I have a one record table that holds my password. I would like to check to see if it is "NOT Empty". If not empty then I want to call my "Admin Password" script. The following if statement i wrote is ignored. If ( ExecuteSQL ( " Select PasswordAdmin From Preferences Where PasswordAdmin Is Not Null " ; "" ; "" ) Admin Passcode Script ) End If I am having trouble locating simple examples for Filemaker, all the the examples for Filemaker are complicated to me and the W3 School only has the following for Is Null ... SELECT LastName,FirstName,Address FROM PersonsWHERE Address IS NULL Any assistance I would be grateful. Thank you. Tom
July 3, 201411 yr I don't think the issue is your understanding of ExecuteSQL() but of If(). If() will return False for non-numeric values. If your password contains only letters, you will run your script. You need to wrap your ExecuteSQL() statement in an IsEmpty() function.
July 3, 201411 yr I would say, since it's a one-record table, just select the field without any conditions. Then tell your script what to do with the result. Something like: Set Variable[ $pwd ; ExecuteSQL ( "Select PasswordAdmin From Preferences" ; "" ; "" ) ] If[ not IsEmpty( $pwd ) ] Perform Script[ Admin Passcode Script ] End If
July 3, 201411 yr Uhmm... just a general admonition against keeping any kind of passwords in a database. And another one against loading any kind of sensitive data into variables.
Create an account or sign in to comment