Help

Table Of Contents
Accessing external data sources
F
ILEMAKER PRO HELP 562
You can also use SQL statements that go beyond simply importing data into a FileMaker Pro
database file. For example, you could execute SQL statements that add records to a database table
in SQL Server, using information from a FileMaker
Pro database file.
To execute SQL statements against a data source via ODBC:
1. Choose Scripts menu > Manage Scripts.
2. Click New.
3. Add the Execute SQL script step to the script.
It appears in the Miscellaneous category.
4. Select the Execute SQL script step and click Specify.
5. In the Specify SQL dialog box, click Specify.
6. Select your data source and click Continue.
You might be asked for a user name and password.
7. In the Specify SQL dialog box, enter your SQL statements.
See your data source documentation for a listing of supported SQL statements and their syntax.
8. Click OK.
Related topics
Constructing an SQL query for importing via ODBC
Storing an SQL query in a field
You can store an SQL query in a text field for use with the Import Records script step or Execute
SQL script step.
To store a query in a field, do one of the following:
Type a query directly into a field.
Create a query dynamically in a calculation field.
Use the SQL Query builder to construct a query, then copy and paste it into a field.
Notes on stored queries:
When you execute a stored query, error checking is performed at runtime only. Use
Get(LastError) function, and then use Get(LastODBCError) function to return the last
readable error string that is generated by the ODBC driver.
The SQL Query builder validates queries for use only with FileMaker Pro.
You can store and execute a different query in each record of your database file.
You can store a query in a global field to guarantee the same query is executed
regardless of which record you are on.
Automating ODBC import using the Import Records script step
Because accessing ODBC data sources is a task you might repeat frequently, you can create a
script with the Import Records script step that automates ODBC import. Some script step options
behave differently than when used with other file formats.