Jump to content

Get functions with execute sql


 Share

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

Recommended Posts

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

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:

 

post-80889-0-40501200-1410529686_thumb.p

 

[…] 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

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,

  • Like 2
Link to comment
Share on other sites

This topic is 2517 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
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.