![]() |
Next Page |
| Contents > Script steps reference (alphabetical list) > Miscellaneous script steps > Execute SQL script step |
|
|
| Execute SQL script step |
| Format |
Execute SQL [No Dialog; ODBC: <datasource name>; <native SQL |
| Options |
| Perform without dialog prevents the Specify SQL dialog box, the Select ODBC Data Source dialog box, and the Password dialog box from displaying when the script step executes. |
| Click Specify to display the Specify SQL dialog box, where you can set the following options. |
|
|
|
|
| Web compatibility |
| This script step is not web-compatible. |
| Description |
| Executes any SQL statement. You can use this script step to manage data in a foreign data source through an ODBC SQL interface. This provides more control over the FileMaker Pro interaction with ODBC data sources. You can add multiple Execute SQL steps to a script. |
| Important See Get functions for information about error handling. |
| Get(LastODBCError) function returns the latest error state returned by ODBC. |
| Get(LastError) function returns the last FileMaker Pro error. |
| Examples |
| The following example of a manual SQL statement entry executes once each time you run the Execute SQL script step. |
INSERT INTO Employees (EmployeeID, FirstName, LastName, Title, |
UPDATE Employees SET Title = 'Manager' WHERE EmployeeID = 103 |
| The following example of a field-based SQL statement shows a calculation field that concatenates text with a field that can be used to insert or update a number of records in the found set. |
"INSERT INTO Employees (EmpID, LastName) Values (" & EmpID & "," |
| With EmpID of 103 and Lastname of "Smith" the calculation of the field above is translated to: |
INSERT INTO Employees (EmpID, LastName) Values (103,'Smith') |
| Related topics |
| Script steps reference (alphabetical list) |
| Script step categories |
|
|
| Contents > Script steps reference (alphabetical list) > Miscellaneous script steps > Execute SQL script step | Next Page |