Tyra Posted October 2, 2015 Posted October 2, 2015 I think I am missing a fundamental piece.. If I run the following: Execute SQL [ ODBC Data Source: MySqlDatabase; Calculated SQL Text: "SELECT * FROM Client"] And it works, where is the data/object returned? I am trying to query an external MySql database and check to see if a value exists in a table, and if it does to reurn the uid of that record. But, can seem to get a very simple statment like the above to work?
Fitch Posted October 2, 2015 Posted October 2, 2015 You could try setting a variable to Get(LastODBCError) after your query. I haven't tried it, but I wonder if that would give you enough info to at least tell if a record exists. The script step is kind of a weird one -- it lets you manipulate data in the sql database but not query it. Contrast with the ExecuteSQL calculation, which does the inverse. If it's a supported version of MySql, you can add tables from the MySql database directly to your FileMaker relationship graph and then use a native FileMaker Find, or use the ExecuteSQL calculation to return the results.
Wim Decorte Posted October 2, 2015 Posted October 2, 2015 The Execute SQL script step is not meant to return data so you can't do SELECT with it; it is for pushing data to the data source. The "import from ODBC source" is meant to do SELECTs 1
beverly Posted October 3, 2015 Posted October 3, 2015 On the other hand INSERT can use the result of a SELECT (as in any SQL) in the query http://www.w3schools.com/sql/sql_insert_into_select.asp But that's all result back into the SQL db from the SQL db and would use the Execute SQL script step. Nothing would be returned to FM except any logs of the transaction if logs are set up in the ODBC DSN (data source name) Tyra can you provide more details of what you are trying to do? beverly
Recommended Posts
This topic is 3416 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