AnsweredAssumed Answered

Execute SQL and INSERT statements using local field data

Question asked by bcmillerway on Jan 17, 2016
Latest reply on Jan 19, 2016 by beverly

1. I have an FMP database set up as an ODBC datasource.

 

2. I want to put local field data into the ODBC datasource via the 'Execute SQL' script step using the INSERT command. By 'local field data' I mean data from the FMP file from which the script is being executed.  So FMPfile1 is sending field data to FMPfile2 -which is the ODBC datasource.

 

3. If I hardcoded the INSERT command it would look like this:

 

  INSERT INTO data (city,state,zip) VALUES ('Chattanooga','TN','37407')

 

and that works successfully.

 

4. But I don't want to have to hardcode the values which are being drawn from my current FMP database. I want to use values either directly from fields or from values returned via the 'ExecuteSQL' function.

 

5. I've tried various query syntaxes typically resulting in:

 

  [FileMaker][FileMaker] FQL0001/(1:159463082): There is an error in the syntax of the query.

 

I know there are alternate, more round about methods to accomplish this but the Execute SQL script step method seems so direct and simple.

 

Has anyone done this successfully?

 

 

Thanks

Outcomes