SQL.GetFieldNameList
--------------------

Queries list of field names.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [SQL](component_SQL.md) | [5.1](newinversion51.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "SQL.GetFieldNameList"; Command ) 

**MBS**( **"SQL.GetFieldNameList";** /\* Queries list of field names. \*/  
**$Command**) /\* The command reference number gained with [SQL.NewCommand](SQLNewCommand.md). \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Command | The command reference number gained with [SQL.NewCommand](SQLNewCommand.md). | $Command |

### Result

Returns list or error.

### Description

Queries list of field names.  
### Examples

Create a command, fill parameters and query names and values list:

 #Create select   
Set Variable \[$Command ; Value:MBS ("[SQL.NewCommand](SQLNewCommand.md)"; $Connection ; "SELECT \* FROM Test")\]  
\#Run it   
Set Variable \[$result ; Value:MBS ("[SQL.Execute](SQLExecute.md)"; $Command )\]  
\#get first row of result   
Set Variable \[$result ; Value:MBS ("[SQL.FetchNext](SQLFetchNext.md)"; $Command )\]  
\# Now query field names   
Set Variable \[$FieldNames ; Value:MBS ("SQL.GetFieldNameList"; $Command )\]  
\# and field values of first row   
Set Variable \[$FieldValues ; Value:MBS ("[SQL.GetFieldValueList](SQLGetFieldValueList.md)"; $Command )\]  
### See also

- [SQL.Execute](SQLExecute.md)
- [SQL.FetchNext](SQLFetchNext.md)
- [SQL.GetFieldName](SQLGetFieldName.md)
- [SQL.GetFieldValue](SQLGetFieldValue.md)
- [SQL.GetFieldValueList](SQLGetFieldValueList.md)
- [SQL.GetParamNameList](SQLGetParamNameList.md)
- [SQL.NewCommand](SQLNewCommand.md)

### Example Databases

- [SQL to other databases/Microsoft Access Execute](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/SQL%20to%20other%20databases/Microsoft%20Access%20Execute.shtml#1ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Plugin, version 5.1pr4](https://www.mbsplugins.de/archive/2015-04-08/MBS_FileMaker_Plugin_version_5/monkeybreadsoftware_blog_filemaker)

This function is free to use.

Created 8th April 2015 , last changed 8th April 2015

  
[SQL.GetFieldName](SQLGetFieldName.md) - [SQL.GetFieldOption](SQLGetFieldOption.md)

[HTML Version](SQLGetFieldNameList.shtml)