Syntax
ans=FMsqlQuery(conn,sqlreq)
Input Parameter
conn : | | Connector to a FileMaker database |
sqlreq : | | sql request |
Output Parameter
Examples
Different helpful requests:
FMsqlQuery(conn,'SELECT TableName FROM FileMaker_Tables')
FMsqlQuery(conn,'SELECT * FROM FileMaker_Tables')
FMsqlQuery(conn,'SELECT * FROM FileMaker_Fields)
References
Filemaker (2013): "SQL-Referenzhandbuch FM 13", https://fmhelp.filemaker.com/docs/13/de/fm13_sql_reference.pdf
Copyright 2017-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth
Algorithm (Workflow)
The function FMsqlQuery
is designed to execute a SQL query on a FileMaker database and return the results. It is part of the SG-Library and was introduced in SolidGeometry 3.5.
Input Parameters
- conn: This is the connector to a FileMaker database. It is used to establish a connection to the database where the SQL query will be executed.
- sqlreq: This is the SQL request or query that will be executed on the FileMaker database. It is a string containing the SQL command.
Output Results
- ans: This is the answer or result of the SQL query. It contains the data retrieved from the database based on the SQL request.
- curs: This is the cursor object that is used to execute the SQL query and fetch the results. It is an intermediate object that helps in retrieving the data.
Algorithm Steps
- The function begins by executing the SQL query using the
exec
function, which takes the connection object conn
and the SQL request sqlreq
as inputs. This returns a cursor object curs
.
- The cursor object
curs
is then used to fetch the results of the query using the fetch
function. This function retrieves the data from the database and stores it in the ans
variable.
- The data retrieved is accessed through
ans.Data
, which contains the actual results of the SQL query.
Example Usage
Here are some example SQL queries that can be executed using the FMsqlQuery
function:
FMsqlQuery(conn,'SELECT TableName FROM FileMaker_Tables')
: This query retrieves the names of all tables in the FileMaker database.
FMsqlQuery(conn,'SELECT * FROM FileMaker_Tables')
: This query retrieves all information from the FileMaker_Tables
table.
FMsqlQuery(conn,'SELECT * FROM FileMaker_Fields')
: This query retrieves all information from the FileMaker_Fields
table.
Algorithm explaination created using ChatGPT on 2025-08-18 23:35. (Please note: No guarantee for the correctness of this explanation)
Last html export of this page out of FM database by TL: 2025-09-21