FM.QueryFieldsForBaseTableName
------------------------------

Queries the field names of all fields in the given table.

| 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.QueryFieldsForBaseTableName"; BaseTableName { ; FileName } ) 

**MBS**( **"FM.QueryFieldsForBaseTableName";** /\* Queries the field names of all fields in the given table. \*/  
**$BaseTableName**; /\* The base table name to query.e.g. "test" \*/   
**$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.QueryFields)

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| BaseTableName | The base table name to query. | "test" |  |
| 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 field names of fields separated by return.

### Description

Queries the field names of all fields in the given table.  
See also [FM.QueryFieldsForTableName](FMQueryFieldsForTableName.md).  
  
Needs permissions to query your database schema via SQL.  
### Examples

Query fields in table Kontakte in file Kontakte:

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

- [FM.ExecuteFileSQL](FMExecuteFileSQL.md)
- [FM.ExecuteSQL](FMExecuteSQL.md)
- [FM.QueryFieldsForTableName](FMQueryFieldsForTableName.md)

### Release notes

- **Version 9.1**
    - Rewrote [FM.QueryFieldsForTableName](http://www.mbsplugins.eu/FMQueryFieldsForTableName.shtml) and [FM.QueryFieldsForBaseTableName](http://www.mbsplugins.eu/FMQueryFieldsForBaseTableName.shtml) to avoid join operation and gain better performance with lots of tables.

### 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)
- [MBS FileMaker Plugin, version 9.1pr1](https://www.mbsplugins.de/archive/2019-02-06/MBS_FileMaker_Plugin_version_9/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 7th October 2020

  
[FM.QueryCustomFunctionsList](FMQueryCustomFunctionsList.md) - [FM.QueryFieldsForTableName](FMQueryFieldsForTableName.md)

[HTML Version](FMQueryFieldsForBaseTableName.shtml)