FMsqlQuery

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Filemaker
Introduced first in SolidGeometry 3.5, Creation date: 2017-02-28, Last change: 2025-09-14

returns the answer to a SQL request to a FileMaker database



See Also: FMhelp , FMinitJDBC , FMopen , FMgetFieldTabs

Example Illustration

 missing image of FMsqlQuery(conn,sqlreq)

Syntax

ans=FMsqlQuery(conn,sqlreq)

Input Parameter

conn: Connector to a FileMaker database
sqlreq: sql request

Output Parameter

ans: answer

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

Output Results

Algorithm Steps

  1. 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.
  2. 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.
  3. 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:

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