FM.QueryTableNames
------------------

Queries the table names of all files currently open.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [FM](component_FM.md) [FMSQL](component_FMSQL.md) | [3.1](newinversion31.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "FM.QueryTableNames" { ; FileName } ) 

**MBS**( **"FM.QueryTableNames";** /\* Queries the table names of all files currently open. \*/  
**$FileName**) /\* Optional; The database file name to look into.  
If empty or missing, we look in current database.  
(new in 6.2)e.g. "Contacts" \*/ 

(old name: FM.QueryTables)

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| FileName | The database file name to look into.   If empty or missing, we look in current database.   (new in 6.2) | "Contacts" | Optional |

### Result

Returns names of tables separated by return.

### Description

Queries the table names of all files currently open.  
May be limited to what you are allowed to access.  
See also [FM.QueryBaseTableNames](FMQueryBaseTableNames.md), which is usually faster.  
  
Needs permissions to query your database schema via SQL.  
### Examples

Query tables in database Kontakte:

 MBS ( "FM.QueryTableNames"; "Kontakte" )  
### See also

- [FM.ExecuteFileSQL](FMExecuteFileSQL.md)
- [FM.ExecuteSQL](FMExecuteSQL.md)
- [FM.QueryBaseTableNames](FMQueryBaseTableNames.md)

### Blog Entries

- [MBS FileMaker Advent calendar - Door 15 - Information about tables and base tables](https://www.mbsplugins.de/archive/2025-12-15/MBS_FileMaker_Advent_calendar_/monkeybreadsoftware_blog_filemaker)
- [FileMaker 19.2 and the new fmplugin extended privilege](https://www.mbsplugins.de/archive/2020-12-16/FileMaker_192_and_the_new_fmpl/monkeybreadsoftware_blog_filemaker)
- [Comparing Base Elements Plugin to MBS FileMaker Plugin](https://www.mbsplugins.de/archive/2017-10-24/Comparing_Base_Elements_Plugin/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 6.2pr3](https://www.mbsplugins.de/archive/2016-04-05/MBS_FileMaker_Plugin_version_6/monkeybreadsoftware_blog_filemaker)
- [MBS Filemaker Plugin, version 3.1pr3](https://www.mbsplugins.de/archive/2012-12-17/MBS_Filemaker_Plugin_version_3/monkeybreadsoftware_blog_filemaker)
- [MBS Filemaker Plugin, version 3.1pr1](https://www.mbsplugins.de/archive/2012-12-14/MBS_Filemaker_Plugin_version_3/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 18th August 2014 , last changed 16th September 2021

  
[FM.QueryFieldsForTableName](FMQueryFieldsForTableName.md) - [FM.RecordStatistics](FMRecordStatistics.md)

[HTML Version](FMQueryTableNames.shtml)